Workflow - Scoped

The scoped Workflow API provides methods that can be used in an activity definition script.

There are no constructors for creating an instance of a scoped workflow object. Instead, use the global workflow object available in activity scripts.

Scoped Workflow - debug(String message, Object args)

Adds a debug message to the log.

Table 1. Parameters
Name Type Description
message String The message to add to the log.
args Object Arguments to add to the message.
Table 2. Returns
Type Description
String The message added to the log.

var loggedMessage = workflow.debug("All is well");

Scoped Workflow - error(String message, Object args)

Adds an error message to the log.

Table 3. Parameters
Name Type Description
message String The message to add to the log.
args Object Arguments to add to the message.
Table 4. Returns
Type Description
String The logged message

var loggedMessage = workflow.error("An error has occurred. ");

Scoped Workflow - getVariable(String name)

Returns the specified variable's value.

Table 5. Parameters
Name Type Description
name String The variable name
Table 6. Returns
Type Description
Object The variable's value

var value = workflow.getVariable("task");

Scoped Workflow - info(String message, Object args)

Adds an informational message to the log.

Table 7. Parameters
Name Type Description
message String The message to add to the log.
args Object Arguments to add to the message.
Table 8. Returns
Type Description
String The message that is logged.

var loggedMessage = workflow.info("All is well");

Scoped Workflow - inputs()

Returns the workflow variables.

Table 9. Parameters
Name Type Description
None
Table 10. Returns
Type Description
Object Contains the workflow variables as name value pairs.

var variables = workflow.inputs();

Scoped Workflow - name()

Returns the workflow name.

Table 11. Parameters
Name Type Description
None
Table 12. Returns
Type Description
String The workflow name

var name = workflow.name();

Scoped Workflow - removeVariable(String name)

Removes the specified variable from the workflow.

Table 13. Parameters
Name Type Description
name String The variable name
Table 14. Returns
Type Description
void

var value = workflow.removeVariable("task");

Scoped Workflow - result()

Returns the workflow's result.

Table 15. Parameters
Name Type Description
None
Table 16. Returns
Type Description
String The workflow's result

var value = workflow.removeVariable("task");

Scoped Workflow - scratchpad()

Returns the workflow's scratchpad object..

Table 17. Parameters
Name Type Description
None
Table 18. Returns
Type Description
Object The scratchpad object.

var scratchpad = workflow.scratchpad();

Scoped Workflow - setResult(String result)

Sets the workflow's result.

Table 19. Parameters
Name Type Description
result String The workflow's result
Table 20. Returns
Type Description
void

workflow.setResult("Success");

Scoped Workflow - setVariable(String name, Object value)

Sets the specified variable to the specified value.

Table 21. Parameters
Name Type Description
name String The variable name
value Object The value to be assigned to the variable.
Table 22. Returns
Type Description
void

workflow.setVariable("task", "terrible");

Scoped Workflow - warn(String message, Object args)

Adds a warning message to the log.

Table 23. Parameters
Name Type Description
message String The message to add to the log.
args Object Arguments to add to the message.
Table 24. Returns
Type Description
String The logged message

var loggedMessage = workflow.warn("Check your permissions.");