Versions Compared

Key

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

...

  • 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.

Download sample workflow implementing access to Order Variables (upload .json): pdJavaScriptOrderVariables.workflow.json

Reading specific Order Variables

...

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

	processOrder(js7Step) {
      	// access argument by name
        var workflowPath = js7Step.getAllArgumentsAsNameValueMap['js7Workflow.path']getLogger().info('[getOrderArgumentsAsNameValueMap] by name:');
       	var colorBlue = js7Step.getOrderArgumentsAsNameValueMap()['color_blue'];
		js7Step.getLogger().info('argument: color_blue=' + workflowPathcolorBlue);
      }
}

Reading the list of Order Variables


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

	processOrder(js7Step) {
        // get list of order variables
		var args = js7Step.getOrderArgumentsAsNameValueMap();
		js7Step.getLogger().info('[getOrderArgumentsAsNameValueMap]:');
		js7Step.getLogger().info('all arguments: ' + args);

        for (var arg in args) {
			js7Step.getLogger().info('argument: ' + arg + '=' + args[arg]);
		}
    }
}

Accessing Declared Arguments

...