Create a script operator
In the Operator Center, you can create offline, , and script operators. These operators can run as nodes in the model canvas. This topic describes how to create a script operator.
Create an offline script operator
Log on to the Data Resource Platform console.
In the upper-left corner of the page, click the
icon and select Explore.In the top menu bar, click the
icon, select the target group, and click Operator Center.In the navigation pane on the left, choose Operator Management > Script Operator.
Add an operator folder.
In the folder list, select a folder, click the
icon, enter a folder name in the input box, and press Enter.A message appears indicating that the folder was added. You can view the new folder in the folder list.
System directory: If you place a resource in this folder, users with tenant administrator permissions can use the resource. Other users can only view the resource.
Current group directory: If you place a resource in this folder, all members of the group can use the resource.
Personal directory: If you place a resource in this folder, only the current user can use the resource.
(Optional) In the folder list, select a folder that you manually added, click the
icon, and add a child folder.
NoteThe system provides the following three isolated folders:
Create an offline script operator.
In the upper-right corner of the Script Operator page, click Create Operator.
In the Create Operator panel that appears on the right, configure basic information such as the operator name, script type, and operator folder.
NoteThe business model editor supports the following offline script types: SQL. This topic uses the SQL type as an example.
After you complete the configuration, click OK to go to the script editor page.
In the editor, enter the code.
In the Configure Input Information area, click Add Input to configure the input information for the operator.
In the Configure Output Information area, click Settings to define the output fields for the operator.
In the Configure Variable Information area, click Add Variable to configure the variable information for the operator.
In the upper-right corner of the script editor, click Save. In the dialog box that appears, click OK.
A message appears indicating that the script operator was saved. You can view the new script operator in the script operator list.
Related operations
Operation |
Description |
Edit a script operator |
In the list of script operators, click Edit in the Operation column for the target script operator. You can then edit the script operator information on the script editor page. |
Copy a script operator |
In the list of script operators, click Copy in the Operation column for the target script operator. In the Copy Operator panel that appears, reset the operator name and folder, and then click OK to copy the script operator. |
Delete a script operator |
In the list of script operators, click Delete in the Operation column for the target script operator. In the dialog box that appears, click OK.
Important
After an operator is deleted, it cannot be used as a node in the model canvas and cannot be recovered. Models that are associated with the operator are also affected. Delete operators with caution. |
Set an operator folder |
In the list of script operators, select the target operator. In the lower-left corner of the page, choose Batch Operations > Batch Modify Directory. In the Batch Modify Directory panel that appears, select a folder and click OK. |
Export a script operator |
You can export script operators from the current group to your local computer. This lets you reuse them in other groups and quickly initialize data governance.
|
Import a script operator |
You can import exported script operators into other groups for reuse. In the lower-left corner of the Script Operator page, choose Batch Operations > Batch Import. In the Batch Import panel, set the folder, upload the script operator file, and click Next. |