After you register, publish, and enable an extension on the DataWorks Open Platform, DataWorks sends an event message to the extension whenever an extension point event is triggered in the relevant workspace. Based on the extension's response, DataWorks determines whether to allow the operation. This topic describes the extension point events that Data Studio supports and explains how to use them to trigger an extension.
Prerequisites
-
You have enabled message subscription. For more information, see Enable message subscription.
-
You have developed and deployed the extension. For more information, see Develop and deploy an extension using Function Compute.
Background information
-
Enable the extension.
On the Management Center page, you can view the Extensions and enable or disable the extension check for the current workspace.
-
Extension point events in Data Development.
The Data Studio module of DataWorks supports extension point events such as pre-publish file, pre-commit file, and pre-submit table events. For a detailed list of extension point events and related concepts, see List of supported extension point events.
-
DataWorks can send message notifications for extension point events. Extensions can then automatically validate and respond to these events. For more information about the trigger process, see Supported extension point events.
Limits
When an extension is enabled, the following limits apply to message notifications and responses for events triggered during data development.
-
After a built-in extension is enabled, it supports only ODPS SQL nodes.
This means that when an extension point event is triggered for an ODPS SQL node, the process is blocked. The built-in extension validates the logic and returns a result. If an event is triggered for a non-ODPS SQL node, the process is also blocked, but the built-in extension does not perform a validation and immediately returns a success result.
-
The pre-publish table event and the pre-submit table event are extension point events that are triggered only for MaxCompute tables.
-
For composite nodes that contain inner nodes, such as do-while nodes and for-each nodes, all inner nodes must pass the check before the next operation can proceed.
Overview of capabilities
You can register a local service or program as a DataWorks extension to receive messages for specific extension point events in the Data Studio module. This lets you implement custom logic to handle these events and return the results to the platform using a callback to the UpdateIDEEventResult API. This method enables process control in DataWorks. The supported extension points are:
-
File operations: Run, commit, publish, and delete files.
-
Table operations: Submit and publish tables.
NoteExtension events for table operations in Data Studio can be triggered only for MaxCompute tables.
Supported extension point events
In Data Studio, you can use extensions to validate and respond to the following extension point events.
DataStudio - Run File In the DataStudio code editor, click the Run button to trigger a pre-check event for the extension. A Checking overlay appears with the message: "The operation will be automatically executed after the check is passed. You can view the results in [Operation Check]." In the Operation Check panel on the left, you can view all check records (including types such as run, commit file, and delete). Click a record to open its details dialog box, where you can view the check type, status, and details for each extension.
DataStudio - Submit File: When you submit a file in DataStudio, the system triggers a file pre-commit event check. Click the Submit button on the toolbar to trigger an extension check. The editor displays a "Checking" prompt, and the operation is automatically executed after the check passes. You can view the status of each check item in the Operation Check panel on the left. The list displays "Trigger file pre-commit event check".
DataStudio - Publishing a file After you click the Publish button in the code editor to submit a file, the system triggers an extension check. The Create Deployment Package interface appears, where the status of the corresponding node in the file list is displayed as Checking and validating. You can click the node status to open the Operation Check dialog box to view the check type, status, and validation details.
DataStudio - Delete file In the Data Studio file tree, right-click the target node and select Delete. This action triggers a pre-check event from the extension program. A blue notification appears at the bottom of the page that says, "This operation has triggered a check. The operation takes effect automatically after the check passes. Please view the check result in 'Operation Check'." Go to the Operation Check page to view a list of check records. The list includes the Name/Operation Time, Type, and Status columns. Click a specific record to view the details of the operation check. The details include the check type, such as "Pre-delete combination test", and the current status, such as "Checking". The page also provides View Details and View Document links.
DataStudio: Submit table When you submit a table (such as xc_table_prod) to a development or production environment, the system automatically triggers a pre-check from an extension program. A Checking dialog box appears with the message: "The operation runs automatically after the check passes. Please view the results in Operation Check." In the Operation Check sidebar on the left, you can filter and view all check records by type and status. Click a specific record to open the Operation Check details dialog box. This dialog box displays the list of extension program validations triggered by the current operation (such as the "Pre-submission check for table - Test program" check type) and their validation statuses. It supports the View Details and Re-check operations.
DataStudio - Publish Table On the table configuration page, click the Submit to Production Environment tab to trigger an extension check. The system then displays a prompt: "Checking - The operation will be automatically executed after the check passes. Please view the results in 'Operation Check'." Go to the Operation Check page to view a list of check records. The list contains the table name, submission time, check type, and status. Click a record to view its details. The details include the check type (such as Pre-publish Check for Table) and the current status. You can also click View Details and View Documentation. This operation triggers the validation of enabled extensions for the pre-publish event type for tables in the workspace.
References
-
For more information about using extensions, see Use extensions.
-
Data Studio supports additional extension point events. For more information, see List of supported extension point events.
-
For more information about the message entity format for file change events, see File change events (commit, publish, run, delete, and code review).
-
For more information about the message entity format for table change events, see Table change events (submit table to development environment and publish table to production environment).