Versions Compared

Key

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

...

Access to arguments by a job includes to read arguments from a specific source or to read all arguments.

Accessing Arguments

Download sample workflow implementing access to all arguments (upload .json): pdJavaScriptAllArguments.workflow.json

Reading specific Arguments

The straightforward way to read the value for a specific argument works like this:

Code Block
languagejs
titleExample for implementation of js7Job with JavaScript
linenumberstrue
class JS7Job extends js7.Job {

	processOrder(js7Step) {
        var workflowPath = js7Step.getAllArgumentsAsNameValueMap['js7Workflow.path']);
        js7Step.getLogger().info('argument: ' + workflowPath);
    }
}

...

  • Consider the literal meaning of "all arguments". 
  • Argument values are returned in one of the supported data types including string, number and Boolean.

...

Accessing Arguments from Order Variables

Order Variables are carried by an order and are a subset of the Declared Variables specified by the workflow.

  • Order Variables have to be specified for any Declared Variables that are not assigned a default value.
  • Order Variables can specify Declared Variables holding default values. The Order Variable over-rules the default value.


Accessing Declared Arguments

...

  • At workflow level any number of variables can be specified.
  • Specification includes the data type, most frequently using string, number, Boolean.
  • A default value can be provided that allows an order to optionally specify the variable with some value.

Download sample workflow implementing access to Declared Arguments (upload .json): pdJavaScriptDeclaredArguments.workflow.json

Reading specific Declared Arguments

...