Create a script operator

Updated at:

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

  1. Log on to the Data Resource Platform console.

  2. In the upper-left corner of the page, click the 导航图标 icon and select Explore.

  3. In the top menu bar, click the 选择工作组 icon, select the target group, and click Operator Center.

  4. In the navigation pane on the left, choose Operator Management > Script Operator.

  5. Add an operator folder.

    1. In the folder list, select a folder, click the add 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.

    2. Note

      The system provides the following three isolated folders:

      • 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.

    3. (Optional) In the folder list, select a folder that you manually added, click the add2 icon, and add a child folder.

  6. Create an offline script operator.

    1. In the upper-right corner of the Script Operator page, click Create Operator.

    2. In the Create Operator panel that appears on the right, configure basic information such as the operator name, script type, and operator folder.

      Note

      The business model editor supports the following offline script types: SQL. This topic uses the SQL type as an example.

    3. After you complete the configuration, click OK to go to the script editor page.

    4. In the editor, enter the code.

    5. In the Configure Input Information area, click Add Input to configure the input information for the operator.

    6. In the Configure Output Information area, click Settings to define the output fields for the operator.

    7. In the Configure Variable Information area, click Add Variable to configure the variable information for the operator.

    8. 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.

  • Batch export: On the Script Operator page, select the script operators that you want to export. In the lower-left corner of the page, choose Batch Operations > Batch Export.

  • Export by folder: On the Script Operator page, select the folder of the script operators that you want to export. In the lower-left corner of the page, choose Batch Operations > Export by Directory.

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.