Skip to content

Commit 50babd0

Browse files
committed
Variable definitions added to BPMN
1 parent bd5075b commit 50babd0

4 files changed

Lines changed: 104 additions & 25 deletions

File tree

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,62 @@
1-
import { Callout } from "nextra/components";
1+
import { Callout } from 'nextra/components';
22

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.
712
</Callout>
813

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.
1048

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.
1752

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
2254
completely separated process. Therefore, the current process variables are
2355
copied into the call activity execution at its start. After its execution, all
2456
_changed_ or _new_ variables from the call activity process are copied into the
2557
parent process. So, this maybe overrides a process variable at the end of the
2658
execution.
2759

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
2961
another Machine. When two parts are _merged_ on one Machine, newer variables
3062
changes override older values.

content/developer/bpmn/bpmn-general-serialization.mdx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ https://www.omg.org/spec/BPMN/20100501/BPMN20.xsd"` for schema validation
3535
- `exporterVersion` contains the version number of the Management System
3636

3737
{/* PROCEED specific attributes */}
38-
{/* - `proceed:version` contains the version of the process as a date in milliseconds. It changes if something changes in the process. [See here](versioning)
3938

40-
- `proceed:versionBasedOn` if the process was created from another one, it references the version of the original process \*/}
39+
- `proceed:version` contains the version of the process as a date in milliseconds. It changes if something changes in the process. [See here](versioning)
40+
41+
- `proceed:versionBasedOn` if the process was created from another one, it references the version of the original process
4142

4243
- `proceed:originalId`: (optional) if the process was imported into PROCEED's
4344
Management System, this contains the original definition _id_
@@ -64,6 +65,7 @@ Main Process"`
6465
- `isExecutable`: true
6566
- `proceed:deploymentMethod`: attribute for changing the deployment method. Can
6667
have the values `static` or `dynamic` for the [respective methods](concepts/deployment/_index)
68+
- `proceed:uiForNontypedStartEventsFileName`: attribute with a reference to the UI which should be shown if someone starts a process instance. Usually used for defining process variables at the process start.
6769

6870
## Flow Nodes inside a `process`
6971

@@ -172,14 +174,12 @@ data : - `name` attribute is required and a string : - can be used on every
172174
level, i.e. on `<process>` or every flow node : - the value is specified inside
173175
the content of the element
174176

175-
{/* ## Versioning
177+
## Versioning
176178

177179
Process artifacts (User Task, Scripts, etc.) will be versioned with the attribute `proceed:version`.
178180

179181
## Monitoring
180182

181-
*/}
182-
183183
### Example
184184

