add/set workflow variable()
This function changes the value of the existing workflow variable b of workflow job a.
The workflow variable b can also be newly created.
The return value of the function is true if the workflow job was found and the set action was successful, otherwise false.
Parameters
Parameter |
Description |
a |
Name (see VAR_SYS_WF_DISPLAYNAME) or ID (see VAR_SYS_WF_ID) of the workflow job. |
b |
(optional) Name of the workflow variable to be filled or created. Note: You have to use parameter type Value. If the parameter is left empty, all variables with the same name in the workflow job are synchronised. Parameter c must then also remain empty. Note : This also sets the workflow variable VAR_AUTOSERIALIZE_DATA . |
c |
(optional) The value to be set for workflow variable b. |
d |
(optional) If true, a new workflow variable is created. If it already exists, it will be overwritten. Default: false. |
Application in transitions, profiles and sub workflows
Transition (conditions)
This function cannot be used in the conditions of a transition of a workflow to change its variables. However, you can use function save variable a(b) type-safe there instead. You can also start a profile in the conditions of a transition with the functions call profile() and trigger profile() and then use the function in the profile. But please note that the workflow variable only takes on the value after the end of the function chain!
Transition (action)
If you call a profile as an action in a transition, the function can also be used in the called profile. The workflow variable then adopts the value after the action and is available in subsequent actions.
Sub workflows
In sub workflows, however, this function can be used to change the variables of the parent workflow, but then you have to store its ID (VAR_SYS_WF_ID) in another parent workflow variable (which is then passed to the sub workflow if it is defined there), because it is not directly passed to the sub workflow.