Business process designer > BPMN processes > Process designer tabs / Context tab

Context tab

The process context is all the data that is created, modified, and saved during the execution of a business process. For instance, it can include information about participants, files, executors’ comments, contractors, forms, etc. This data is stored in variables. Their values are defined either by the users during the process, or automatically by the system.

Process context contains custom variables and system variables.

Custom variables

To view the list of all custom context variables, in Administration > Business Processes, click on the process name and go to the Context tab.

process_context-1

  • Display Name. Name of the variable that is used on the task form, in the start event, etc.
  • Property Name. Name of the variable that is used when working with APIs, forms, etc.
  • Type. Type of data that the variable stores.
  • Search and Sort. If you check this box, the value of the variable can be used as a search parameter.
  • Full-text search. If you check this box, the value of the variable will be used in full-text search.

Note that if the process is created within an app, a variable linked with this app is automatically added to the process.

How to add a custom variable

There are several ways to create a new variable:

  1. On the Context tab, in the upper right corner, click on the +Add button.

bpc2

  1. In the settings of the Task or the Start event, open the Form tab. In the upper left corner, click the +Add button. Variables added in this way will also be available on the Context tab.

bpc3

  1. In addition, context variables can be created in the settings of some graphical elements. For example, in swimlanes and statuses, where some parameters are defined by a variable.

After you click the +Add button, a window will open. Fill out the fields to create a variable:

bpc4

  • Display name*. Name of the variable that will be displayed on the forms of tasks, events, etc.
  • Property name*. Name of the variable that will be used when working with APIs, scripts, etc.
  • Tip. Here you can specify additional information about the variable. For example, how its value is set.
  • Type*. Type of data that the variable stores. For each data type, you can specify additional parameters, so the set of fields in the lower part of the window may vary.

начало внимание

Once a variable is saved, you will not be able to change its type.

конец внимание

To edit a variable, double-click on its name on the Context tab.

System variables

Each business process contains system context variables added by default. They are not shown in the list of variables on the Context tab, but they can be used during process modeling, for instance, in scripts, in templates, and on task forms.

process_context-5

Initiator variable

The Initiator variable (code: __createdBy) is stored in the dynamic swimlane added to the process diagram by default. It stores the user who started the process. The variable can be used further, for example, on task forms and in scripts.

Name variable

The Name variable (code: __name) stores the name of the business process instance (for example, to specify the subject in a Notification). Moreover, data from this property will be displayed in Administration > Process Monitor.

process_context-6

Started on variable

The Started on variable (code: __createdAt) stores the date the process instance was created. This property can only be used in scripts. Moreover, the property’s data is displayed in Administration > Process Monitor.

Comment variable

The Comment variable (code: __comment) can be used in scripts and business process elements (for example, on forms that need to be filled out in order to proceed down a certain connector). Only one value can be written to this variable. It is not saved in the process context, and it won’t be displayed on the forms of other tasks. The value of the variable can be shown in the activity stream of the process or object associated with the process using the Notification activity.

Here’s an example of how you can use this property in the “Contract approval” business process.

process_context-7

When the initiator of the process prepares the contact, the manager gets the task to review it. From this point, the process can go along one of the paths: Approve or Needs editing.

Let’s open the connectors’ settings. In the Confirmation field, let’s select the Form option and click the Configure form button. We’ll add the Comment system variable to the form and mark it a required field. Now the manager will have to enter a comment to complete the task.

To pass the manager’s comment to the contract’s activity stream, we’ve added the Notification activity to the process diagram. In the Message text field, we’ll add the Comment variable by clicking on {+} in the right corner and selecting it from the list.

In the Associated object field, let’s select Context variable and choose the “Contracts” app. Now the comment that the manager leaves when finishing the task will be saved in the app item’s activity stream. You will be able to see the comment’s text on the sidebar of the contract’s page whenever you want.

process_context-8

The manager can send the contract for correction several times. Each time, the manager will leave a comment, and the variable will be assigned a new value. This value will be displayed in the notification sent to the initiator and in the contract’s activity stream.

Note that if several employees review a contract, the Comment variable will store the most recent comment. To pass comments written by each approver and display them on task forms, create custom properties of the String (Text) type for each of these employees.

Found a typo? Highlight the text, press ctrl + enter and notify us