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 parameters of ancestor nodes. Nodes that need to use parameters can obtain parameters from the parameter nodes. This topic describes how to create a parameter node.

Background information

Parameter nodes are actually virtual nodes. They do not run computing tasks. They are mainly 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. In this case, you can create a parameter node and use it as a descendant node of the sql_1, sql_3, and sql_4 nodes and as an ancestor node of the sql_7 node. Then, add all the parameters required by the sql_7 node to the parameter node. This way, the sql_7 node can directly 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 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. In this case, you can create a parameter node and use it as an ancestor node of the sql_3, sql_4, sql_5, and sql_7 nodes. Then, add all the parameters required by these nodes to 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 your workspace resides, find the workspace, and then click Data Analytics in the Actions column.
  2. On the DataStudio page, move the pointer over the Create icon and choose General > Params Node.
    Alternatively, you find the required workflow, right-click the workflow name, and then choose Create > General > Parameter nodes.
  3. In the Create Node dialog box, set the Node Name and Location parameters.
    Note The node name must be 1 to 128 characters in length and can contain letters, digits, underscores (_), and periods (.).
  4. Click Commit.

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 Basic properties, Configure time properties, Configure the resource group, and Instructions to configure 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 parameters to the parameter nodeThe 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 Configure scheduling parameters.
    • Pass-through variables: Pass-through variables are used to transparently pass the output parameters of ancestor nodes to descendant nodes. If you add a parameter of the pass-through variable type, you can set Valid values to an output parameter of ancestor nodes 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 node code.

  1. Configure the parameters as the input parameters of the descendant nodes.
    Click a descendant node. Then, click Properties in the right-side navigation pane. In the Properties panel, add the parameters required by the descendant node in the Input parameters of this node section of Node context. Node contextThe following parameters in the Input parameters of this node 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 parameter in the code of the descendant node.