Page History
...
- The
getAllArgumentsAsNameValueMap()
method provides a map of all arguments. The map allows to read a single argument from specifying 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 | ||||||
---|---|---|---|---|---|---|
| ||||||
class JS7Job extends js7.Job { processOrder(js7Step) { // access argument by name js7Step.getLogger().info('[getOrderArgumentsAsNameValueMap] by name:'); var colorBlue = js7Step.getOrderArgumentsAsNameValueMap()['color_blue']; js7Step.getLogger().info('argument color_blue=' + colorBlue); } } |
Reading the list of Order Variables
To iterate the list of Order Variables the following proceeding applies:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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]); } } } |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
class JS7Job extends js7.Job { processOrder(js7Step) { // accessget argumentlist byof name Job Resource arguments var args = js7Step.getJobResourcesArgumentsAsNameDetailValueMap(); js7Step.getLogger().info('[getJobResourcesArgumentsAsNameDetailValueMap] by name:'); :'); js7Step.getLogger().info('arguments: ' + args); for (var colorBluearg = js7Step.getJobResourcesArgumentsAsNameDetailValueMap()['color_blue'];in args) { js7Step.getLogger().info('argument color_blue: ' + arg + '=' + colorBlueargs[arg].getValue()); } } } |
Further Resources
...
Overview
Content Tools