= Declare business variables
:description: :experimental:

:experimental:

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.

[NOTE]
====

If you want to know more about operations, see this xref:operations.adoc[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.
+
image:images/getting-started-tutorial/declare-business-variable/select-process-pool.gif[Select the pool]

. At the bottom of the Bonita Studio screen, go to menu:Data[Pool variables]
. 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*
+
image:images/getting-started-tutorial/declare-business-variable/declare-business-variable.gif[Declare business variable]

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 menu:General[General] 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*

[NOTE]
====
You can also enter the Groovy script directly: `claim.satisfactionLevel < 3`
====

image:images/getting-started-tutorial/declare-business-variable/define-condition.gif[Define transition condition using business variable value]

[NOTE]
====
The script configured for the transition condition will return `true` if the satisfaction level given is lower than 3, as the transition to _Deal with unsatisfied customer_ will be activated.
====

[NOTE]
====
The business variable has never been initialized so it will remain empty. There are several options available to initialize a business variable:

* business variable default value
* xref:operations.adoc[operation] on a task
* xref:initialize-a-variable-from-a-database-without-scripting-or-java-code.adoc[connector output]

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 xref:declare-contracts.adoc[next chapter] and start collecting user inputs from forms. They will go through xref:declare-contracts.adoc[contracts] and can be stored in business variables.
