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

The Extensions module works with the OpenEvent module to enable automatic response to extension point events in the following way: DataWorks sends event messages to extensions by using the OpenEvent module. The extensions receive the messages and check the extension point events. Before you develop an extension, you must enable the event message subscription feature. You must also obtain the Kafka configurations and check the message bodies for different types of events to facilitate extension code development.

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:

  1. Log on to the DataWorks console and go to the Extensions tab.
    1. Log on to the DataWorks console by using your Alibaba Cloud account or as a RAM user to which the AliyunDataWorksFullAccess policy is attached.
    2. In the left-side navigation pane, click Open Platform. On the Open Platform page, click the Extensions tab.
      Extensions
  2. Click Register Extension. 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.
    Register an extensionThe required parameters include Extension Name, Processed Extension Points, Owner, and Workspace for Testing. 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.
    Processed Extension Points 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.
    Owner The person in charge of the extension. Users of the extension can contact the extension owner at the earliest opportunity when they encounter problems.
    Workspace for Testing 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 Kafka and whether the extension checks the events and sends the check results to DataWorks.

    Extension 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 Documentation 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.

    Parameters for Extension 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 Configure extension parameters.

    Options for Extension 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 Define options for an extension.
  3. Click OK.
    On the Extensions tab, you can view the extension code in the Extension Code column. extension code

What to do next

After you obtain the Kafka configurations, the message bodies for different types of DataWorks events, and the extension code, you can develop and deploy the extension. For more information, see Develop and deploy a custom extension.