I'm trying to write a Bean Shell script that reads the value of a workflow variable. However I see that it is possible to read in a 'process variable' and an 'activity variable'. There only seems to be a getter for process variables by using the following method:


For activity variables the only getter I can find is:


However there are setters for both process and activity variables:




My question is this: What is the difference between a process variable and an activity variable? And if I only want to read 1 activity variable, do I really need to get the entire list first?


  • No labels


  1. Hi Andrew,

    "getProcessVariable()" always return you the current value of the variable. "getActivityVariableList()" return you the activity state value of all the variables. Meaning, you can check back what value was set in a particular activity by using "getActivityVariableList()". 

    Since, we are using "getActivityVariableList()" for monitoring purpose, so no getter method for individual variable is implemented.

    Both setter methods can be used to set a value to variable, but "WorkflowManager.activityVariable()" must be used when only the assignment is running.

    Hope this helps.

    Best regards.

    1. Thanks Owen.

      Just to make sure I understand:

      If I run getActivityVariableList() when an activity is running I will get the current value of all workflow variables, however if I run this after an activity has completed I will get the value of each workflow variable at the point in the process just AFTER the activity completed? In other words, I can trace how each activity changed the value of a workflow variable?

      And about your second comment: You say that WorkflowManager.activityVariable() must be used only when an 'assignment is running'. What does this mean? I thought that an assignment was an instance of a process. Or is an assignment information about the currently active activity in a process?


  2. Hi Andrew,

    Yes, you will get the current value if you run getActivityVariableList() when the activity is still running. Just like the monitoring, you can track what is the last value was set before the activity completion.

    Sorry about using a confusing term "assignment" here, it should be "activity". An assignment is essentially just an instance of "an activity that is being assigned to someone".

    Best regards.