All Products
Search
Document Center

DataWorks:Create a parameter node

Last Updated:Aug 14, 2023

A parameter node is a special type of virtual node. This type of node is used to manage parameters in workflows and pass parameters between nodes. Parameter nodes can be used to manage constant and variable parameters and transparently pass the parameters of ancestor nodes. Nodes that need to use parameters can obtain parameters from parameter nodes. This topic describes how to create a parameter node.

Background information

Parameter nodes are virtual nodes. They do not run computing tasks. They are used to pass parameters between nodes and manage parameters in workflows.

  • Parameter passing between nodes

    If Node A in a workflow needs to obtain the output parameters of its ancestor nodes, you can create a parameter node and use it as an ancestor node of Node A and a descendant node of the ancestor nodes of Node A. Then, add all the parameters required by Node A to the parameter node. This way, Node A can obtain all the required parameters from the parameter node.

    Parameter passing between nodesIn the preceding figure, the sql_7 node needs to obtain the output parameters of the sql_1, sql_3, and sql_4 nodes. A parameter node is created and used as a descendant node of the sql_1, sql_3, and sql_4 nodes and as an ancestor node of the sql_7 node. All the parameters required by the sql_7 node are added to the parameter node, and the sql_7 node can obtain all the required parameters from the parameter node.

  • Parameter management

    If nodes in a workflow need to use some constant and variable parameters, you can create a parameter node and use it as an ancestor node of these nodes. Then, add all the parameters required by these nodes to the parameter node. This way, these nodes can obtain all the required parameters from the parameter node. The parameter node facilitates centralized management of all the parameters used in the workflow.

    Parameter managementIn the preceding figure, the sql_3, sql_4, sql_5, and sql_7 nodes need to use some parameters. A parameter node is created and used as an ancestor node of the sql_3, sql_4, sql_5, and sql_7 nodes. All the parameters required by these nodes are added to the parameter node, and these nodes can obtain all the required parameters from the parameter node.

Precautions

If a node needs to use parameters in a parameter node, the node must be a direct descendant node of the parameter node.

Create a parameter node

  1. Go to the DataStudio page.

    1. Log on to the DataWorks console.

    2. In the left-side navigation pane, click Workspaces.

    3. In the top navigation bar, select the region where the workspace resides. On the Workspaces page, find the workspace in which you want to create tables, and click Shortcuts > Data Development in the Actions column.

  2. On the DataStudio page, move the pointer over the Create icon and choose Create Node > General > Params Node.

    Alternatively, find the required workflow in the Scheduled Workflow pane, click the workflow name, right-click General, and then choose Create Node > Parameter nodes.

  3. In the Create Node dialog box, configure the Name and Path parameters.
    Note The node name must be 1 to 128 characters in length and can contain letters, digits, underscores (_), and periods (.).
  4. Click Confirm.

Configure scheduling properties for the parameter node

After the parameter node is created, you can configure scheduling properties for the parameter node based on your business requirements.

Scheduling properties include basic properties, time properties, resource properties, and scheduling dependencies. A parameter node does not run data development tasks. It is used only to manage parameters and transparently pass parameters. Therefore, you must pay special attention to the scheduling dependencies configured for a parameter node.

  • If a node needs to use the parameters in a parameter node, the node must be a descendant node of the parameter node.

  • Ancestor nodes whose parameters need to be transparently passed must be the ancestor nodes of the parameter node.

For more information about how to configure scheduling properties for a parameter node, see Configure basic properties, Configure time properties, Configure the resource property, and Configure same-cycle scheduling dependencies.

Add parameters to the parameter node

After you configure scheduling properties for the parameter node, you can add the parameters that you want to manage and transparently pass to the parameter node for subsequent management and use. This section describes the procedure in detail.

  1. On the configuration tab of the parameter node, click Added parameters.

  2. Specify Parameter name, Type, Valid values, and Description, and click Save.

    Add parametersThe valid values of Type include Constant, Variable, and Pass-through variables.

    • Constant: indicates that the value of the parameter is a constant.

    • Variable: indicates that the value of the parameter is a variable. If you want to use a variable such as the system time, set the value of Type to Variable. For more information about variable parameters, see Supported formats of scheduling parameters.

    • Pass-through variables: Pass-through variables are used to transparently pass the output parameters of ancestor nodes of the parameter node to descendant nodes of the parameter node. If you add a parameter of the pass-through variable type, you can set Valid values to an output parameter of an ancestor node of the parameter node.

What to do next: Use the parameters in the parameter node

After you configure the parameter node, the descendant nodes of the parameter node can directly use the parameters in the parameter node. This facilitates centralized management of parameters and improves the task development efficiency of descendant nodes.

Before the descendant nodes of the parameter node can use the parameters in the parameter node, you must configure the parameters as the input parameters of the descendant nodes. This way, these parameters can be directly used in the code of the descendant nodes.

  1. Configure the parameters as the input parameters of the descendant nodes.

    On the configuration tab of a descendant node, click Properties in the right-side navigation pane. On the Properties tab, add the parameters required by the descendant node in the Input Parameters section of Parameters. Node contextThe following parameters in the Input Parameters section must be specified:

    • Parameter Name: the name of the parameter that the descendant node needs to use. You can view the parameter name in the parameter node.

    • Value Source: the source of the parameter that the descendant node needs to use.

      If the parameter information is not completely displayed, you can move the pointer over it to view the complete information. All the parameters that are added to the parameter node are displayed in the Output name of the parameter node:Parameter name format. You can select the source name that is ended with the name of the required parameter.

  2. Use the parameters in the code of the descendant node.