# link to process variable

**URL:** <https://community.ofelia.com/t/link-to-process-variable/6205>\
**Category:** Q&A\
**Created:** [29 July 2015 17:40 UTC](https://community.ofelia.com/t/link-to-process-variable/6205 "2015-07-29T17:40:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![etchegaray](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@etchegaray](https://community.ofelia.com/u/etchegaray)\
**Post date:** [29 July 2015 17:40 UTC](https://community.ofelia.com/t/link-to-process-variable/6205/1 "2015-07-29T17:40:24Z")

</div>

To learn how to bind a variable to a form, in the process “Travel request” of the “Getting Started tutorial”, I added a process variable that I called “miVariable”. I created a task to give a value and I want to present that value in the response form “reviewTravelRequest”. What am I doing wrong ?.

[archivo .bos]   
[archivo .bos]: [https://www.dropbox.com/s/jyc5u3gqwyv91tm/Simple%20Travel%20Request-1.0-miVariable.bos?dl=0](https://www.dropbox.com/s/jyc5u3gqwyv91tm/Simple%20Travel%20Request-1.0-miVariable.bos?dl=0)

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [30 July 2015 08:43 UTC](https://community.ofelia.com/t/link-to-process-variable/6205/2 "2015-07-30T08:43:44Z")

</div>

Hi,

I upload [a process](http://community.ofelia.com/project/process-variable-example) that demonstrate how to display and update a process variable. The process make use of the `caseId` variable available in task forms and use the [activityVariable](http://documentation.bonitasoft.com/bpm-api-1#activityvariable) API to get the value. “activityVariable” API actually first look for the variable at step level and if not found escalate at process level.

Note that it is generally a good idea to use business variables over process variables.

---

<div class="post-metadata">

**Author:** ![etchegaray](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@etchegaray](https://community.ofelia.com/u/etchegaray)\
**Post date:** [31 July 2015 13:57 UTC](https://community.ofelia.com/t/link-to-process-variable/6205/3 "2015-07-31T13:57:08Z")

</div>

Antoine,  
Thank you very much. Till today I couldn’t read your answer. Which is the reason to prefer business variables over process variables? I suppose that business variables are better if I want to save the information, but if I only want to use the varible along the process, I think is prefer to use process variable. It’s correct?  
Thanks another time.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [31 July 2015 16:30 UTC](https://community.ofelia.com/t/link-to-process-variable/6205/4 "2015-07-31T16:30:17Z")

</div>

Actually choosing between process and business variable is a matter of life cycle, scope, data access and data storage:

- Process variables:
  - Life cycle: depends on process instance life cycle. When instance is finished, instance is archived and attached process variables are also archived.
  - Scope: data is available easily within the process instance for read and update. It is not intend to be update from other process instance.
  - Data access: you can use API to access the data from forms, other process… but only for read only.
  - Data storage: data is stored in Engine database. Simple data type are stored in column with appropriate type, complex data type are stored serialized (in BLOB).

- Business variables:  
\* Life cycle: independent of process instance. Fully control by developer by process design (default values, operations).  
\* Scope: available to all process definition/instance on a given server (on a given tenant for subscription edition).  
\* Data access: you can access the data using API but also directly query the database.  
\* Data storage: data are stored in a structured way in database. Complex object are breakdown into several columns/tables so data can easily (and efficiently) be read directly from database.

Let say you have a process to manage vacation request. Using a process variable might seems to be a good idea. But if you want to allow users to update a pending vacation request you will probably create a second process that need to work on the existing data. Business variable is a better option for such use case.

---

<div class="post-metadata">

**Author:** ![etchegaray](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@etchegaray](https://community.ofelia.com/u/etchegaray)\
**Post date:** [31 July 2015 19:21 UTC](https://community.ofelia.com/t/link-to-process-variable/6205/5 "2015-07-31T19:21:18Z")

</div>

Thank you. That’s what I thought. Until now I used a MySQL database to store the data I wanted to keep. The possibility of using the BDM will make development easier.
