Versions Compared

Key

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

...

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

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

Explanation:

  • The getAllArgumentsAsNameValueMap() method provides a map of all arguments. The map allows to read a single argument from the argument name.
  • Argument values are returned in one of the supported data types including string, number and Boolean.
  • Consider that argument names are case-sensitive.

...

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

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

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

Explanation:

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

...