185185
```xml
@@ -217,8 +217,10 @@ Process artifacts (User Task, Scripts, etc.) will be versioned with the attribut
217217

218218
<process id="Process_1wqd8fv"
219219
name="PROCEED Main Process"
220-
processType="Private" isExecutable="true"
221-
proceed:deploymentMethod="static">
220+
processType="Private"
221+
isExecutable="true"
222+
proceed:deploymentMethod="static"
223+
proceed:uiForNontypedStartEventsFileName="Process_Start_0jgl7kx">
222224

223225
<extensionElements>
224226
<proceed:meta>
@@ -230,6 +232,9 @@ Process artifacts (User Task, Scripts, etc.) will be versioned with the attribut
230232
<proceed:overviewImage>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAB3BAMAAAAeDIOYAAAAD1BMVEUAAABZWVlgYGBmZmZsbGy1A1kgAAAAAXRSTlMAQObYZgAAAAlwSFlzAAC4jAAAuIwBzPa7LwAAAWRJREFUaN7tmu0NgzAMRMPHAEAYAFoGCBsA+w/VDQqW41wSLv8tWSfn9ZHaudvTj+qzONXZ1Q14XQOtPoJD18GqbmCGR+DQESjHsFE3MOkaqOEmKiPo9BEEwogwIozKh9FJGNUAo4C+iRthtKAjIIwyhFH3uT3BFkayEgMYnbKS+GbUy0oM5HCXlcSHUScrMYDRKioxgFErKznRERjASBgBYWRgRoTRk8keCKOsYNQTRi81o29lMBp0ZmTwZrQTRjQjmtGTyfa2MEJrQXI3nOQzcJjOwAoegTb1JfCZkTA5CCfdHYz+dSL0gfg/hg8idZZG1KWG0Ph6CAXx/5K2b8ayACqAkJLChBAggM0UQhfahtEyXIAJeZqQ5deIEEIXGkKIAOo2oQd2Hfd5cMpNBApbZooPocJ2SC5wAPA9oiY6hArbJYOv9q6EEDYAQggdQFs+hWdCiBDCBkATogkRQlgR+AOhHxPPunGOG5/7AAAAAElFTkSuQmCC</proceed:overviewImage>
231233
<proceed:property name="lastAuthor">Max Mustermann</proceed:property>
232234
</proceed:meta>
235+
<proceed:variables>
236+
<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" />
237+
</proceed:variables>
233238
</extensionElements>
234239

235240
<startEvent id="Event_141ngxf" proceed:machineId="6bd9c3cf-8164-453a-a039-e8aaf138f192">

public/xsd/Test_BPMN_XML.bpmn

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555

5656

57-
<process id="_09abb321-f819-480a-9827-66264d17b4df" name="PROCEED Main Process" processType="Private" isExecutable="true" proceed:deploymentMethod="static">
57+
<process id="_09abb321-f819-480a-9827-66264d17b4df" name="PROCEED Main Process" processType="Private" isExecutable="true" proceed:deploymentMethod="static" proceed:uiForNontypedStartEventsFileName="Process_Start_0jgl7kx">
5858

5959
<extensionElements>
6060
<proceed:meta>
@@ -66,6 +66,27 @@
6666
<proceed:overviewImage>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAB3BAMAAAAeDIOYAAAAD1BMVEUAAABZWVlgYGBmZmZsbGy1A1kgAAAAAXRSTlMAQObYZgAAAAlwSFlzAAC4jAAAuIwBzPa7LwAAAWRJREFUaN7tmu0NgzAMRMPHAEAYAFoGCBsA+w/VDQqW41wSLv8tWSfn9ZHaudvTj+qzONXZ1Q14XQOtPoJD18GqbmCGR+DQESjHsFE3MOkaqOEmKiPo9BEEwogwIozKh9FJGNUAo4C+iRthtKAjIIwyhFH3uT3BFkayEgMYnbKS+GbUy0oM5HCXlcSHUScrMYDRKioxgFErKznRERjASBgBYWRgRoTRk8keCKOsYNQTRi81o29lMBp0ZmTwZrQTRjQjmtGTyfa2MEJrQXI3nOQzcJjOwAoegTb1JfCZkTA5CCfdHYz+dSL0gfg/hg8idZZG1KWG0Ph6CAXx/5K2b8ayACqAkJLChBAggM0UQhfahtEyXIAJeZqQ5deIEEIXGkKIAOo2oQd2Hfd5cMpNBApbZooPocJ2SC5wAPA9oiY6hArbJYOv9q6EEDYAQggdQFs+hWdCiBDCBkATogkRQlgR+AOhHxPPunGOG5/7AAAAAElFTkSuQmCC</proceed:overviewImage>
6767
<proceed:property name="lastAuthor">Max Mustermann</proceed:property>
6868
</proceed:meta>
69+
<proceed:variables>
70+
<!--
71+
name: required, unique
72+
dataType: required, one of: string, number, boolean, object, array, null
73+
description: optional, free text
74+
requiredAtInstanceStartup: optional, boolean, default false
75+
defaultValue: optional, set at design time
76+
enum: optional, array of strings seperated by semicolon, the value must be one of these
77+
const: optional, boolean, default false, non-changeable value after set for the first time
78+
79+
dataType similar to JSON Schema: https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#section-6.1.1
80+
- string: "Text" -> optional: textFormat="email|url" (default: not present, means: no string contraints)
81+
- number: "Number"
82+
- boolean: "On/Off"
83+
- object: "Combined Structure" -> no defaultValue and no enum in UI yet
84+
- array: "List" -> no defaultValue and no enum in UI yet
85+
-->
86+
87+
<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" />
88+
89+
</proceed:variables>
6990
</extensionElements>
7091

7192

public/xsd/XSD-PROCEED.xsd

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<xsd:attribute name="originalCreatorUsername" type="xsd:string" />
5151

5252
<!-- for extension in the BPMN 'process' element -->
53+
<xsd:attribute name="uiForNontypedStartEventsFileName" type="xsd:string" />
5354
<xsd:attribute name="deploymentMethod" type="tDeploymentMethod" />
5455
<xsd:simpleType name="tDeploymentMethod">
5556
<xsd:restriction base="xsd:string">
@@ -162,6 +163,26 @@
162163
<xsd:attribute name="companyRef" type="xsd:NMTOKEN" use="optional"/>
163164
</xsd:complexType>
164165

166+
167+
168+
<!-- Variable definition-->
169+
<xsd:element name="variables" type="tVariables" />
170+
<xsd:complexType name="tVariables">
171+
<xsd:sequence>
172+
<xsd:element name="variable" type="tVariable" minOccurs="0" maxOccurs="unbounded" />
173+
</xsd:sequence>
174+
</xsd:complexType>
175+
<xsd:complexType name="tVariable">
176+
<xsd:attribute name="name" type="xsd:normalizedString" use="required"/>
177+
<xsd:attribute name="dataType" type="xsd:normalizedString" use="required"/>
178+
<xsd:attribute name="textFormat" type="xsd:normalizedString" use="optional"/>
179+
<xsd:attribute name="description" type="xsd:string" use="optional"/>
180+
<xsd:attribute name="requiredAtInstanceStartup" type="xsd:boolean" use="optional"/>
181+
<xsd:attribute name="defaultValue" type="xsd:string" use="optional"/>
182+
<xsd:attribute name="enum" type="xsd:string" use="optional"/>
183+
<xsd:attribute name="const" type="xsd:boolean" use="optional"/>
184+
</xsd:complexType>
185+
165186
<!-- Meta Information: cost, time, probability, property -->
166187
<xsd:element name="meta" type="tMeta"/>
167188
<xsd:complexType name="tMeta">

0 commit comments

Comments
 (0)