link to process variable


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

3 answers



I upload a process 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 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.


Submitted by etchegaray on Fri, 07/31/2015 - 15:57

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.

Submitted by antoine.mottier on Fri, 07/31/2015 - 18:30

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.

Submitted by etchegaray on Fri, 07/31/2015 - 21:21

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.