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) {
        // 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". The example will return arguments from all sources.
  • Argument values are returned in one of the supported data types including string, number and Boolean.

...

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

	processOrder(js7Step) {
      	// access argument by name
        js7Step.getLogger().info('[getJobResourcesArgumentsAsNameDetailValueMap] by name:');
      	var colorBlue = js7Step.getJobResourcesArgumentsAsNameDetailValueMap()['color_blue'];
		js7Step.getLogger().info("argument color_blue=" + colorBlue.getValue());
     }
}

Reading the list of Job Resource Arguments

...