Page History
...
Object | Purpose | ||
---|---|---|---|
js7Step | The built-in object js7Step provides a number of methods | ||
Area | Method | Argument | Return Value |
Argument | getAllArguments() | n/a | [object[]] arguments |
getAllArgumentsAsNameValueMap() | n/a | [map] argumentMap | |
getAllDeclaredArguments() | n/a | [object[]] arguments | |
getDeclaredArgument() | [string] argumentName | [object] argument | |
getDeclaredArgumentValue() | [string] argumentName | [string|int|bool] argumentValue | |
getJobResourcesArgumentsAsNameDetailValueMap() | n/a | [map] arguments | |
getOrderArgumentsAsNameValueMap() | n/a | [map] arguments | |
Job | getAgentIdt() | n/a | [string] agentId |
getJobEnvironment() | n/a | [object] jobEnvironment | |
getJobEnvironment().getJobKey() | n/a | ||
getJobEnvironment().getEncoding() | n/a | [string] encoding | |
getJobEnvironment()..getDeclaredArguments() | n/a | [object[]] jobArguments | |
getJobInstructionLabel() | n/a | [string] label | |
getJobName() | n/a | [string] jobName | |
getControllerId() | n/a | [string] controllerId | |
getOrderId() | n/a | [string] orderId | |
getWorkflowName() | n/a | [string] workflowName | |
getWorkflowPosition() | n/a | [string] position | |
getWorkflowVersionId() | n/a | [string] versionId | |
Outcome | getLastFailedOutcomes() | n/a | [object[]] outcomes |
getLastSucceededOutcomes() | n/a | [object[]] outcomes | |
getOutcome() | n/a |
| |
getOutcome().putVariable() | [string] name, [string|int|bool] value | n/a | |
Utility | getLogger() | [string] message | n/a |
Example: Access Arguments
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
class JS7Job extends js7.Job { processOrder(js7Step) { js7Step.getLogger().info("Hello World" js7Step.getAllArgumentsAsNameValueMap['js7Workflow.path'] ); } } |
Explanations:
- The implementation class with the name
JS7Job
is required. - The
processOrder()
method is required to be implemented by the job.- The method is parameterized by the
js7Step
object. - The
js7Step
object is used with itsgetLogger()
method to create some write output to the job's log. - The
getAllArgumentsAsNameValueMap()
method provides a map of all arguments. The map allows to read a single argument from the argument name.
- The method is parameterized by the
Example: List Arguments
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
class JS7Job extends js7.Job {
processOrder(js7Step) {
var allArgs = js7Step.getAllArguments();
for (var arg in allArgs) {
js7Step.getLogger().info('argument: ' + arg + '=' + allArgs[arg]);
}
}
} |
Class js7.JobArgument
The js7.JobArgument
class can optionally be used to access declared variables.
...
- The example declares a number of arguments with default values in different data types.
- The
getAllDeclaredArguments()
method returns the list of arguments that can be iterated.
...
Overview
Content Tools