jsetvars
sets values for variables during the runtime of a flow.
Synopsis
jsetvars -i flow_ID -l [scope]Description
Use the jsetvars command to change the value of one or more local variables in a flow at runtime or to change the value of one or more global variables at runtime.
Options
jsetvars -i flow_ID -l [scope]
- [scope]
-
If scope is specified, lists all variables for the flow with the specified ID in the specified scope.
Only one scope can be specified. If more than one scope is specified, only the first scope is used. For example, "jsetvars -i 59 -l F2:F1 F2" only list variables at the F2:F1 scope.
jsetvars -i flow_ID [scope:]var=value [[scope:]var=value ...]
- [scope:]
-
If scope is specified, sets variables for the flow with the specifed ID in the specified scope.
- [var=value [[scope:]var=value ...]
-
Specifies the value to which to set the specified variable. Separate variables with a space.
You cannot combine variables of the same scope together. For example, "jsetvars -i 59 F2:F1:A=1 B=2" sets A=1 at the F2:F1 scope, B=2 at the main flow scope.
jsetvars -i flow_ID -r [scope:]var [[scope:]var ...]
- [scope:]
-
If scope is specified, removes variables for the flow with the specifed ID in the specified scope.
- var [[scope:]var ...]
-
Specifies the names of the variables to remove. Separate variables with a space.
jsetvars -l
List all variables at the global scope.
jsetvars var=value [var=value ...]
Sets variables at the global scope. Separate variables with a space.
jsetvars -r var [var ...]
Removes the specified variables at the global scope. Separate variable names with a space.
- -h
-
Prints the command usage to stderr and exits.
- -V
-
Prints the Process Manager release version to stderr and exits.
Examples
- Set the value of the priority variable to 10 for the flow with the ID
1234:
jsetvars -i 1234 priority=10
- Set the date global variable value to
05-09-2007:
jsetvars date=05-09-2007
If the global variable date already exists, changes the value of the date variable, otherwise, this adds a new global variable called date.
- Delete the time variable from the flow with the ID
1234:
jsetvars -i 1234 -r time
- Set variables at different
scopes:
jsetvars -i 21 mainvar1=123 mainvar2=456 MF:SF1:myvar1=abc \ MF:SF1:myvar2=xyz MF:SF2:svar1=333 MF:SF2:svar2=555
For the flow with the ID 21, this command sets the mainvar1 and mainvar2 variables at the main flow scope level. Also sets the myvar1 and myvar2 variables at the subflow level (specifically, the MF:SF1 subflow), and sets the svar2 variables at the subflow level (specifically, the MF:SF2 subflow). If these variables already exist, this command changes the value of these variables, otherwise, this command adds any new variables that do not already exist.
- Set variables for flow
arrays:
jsetvars -i 212 MF:FA:myarrayvar=abc#{JS_FLOW_INDEX}
For the flow with the ID 212 and assuming MF:FA is a flow array, this command sets the myarrayvar variable to abc1, abc2, abcX, for all the different flow array elements (for example, for 212:MF:FA(1), 212:MF:FA(2), and the remaining flow array elements to 212:MF:FA(X)).
- List all variables for a
flow:
jsetvars -i 21 -l MF:SF1
For the flow with the ID 21, lists all variables at the MF:SF1 subflow scope.
- Remove variables at different
scopes:
jsetvars -i 21 -r mainvar MF:SF1:myvar1 MF:SF1:myvar2 MF:SF2:myvar3
For the flow with the ID 21, removes the mainvar variable at the main flow scope, removes myvar1 and myvar2 variables at the MF:SF1 subflow scope, and removes the myvar3 variable at the MF:SF2 subflow scope.