Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Declaring Variables

The JS7 - Workflow Editor offers to declare variable allows variables to be declared. Clicking into in the workflow editor panel with panel will display the workflow properties that offer to add variableswhere variables can be added:

Explanations:

  • Order variables are declared by specifying a name and data type.
    • If no default value is not added then the order variable is mandatory, i.e. any all orders have to specify a value for the variable.
    • If a default value is added then the order variable is optional, i.e. orders can specify a value and otherwise the default value is will be used.
    • If a default value is added then the final data type can be added that prevents the variable from being modified later on in the workflow.
    • Default values accept constant values and JS7 - Expressions for Variables.
  • Any number of order variables can be declared.

...

Using Order Variables in Shell Jobs

Shell jobs can use environment variables to access order variables by use of environment variables.

Mapping Order Variables to Environment Variables

...

  • The property editor suggests to use using the names of order variables for environment variables.
    • Environment variable names are automatically converted to uppercase letters.
  • Similarly the values of order variables are suggested with a $ prefixing the name of the variable.
    • Consider Note that only names of existing order variables can be used as the value for an environment variable.
  • In addition to order variables any expressions , expressions can be used , for order variables - for details see:

...

Environment variables can be used with job scripts according to the syntax of the respective operating system that the job is executed for:

...

Node Arguments are typically used in a situation when the same job occurs more than once in a workflow. The basic assumption is that the job will make use of the same variables that should carry different values per at each node in which the job is used.

  • Consider Note that node arguments cannot be modified dynamically - which is why they are called arguments, not variables. 
  • Node arguments are available for mapping to environment variables in a similar manner to order variables.

...

  • The job script can append a pair of variable name and -value for a variable pair to a temporary file indicated with the $JS7_RETURN_VALUES environment variable.
  • The JS7 Agent will pick up the temporary file after execution of the shell job and from use the file's entries will to create new order variables for subsequent instructions and jobs in the workflow.
  • This mechanism is used to create new order variables from Shell Jobs. It cannot be used to modify existing order variables. Shell jobs always should create new order variables to pass values to subsequent instructions and jobs.

...

Explanation:

  • Both examples assign some a value to an environment variable SOME_VARIABLE that is local to the job.
  • The name/value pair myVar=.... is appended to the temporary file indicated by the JS7_RETURN_VALUES environment variable.
    • This assignment makes use of the value stored with the SOME_VARIABLE environment variable.
    • This assignment could also use a constant value too instead of using SOME_VARIABLE.

...

  • $js7WorkflowPath
    • The unique name of a workflow. Consider Note that in a workflow the name does not include the folder location of a workflow.
  • $js7WorkflowPosition
    • The position of an order in the workflow.
  • $js7Label
    • The label of the current instruction for which an order is executed.
  • $js7OrderId
    • The order identifier.
  • $js7ControllerId
    • The Controller's identifier as specified during installation.

...