This topic describes the preparations for extension development.
Limits
- Only DataWorks Enterprise Edition or a more advanced edition supports the Extensions module. Note If DataWorks Enterprise Edition expires, extensions become invalid and cannot be triggered to check extension point events. If an extension is triggered to check an event and has not completed the check when DataWorks Enterprise Edition expires, the check is terminated and the check result Check Passed is returned.
- You can associate multiple extensions with the same event. This way, the associated extensions are triggered if the event occurs.
- If node groups, such as Machine Learning Platform for AI nodes, do-while nodes, and for-each nodes, trigger extension checks, you must wait for all inner nodes of the node groups to pass the checks before you can perform subsequent operations.
Preparation 1: Enable the event message subscription feature
- For more information about how to enable the event message subscription feature, see Enable event message subscription.
- For information about the message bodies for different types of events, see Appendix: Formats of event messages sent to EventBridge.
Preparation 2: Register an extension
Before you develop an extension, you must register the extension in DataWorks and obtain the extension code for later code development. To register an extension, perform the following steps:
- Log on to the DataWorks console and go to the Extensions page.
- Click Register Extensions. In the Register Extension dialog box, configure the parameters. Note During the preparation, you need to configure only the required parameters. You can configure the optional parameters after you develop and debug the extension.
The required parameters include Extension name, Extension point of processing, Head, and Test workspace. The rest of the parameters can be configured after the extension is developed and deployed. The following table describes the parameters.
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
key=value
. For more information about how to use these parameters, see Advanced feature: Configure extension parameters.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. - Click OK. On the Extensions tab, you can view the extension code in the Extension Code column.