|
1 | | -import { Callout } from "nextra/components"; |
| 1 | +import { Callout } from 'nextra/components'; |
2 | 2 |
|
3 | | -<Callout type="info"> |
4 | | - Process variables and objects are **not** yet serialized in the BPMN files of |
5 | | - PROCEED. There is no `itemDefinition`, `dataObject` or `ioSpecification` |
6 | | - considered during execution of the process. |
| 3 | +# Process Data |
| 4 | + |
| 5 | +Process data can be stored in _Variables_. Variables are currently created on the process level within the _Automation_ of the Property panel or directly from within the UserTask Editor. |
| 6 | +The specification of a Process Variable is serialized into BPMN. |
| 7 | + |
| 8 | +<Callout type='info'> |
| 9 | + The serialization of Process Variables in PROCEED is not yet BPMN conform. There is no `itemDefinition`, `dataObject` |
| 10 | + or `ioSpecification` created at design time and this elements are also not considered during execution of the process |
| 11 | + at runtime. |
7 | 12 | </Callout> |
8 | 13 |
|
9 | | -## Behavior of Process Data |
| 14 | +Variables are serializes as follows: |
| 15 | + |
| 16 | +```xml |
| 17 | +... |
| 18 | +<process id="_09abb321-f819-480a-9827-66264d17b4df" name="PROCEED Main Process" processType="Private" isExecutable="true"> |
| 19 | + |
| 20 | + <extensionElements> |
| 21 | + <proceed:variables> |
| 22 | + <!-- |
| 23 | + name: required, unique |
| 24 | + dataType: required, one of: string, number, boolean, object, array, null |
| 25 | + description: optional, free text |
| 26 | + requiredAtInstanceStartup: optional, boolean, default false |
| 27 | + defaultValue: optional, set at design time |
| 28 | + enum: optional, array of strings seperated by semicolon, the value must be one of these |
| 29 | + const: optional, boolean, default false, non-changeable value after set for the first time |
| 30 | +
|
| 31 | + dataType similar to JSON Schema: https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#section-6.1.1 |
| 32 | + - string: "Text" -> optional: textFormat="email|url" (default: not present, means: no string contraints) |
| 33 | + - number: "Number" |
| 34 | + - boolean: "On/Off" |
| 35 | + - object: "Combined Structure" -> no defaultValue and no enum in UI yet |
| 36 | + - array: "List" -> no defaultValue and no enum in UI yet |
| 37 | + --> |
| 38 | + |
| 39 | + <proceed:variable name="Maschinen Typ" dataType="string" textFormat="url" description="Gibt den Typ einer Maschine an" requiredAtInstanceStartup="true" defaultValue="https://machine-type.de/3d-printer" enum="https://machine-type.de/3d-printer;https://machine-type.de/cnc;https://machine-type.de/grinder" const="false" /> |
| 40 | + |
| 41 | + |
| 42 | + </proceed:variables> |
| 43 | + </extensionElements> |
| 44 | + ... |
| 45 | +``` |
| 46 | + |
| 47 | +A process variable is accessible within the process level and all of its sub-processes or tasks. |
10 | 48 |
|
11 | | -Process objects are currently created within _user_ or _script tasks_. The [user |
12 | | -guide](/user-guide/modelling/process-data) describes how to do it. Created process |
13 | | -objects are stored within a named variable. The value of the variable is a [JSON |
14 | | -data |
15 | | -type](https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf), |
16 | | -which is either a `string, number, boolean, null/empty, object`, or `array`. |
| 49 | +During execution, _Activities/Tasks_ usually first **write** into local Task variables. After finishing the Tasks, the Engine writes the local variable states into the global variable states of the process instance. |
| 50 | +(_Exception:_ Script Tasks have a function to directly change the state of a global variable.) |
| 51 | +If two Activities/Tasks write in parallel to the same global variable, the latest executions wins and overrides the global variable value. |
17 | 52 |
|
18 | | -A process object is accessible within the process level and all of its |
19 | | -sub-processes or tasks. If two activities write in parallel to the same |
20 | | -variable, the latest executions wins and overrides the value. This is a little |
21 | | -bit different with a running _call activity_, because it is started as a |
| 53 | +This behaviour is a little bit different with a running _call activity_, because it is started as a |
22 | 54 | completely separated process. Therefore, the current process variables are |
23 | 55 | copied into the call activity execution at its start. After its execution, all |
24 | 56 | _changed_ or _new_ variables from the call activity process are copied into the |
25 | 57 | parent process. So, this maybe overrides a process variable at the end of the |
26 | 58 | execution. |
27 | 59 |
|
28 | | -Moreover, within PROCEED it can happen that parts of the process are executed on |
| 60 | +_Advanced:_ Moreover, within PROCEED it can happen that parts of the process are executed on |
29 | 61 | another Machine. When two parts are _merged_ on one Machine, newer variables |
30 | 62 | changes override older values. |
0 commit comments