Declare business variables
For your process to perform operations on business data such as the classic create, read, update and delete operations, you’ll need to include business variables in your process definition.
If you want to know more about operations, see this related documentation section. |
In our process we will deal with a single object: a claim. The claim object will store information about the claim itself (i.e. its description), the provided answer, and a satisfaction level. To declare a business variable:
-
Select the process pool, the rectangle that contains events and tasks.
-
At the bottom of the Bonita Studio screen, go to
-
Click on Add… next to Business variables
-
Type the name of the business variable: claim (lower case)
-
Select the Business Object: Claim
-
Click on Finish
Now that a business variable is declared, use it in the transition condition definition:
-
Select the transition connecting the Satisfaction level gateway with Deal with unsatisfied customer
-
Go into the
tab -
In condition click on the pencil icon
-
Select Script in Expression type in the tabs at the top of the modal window
-
Select the object claims in the left menu "Business variable," and then the attribute satisfactionLevel
-
Click on < in the quick access operators' bar and type 3
-
Click on OK
You can also enter the Groovy script directly: |
The script configured for the transition condition will return |
The business variable has never been initialized so it will remain empty. There are several options available to initialize a business variable:
We will use the first and second options in the upcoming chapters. |
At this stage of the process definition, if you try to execute it, you will not see any difference in the process instantiation form and user task forms. Only the process overview form is different, now listing the business variable but with no associated value.
You are now ready to move to the next chapter and start collecting user inputs from forms. They will go through contracts and can be stored in business variables.