Pool variables versus step variables
Bonita gives us the options to create two kinds of variables with regard to scope: pool variables and step variables. Pool variables are akin to global variables in any programming language and step variables correspond to the local variables of a function.
The type of variables, integers or text, are the same for both pool and step variables. Only their scope differs. For example, there might be an integer variable such as an ID number that might be required in all the steps of the workflow. We would have to make this a pool variable so that it can be accessed by all steps. On the other hand, one of the steps might have a field, called name
, which might be required only at that step. Hence, it makes sense to make name a step variable that is accessible only by that step.
To define a pool variable, select the pool and click on the Data tab in the details panel. We can add the variables by clicking on the Add... button. Similarly, to define a step variable, click on any step and select the Data tab in the details panel. All the step variables will be listed here and new ones can be added, too.
Now, let us see the types of variables that we can create in Bonita Studio. All these variables can be created by clicking on the Add... button in the Data tab of the details panel.