DataWorks Extensions is a plug-in that you can use with OpenAPI and OpenEvent. You can use an extension to customize the processing logic for user operations in DataWorks and to implement behavior control such as blocking. For example, you can develop an extension for task change control and use the extension to implement custom task deployment control. This topic describes the basic information about extensions.
Limits
Only users of DataWorks Enterprise Edition can use the Extensions module.
The Extensions module is available in the following regions: China (Beijing), China (Hangzhou), China (Shanghai), China (Zhangjiakou), China (Shenzhen), China (Chengdu), US (Silicon Valley), US (Virginia), Germany (Frankfurt), Japan (Tokyo), China (Hong Kong), and Singapore.
Notes
Permission control: Only the Open Platform administrator, tenant administrator, Alibaba Cloud accounts, and RAM users to which the AliyunDataWorksFullAccess policy is attached have read and write permissions on the developer backend. For more information about permission management, see Manage permissions on global-level services and Manage permissions on the DataWorks services and the entities in the DataWorks console by using RAM policies.
Version validity period: 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 result Check Passed is returned.
Limits: If you develop and deploy an extension based on Function Compute, you can add only specific extension point events to the extension.
Features
DataWorks Open Platform provides various extension points. The Extensions module is based on extension points. The Extensions module is a plug-in that works with the OpenAPI and OpenEvent modules to provide features that can meet your business requirements and help you manage the operations you perform in DataWorks based on custom processing logic, such as blocking the operations.
Business scenarios in which extensions can be used for operation management:
Management of table or task naming conventions.
Management of duplicate data synchronization tasks.
Management of fees generated by tasks.
Management of dependencies between tasks.
NoteFor more information about the event types that can be used in various business scenarios, see Development reference: Event lists and event message formats.
Custom process control: When an extension is used to control an operation at an extension point, the operation in DataWorks is suspended until the custom extension returns a result.
For example, you can add an extension that is used to check a function to the basic process of task development and deployment in a workspace in standard mode. After you enable the extension, the task development and deployment process is changed from the Best practices for prohibiting the use of the MAX_PT function (advanced feature).
procedure to the the procedure. For more information, seeDevelopment process
In DataWorks, you can develop and deploy extensions through Self-managed Service or Function Compute to implement custom process control.
Configure the required settings in OpenEvent to push event messages: Select a method to develop and deploy an extension based on the extension point events that you want to receive.
Develop and deploy an extension based on Self-managed Service: This method relies on the message distribution capabilities of EventBridge. Specify the event bus to which DataWorks event messages are sent in the configured event distribution channel. Then, configure the event bus to route the messages to the appropriate type of service.
Develop and deploy an extension by using Function Compute: By default, DataWorks event messages are sent to the Function Compute service that you specify in the extension that you register. You do not need to configure an event bus in OpenEvent.
Develop and deploy an extension: Receive and parse event messages pushed by DataWorks, process the event messages based on custom processing logic, and return the processing result to DataWorks.
Develop and deploy an extension based on a self-managed service: Use the service program to which messages are ultimately routed in the event bus to receive DataWorks messages, make logical judgments on the messages, and call back the processing results by using the specified API.
Develop and deploy an extension based on Function Compute: Implement a specific interface of Function Compute to receive extension requests and return extension processing results.
Register the extension: Define which types of event messages the developed extension will receive and process in DataWorks.
Test the extension: Verify whether the extension works as expected in the test workspace.
Submit and publish the extension: After you confirm that the extension works as expected, submit the extension for review. After the extension passes the review, publish the extension for all workspaces to use.
NoteThe review of an extension is usually completed within
T+3
working days. Please be patient.DataWorks event messages are valid for three days. If the validity period is exceeded, the event messages are considered expired and are not processed by an extension.
Supported extension point events
The following table describes the types and details of extension point events that can be processed by extensions.
When you develop and deploy an extension, you need to use the eventcode that corresponds to a specific extension point. For more information about the event codes of events, see Development reference: Event lists and event message formats.
You can publish extension point events only in workspaces in standard mode.
The blocking effects of extension points can be observed in the following application examples: Trigger event checking during data development and Trigger event checking in Operation Center.
Application scope | DataWorks service | Extension point type | Extension point | API operation for sending processing results |
Workspace level | File Change event
| Pre-event for Node Deletion | You can use the UpdateIDEEventResult operation to call back the event processing results to DataWorks. | |
Pre-event for Node Commit | ||||
Pre-event for Node Deployment | ||||
Pre-event for Code Running | ||||
Table Change event | Pre-event for Table Deployment | |||
Pre-event for Table Commit | ||||
Node Change Event | Pre-event for Di-Job Running | You can use the CallbackExtension operation to call back the event processing results to DataWorks. | ||
Pre-event for Di-Job Batch Running | ||||
Node Change Event | Pre-event for Node Undeploy | You can use the UpdateWorkbenchEventResult operation to call back the event processing results to DataWorks. | ||
Pre-event for Node Frozen | ||||
Pre-event for Node Unfrozen | ||||
Backfill Data Operate Event | Pre-event for Backfill Data | |||
Instance Change Event | Pre-event for Instance Frozen | |||
Pre-event for Instance Unfrozen | ||||
Pre-event for Instance Kill | ||||
Pre-event for Instance Rerun | ||||
Pre-event for Set Instance Success | ||||
Approval Change Event | Pre-event for Approval Order Created | You can use the CallbackExtension operation to call back the event processing results to DataWorks. | ||
DQC Check Event | Pre-event for Data Quality Rules Batch Create | |||
Pre-event for Data Quality Rules Batch Update | ||||
Pre-event for Data Quality Rule Update | ||||
Pre-event for Data Quality Rules Batch Delete | ||||
Pre-event for Data Quality Evaluation Task Create | ||||
Pre-event for Data Quality Evaluation Task Update | ||||
Pre-event for Data Quality Evaluation Task Clone | ||||
Pre-event for Data Quality Evaluation Task Notification Create | ||||
Pre-event for Data Quality Evaluation Task Batch Delete | ||||
Pre-event for Data Quality Evaluation Task Notification Update | ||||
Pre-event for Data Quality Evaluation Task Notification Delete | ||||
Tenant level | Project Change event | Pre-event for Project Delete | ||
Resources Download event | Pre-event for Resources Create | |||
Pre-event for Resources Download | ||||
Pre-event for Resources Upload |
Appendix: Comparison between two types of extension deployment methods
Self-managed service | Function Compute | |
Operation difficulty | The procedure is complex, involves deployment of servers and applications, and is prone to network and O&M issues. | The procedure is simple. You can develop and deploy an extension by using a single function. |
Cost | - | Function Compute fees are incurred. For more information, see Billing overview. |
Supported events | Multiple extension events are supported. For more information about extension events, see Development reference: Event lists and event message formats. | The Function Compute-based deployment method supports only the following pre-events: Pre-event for Resources Create, Pre-event for Resources Download, and Pre-event for Resources Upload. |