All Products
Search
Document Center

DataWorks:Use workspace-level parameters

Last Updated:Nov 13, 2024

In addition to scheduling parameters at the task level, DataWorks provides workspace-level parameters. If you want to set multiple parameters of a workspace to the same value, you can use workspace-level parameters. You can mask the configurations of workspace-level parameters to protect your sensitive data. In a workspace in standard mode, you can specify different values for a workspace-level parameter in the production and development environments.

Background information

In DataWorks, a task is scheduled to run based on the scheduling parameters that you configure for the task. The values of the scheduling parameters are automatically replaced based on the value assignment rule for the scheduling parameters each time the task is run. For more information, see Supported formats of scheduling parameters.

Prerequisites

  • A workspace is created. Workspace-level parameters must be used in a specific workspace. For information about how to create a workspace, see Create and manage workspaces.

  • A user is added to the workspace as a member and is assigned the Workspace Administrator role. Only users that are assigned the Workspace Administrator role can create workspace-level parameters. For information about how to add a user to a workspace as a member and assign a role to the user, see Add a RAM user to a workspace as a member and assign roles to the member.

  • DataWorks Professional Edition or a more advanced edition is activated. You can use workspace-level parameters only in DataWorks Professional Edition or a more advanced edition. For more information, see Differences among DataWorks editions.

Limits

  • Only exclusive resource groups for scheduling support this feature. The shared resource group for scheduling does not support this feature.

  • If the exclusive resource group for scheduling that you want to use is created after January 1, 2024, you can use workspace-level parameters as expected. If the exclusive resource group for scheduling that you want to use is created before January 1, 2024, you must contact technical support to upgrade the configurations of the resource group before you can use workspace-level parameters.

Create workspace-level parameters

  1. Go to the entry point for creating workspace-level parameters.

    1. Go to the Operation Center page.

      Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose Data Development and Governance > Operation Center. On the page that appears, select the desired workspace from the drop-down list and click Go to Operation Center.

    2. In the left-side navigation pane, click Tenant Schedule Setting. On the page that appears, click the Workspace-level Parameters tab.

  2. Create workspace-level parameters.

    1. On the Workspace-level Parameters tab, click Create Workspace-level Parameter. Then, configure the parameters based on your business requirements.

      Note

      If you want to create multiple workspace-level parameters at the same time, you can click Batch Create Workspace-level Parameters.

      Parameter

      Description

      Parameter Name

      The name of the workspace-level parameter. By default, the name is prefixed with workspace.. The parameter name must be unique.

      Owner

      Specifies the owner of the workspace-level parameter.

      Note
      • The workspace administrator can specify any member in the workspace as the owner of workspace-level parameters.

      • Only the workspace administrator can modify or delete all workspace-level parameters.

      If you want to manage workspace-level parameters as a RAM user, you can add the RAM user to the workspace as a member and assign the required role to the RAM user. For more information, see Add a RAM user to a workspace as a member and assign roles to the member.

      Workspace

      Specifies the workspace in which the workspace-level parameter can be used. After you configure this parameter, all tasks in the specified workspace can use the workspace-level parameter.

      Note
      • Only workspaces whose workspace administrator is the current logon account are displayed in the drop-down list.

      • Each workspace-level parameter can be used in only one workspace.

      Parameter Type, Parameter Value (Development Environment), and Parameter Value (Production Environment)

      Specify the actual values of the workspace-level parameter that are used in subsequent tasks. Valid values:

      • Constant (Plaintext): The workspace-level parameter is assigned a constant that is visible to all users. Example: 123.

      • Constant (Ciphertext): By default, the workspace-level parameter is assigned a constant that is masked as ******. If your data is sensitive, you can set the Parameter Type parameter to Constant (Ciphertext). For example, if you enter 123, the value is displayed as ******.

      • Variable: The value of the workspace-level parameter is dynamically replaced with a specific value based on the variable that you configured.

        For example, you can specify the value in the $[yyyy-mm-dd] format, which indicates the time when a task is scheduled to run. You can also specify the value in the ${yyyy-mm-dd} format, which indicates the data timestamp of the task. For more information about the supported formats, see Supported formats of scheduling parameters.

      Note
      • The parameter value can contain specific special characters. You can view the supported special characters in the DataWorks console.

      • You cannot reference other workspace-level parameters when you assign a value to the current workspace-level parameter.

      If you use a workspace in standard mode, you can specify different values for the same workspace-level parameter in the development and production environments based on your business requirements. For more information about the modes of workspaces, see Differences between workspaces in basic mode and workspaces in standard mode.

    2. Click OK.

Use workspace-level parameters

After you create a workspace-level parameter, go to the workspace to which the workspace-level parameter is applied and use the workspace-level parameter on the configuration tab of a specific node. You can use workspace-level parameters in the same manner that you use scheduling parameters.

  1. Define a variable in the code of the desired node.

  2. Go to the configuration tab of the node. In the right-side navigation pane, click Properties. In the Scheduling Parameter section, assign a workspace-level parameter to the variable.

After you configure the workspace-level parameter, you can preview whether the parameter value meets your expectations and adjust the value based on your business requirements. For information about how to use scheduling parameters, see Configure and use scheduling parameters.

Note
  • You can create nodes based on your business requirements. For more information, see DataWorks nodes.

  • After you configure a workspace-level parameter for a node, you must save and submit the parameter in the top toolbar of the configuration tab of the node.

  • If the exclusive resource group for scheduling that you want to use is created after January 1, 2024, you can use workspace-level parameters as expected. If the exclusive resource group for scheduling that you want to use is created before January 1, 2024, you must contact technical support to upgrade the configurations of the resource group before you can use workspace-level parameters.

image.png

Manage workspace-level parameters

On the Workspace-level Parameters tab, you can perform the following operations on workspace-level parameters.

Note
  • Only workspace members that are assigned the Workspace Administrator role can modify or delete workspace-level parameters.

  • Only workspace members that are assigned the Development, O&M, or Workspace Administrator role can view the tasks that reference a specific workspace-level parameter and the versions of the parameter.

For information about how to add a RAM user to a workspace as a member and assign roles to the member, see Add a RAM user to a workspace as a member and assign roles to the member.

  • View workspace-level parameters: You can view the details of a workspace-level parameter, the workspace to which a workspace-level parameter is applied, and the tasks that reference a workspace-level parameter. You can click the ID of a task to go to the configuration tab of the corresponding node and perform development operations.

  • Modify workspace-level parameters:

    • You can modify only the owner, value, and description of a workspace-level parameter. Each time you modify a workspace-level parameter, a new version is generated.

    • If you modify a workspace-level parameter that is referenced by other tasks, the value of the workspace-level parameter on the tasks is affected. Exercise caution when you modify a workspace-level parameter.

    • The modification takes effect within 10 minutes.

  • Compare parameter versions and roll back parameters: You can view the historical versions of a workspace-level parameter, compare the versions of the workspace-level parameter, and roll back the workspace-level parameter to a specific version.

  • Delete workspace-level parameters:

    • If a workspace-level parameter is referenced by other tasks, you cannot delete the parameter.

    • If you delete a workspace-level parameter, the tasks that reference the parameter fail to run. Exercise caution when you delete a workspace-level parameter.

    • The delete operation takes effect immediately. After you delete a workspace-level parameter, you cannot find the parameter on the Workspace-level Parameters tab. Within 10 minutes after the workspace-level parameter is deleted, the tasks that reference the workspace-level parameter may still be able to obtain the value of the parameter.