The process context is all the data that is created, changed and stored during the execution of a particular process. For example, information about participants, files, executors comments, contractors, forms, etc. This data is stored in variables, whose values are defined either by the users during the process, or automatically by the system.
To view a list of all context variables, in the Administration > Business Processes section, click on the process name, and then go to the Context tab.
- Display name – the name of the variable that is used on the form of the task, the start event, etc.
- Property name – the name of the variable that is used when working with the API, forms, etc.
- Type – the type of data that the variable stores.
- Serach and sort – if you select this option, the value of the variable can be used as a search parameter of the process.
- Full-text search – if you select this option, the variable value will be used in the full-text search.
There are several ways to create a new variable:
- On the Context tab, in the upper right corner, click on the + Add button
- In the settings of the Task or the Start event. Click the Form tab and in the upper left corner click on the + Add button. Variables added in this way will also be displayed on the Context tab.
- In addition, context variables can be created in the settings of some graphical elements. For example, in swimlanes or statuses, where the variable defines the parameters of these elements.
After you click on the + Add button, a pop-up will open. Fill out the fields to create a variable:
- Display name – the name of the variable that will be displayed on the forms of tasks, events, etc.
- Property name – the 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 – the 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. Read more about data types in this article.
Once the process is published, you will not be able to change the type of the context variable.
To edit the variable, double click on its name in the Context tab.
Context of a process associated with an app
If a business process is associated with an app, its context looks differently. On the Context tab, you can switch between the process variables or app properties.
The business process context provides access to all the process variables. For example, to the variables that are used to determine users in swimlanes. Here you will also find a variable that stores the Contracts app itself. It shouldn’t be deleted, otherwise, you won’t be able to work with the app context.
If you switch to the Contract context, you’ll get access to all the app properties.
Use them in the process on the task forms, set up document templates, notifications, etc. Here, on the Context tab, you can edit, delete and create new app properties. Suppose, you need a “delivery cost” property which is not added to the app context. If you create it on the Context tab, you will be able to select it when configuring task forms, notifications, etc.
Remember that all changes that you make to the app context will be saved not only to the process but also to the app. If you delete, for example, the property “contract validity period”, then it will be removed from the contract forms. It will also be removed from other processes associated with the Contracts app.
The property added in this way will be automatically added to the view/edit forms of the app item.
Context in the main process
When you create a new app from scratch, you will be prompted to create the main app process.
In this case, the app does not contain properties yet, and thus, if you switch to the app context, you will see that it is empty.
Read more about the context of the main app process in this article.