DataWorks allows you to use a custom extension to process extension point events to which you subscribe and send processing results to DataWorks by using the OpenAPI module. This topic describes how to develop a custom extension and the precautions that you must take during the procedure.
Prerequisites
The message subscription feature is enabled, a custom extension is registered, and the information that is required to develop the extension is obtained. For more information, see Preparations.
Develop a custom extension
- Subscribe to and parse the messages of extension point events.
- The OpenEvent module of DataWorks Open Platform uses EventBridge to distribute event messages. You can subscribe to event messages by using EventBridge. For more information, see What is EventBridge?.
- For information about the message formats of extension point events that are sent to EventBridge, see Appendix: Formats of event messages sent to EventBridge.
- Obtain the snapshots of extension point events and process events based on the snapshots.
- You can configure the
messageId
parameter in the API operation that you called to obtain the snapshots of extension point events.Note- You can call the UpdateIDEEventResult API operation for extension point events in DataStudio and the UpdateWorkbenchEventResult API operation for extension point events in Operation Center.
- You can obtain the value of the
messageId
parameter by parsing event messages.
- You can use parameters to improve effectiveness of code development and application. For example, you can use the built-in parameter
extension.project.disabled
of a custom extension to specify that the extension does not take effect for the specified workspaces. For more information about the built-in parameters that you can use to develop extension code, see Advanced feature: Configure extension parameters.
- You can configure the
- Send processing results to DataWorks. You can call an API operation to configure the extension to return the processing results of extension point events to DataWorks.Note You can call the UpdateIDEEventResult API operation for extension point events in DataStudio and the UpdateWorkbenchEventResult API operation for extension point events in Operation Center.
Sample code used to develop a custom extension
Deploy a custom extension

Parameter | Description |
---|---|
Extension name | The name of the extension. |
Extension point of processing | The type of the extension point event that you want the extension to check. For more information about supported extension point events, see Supported extension point events. You can configure this parameter based on your business requirements. Note After you configure this parameter, the system automatically configures the Event and Applicable module parameters. |
Head | The person in charge of the extension. Users of the extension can contact the extension owner at the earliest opportunity when they encounter problems. |
Test workspace | The workspace that is used to test the extension. To check whether the extension is effective, you do not need to deploy the extension because the test workspace supports an end-to-end test that allows you to check whether the extension works as expected. In the test workspace, developers can trigger events to check whether DataWorks sends related messages to the extension by using EventBridge and whether the extension checks the events and sends the check results to DataWorks. |
Extensions Details Address | The URL of the extension details page. After you develop and deploy the extension, you can develop a web page to display how the extension works. Set this parameter to the page URL so that users can visit this web page to better understand and use the extension. For example, users can visit the web page to check why a node is blocked by the extension. |
Extension document address | The URL of the extension documentation page. After you develop and deploy the extension, you can develop a help documentation page. Set this parameter to the page URL so that users can know the business logic and properties of the extension. |
Extensions parameter configuration | The extension parameters. To improve the extension development and application efficiency, you can enter both the built-in parameters for typical scenarios and custom parameters for future reference. You can enter multiple parameters, each occupying a separate line and defined in the format of |
Extensions option configuration | The configuration item for the extension. The extension developer provides this parameter for users to implement custom process management in different workspaces based on their business requirements when the users register the extension. The extension developer must define the configuration item in JSON strings in the Register Extension dialog box. For example, the extension developer allows users to manage the length of an SQL statement based on this parameter. For more information about the JSON format, see Advanced feature: Define options for an extension. |