bpmn-elements 11.1.1 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/Environment.js +15 -15
  3. package/dist/activity/Activity.js +123 -143
  4. package/dist/activity/ActivityExecution.js +1 -3
  5. package/dist/definition/Definition.js +39 -44
  6. package/dist/definition/DefinitionExecution.js +51 -53
  7. package/dist/eventDefinitions/EventDefinitionExecution.js +10 -10
  8. package/dist/eventDefinitions/TimerEventDefinition.js +16 -16
  9. package/dist/events/BoundaryEvent.js +12 -11
  10. package/dist/events/index.js +60 -0
  11. package/dist/flows/Association.js +0 -1
  12. package/dist/flows/MessageFlow.js +0 -1
  13. package/dist/flows/SequenceFlow.js +1 -3
  14. package/dist/gateways/index.js +49 -0
  15. package/dist/getPropertyValue.js +1 -2
  16. package/dist/index.js +2 -2
  17. package/dist/process/Process.js +54 -61
  18. package/dist/process/ProcessExecution.js +31 -33
  19. package/dist/tasks/LoopCharacteristics.js +20 -7
  20. package/dist/tasks/SubProcess.js +33 -61
  21. package/dist/tasks/index.js +93 -0
  22. package/events.d.ts +1 -0
  23. package/gateways.d.ts +1 -0
  24. package/index.d.ts +1 -0
  25. package/package.json +39 -19
  26. package/src/Environment.js +16 -17
  27. package/src/activity/Activity.js +96 -131
  28. package/src/activity/ActivityExecution.js +0 -1
  29. package/src/definition/Definition.js +30 -40
  30. package/src/definition/DefinitionExecution.js +47 -55
  31. package/src/eventDefinitions/EventDefinitionExecution.js +9 -10
  32. package/src/eventDefinitions/TimerEventDefinition.js +14 -16
  33. package/src/events/BoundaryEvent.js +11 -11
  34. package/src/events/index.js +5 -0
  35. package/src/flows/Association.js +0 -1
  36. package/src/flows/MessageFlow.js +0 -1
  37. package/src/flows/SequenceFlow.js +0 -1
  38. package/src/gateways/index.js +4 -0
  39. package/src/process/Process.js +40 -54
  40. package/src/process/ProcessExecution.js +25 -31
  41. package/src/tasks/LoopCharacteristics.js +18 -7
  42. package/src/tasks/SubProcess.js +32 -66
  43. package/src/tasks/index.js +8 -0
  44. package/tasks.d.ts +1 -0
  45. package/types/index.d.ts +69 -767
  46. package/types/types.d.ts +706 -0
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _CallActivity = require("./CallActivity.js");
7
+ Object.keys(_CallActivity).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _CallActivity[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _CallActivity[key];
14
+ }
15
+ });
16
+ });
17
+ var _ReceiveTask = require("./ReceiveTask.js");
18
+ Object.keys(_ReceiveTask).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _ReceiveTask[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _ReceiveTask[key];
25
+ }
26
+ });
27
+ });
28
+ var _ScriptTask = require("./ScriptTask.js");
29
+ Object.keys(_ScriptTask).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _ScriptTask[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _ScriptTask[key];
36
+ }
37
+ });
38
+ });
39
+ var _ServiceTask = require("./ServiceTask.js");
40
+ Object.keys(_ServiceTask).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _ServiceTask[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _ServiceTask[key];
47
+ }
48
+ });
49
+ });
50
+ var _SignalTask = require("./SignalTask.js");
51
+ Object.keys(_SignalTask).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _SignalTask[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _SignalTask[key];
58
+ }
59
+ });
60
+ });
61
+ var _SubProcess = require("./SubProcess.js");
62
+ Object.keys(_SubProcess).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _SubProcess[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function () {
68
+ return _SubProcess[key];
69
+ }
70
+ });
71
+ });
72
+ var _Task = require("./Task.js");
73
+ Object.keys(_Task).forEach(function (key) {
74
+ if (key === "default" || key === "__esModule") return;
75
+ if (key in exports && exports[key] === _Task[key]) return;
76
+ Object.defineProperty(exports, key, {
77
+ enumerable: true,
78
+ get: function () {
79
+ return _Task[key];
80
+ }
81
+ });
82
+ });
83
+ var _Transaction = require("./Transaction.js");
84
+ Object.keys(_Transaction).forEach(function (key) {
85
+ if (key === "default" || key === "__esModule") return;
86
+ if (key in exports && exports[key] === _Transaction[key]) return;
87
+ Object.defineProperty(exports, key, {
88
+ enumerable: true,
89
+ get: function () {
90
+ return _Transaction[key];
91
+ }
92
+ });
93
+ });
package/events.d.ts ADDED
@@ -0,0 +1 @@
1
+ import './types/index.js';
package/gateways.d.ts ADDED
@@ -0,0 +1 @@
1
+ import './types/index.js';
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ import './types/index.js';
package/package.json CHANGED
@@ -1,15 +1,33 @@
1
1
  {
2
2
  "name": "bpmn-elements",
3
- "version": "11.1.1",
3
+ "version": "13.0.0",
4
4
  "description": "Executable workflow elements based on BPMN 2.0",
5
5
  "type": "module",
6
- "main": "dist/index.js",
7
- "module": "src/index.js",
6
+ "main": "./dist/index.js",
7
+ "module": "./src/index.js",
8
8
  "jsnext:main": "./src/index.js",
9
- "types": "./types",
9
+ "types": "./types/index.d.ts",
10
10
  "exports": {
11
- "import": "./src/index.js",
12
- "require": "./dist/index.js"
11
+ ".": {
12
+ "types": "./types/index.d.ts",
13
+ "require": "./dist/index.js",
14
+ "import": "./src/index.js"
15
+ },
16
+ "./events": {
17
+ "types": "./types/index.d.ts",
18
+ "require": "./dist/events/index.js",
19
+ "import": "./src/events/index.js"
20
+ },
21
+ "./gateways": {
22
+ "types": "./types/index.d.ts",
23
+ "require": "./dist/gateways/index.js",
24
+ "import": "./src/gateways/index.js"
25
+ },
26
+ "./tasks": {
27
+ "types": "./types/index.d.ts",
28
+ "require": "./dist/tasks/index.js",
29
+ "import": "./src/tasks/index.js"
30
+ }
13
31
  },
14
32
  "sideEffects": false,
15
33
  "scripts": {
@@ -41,28 +59,30 @@
41
59
  "files": [
42
60
  "dist",
43
61
  "types",
44
- "src"
62
+ "src",
63
+ "*.d.ts"
45
64
  ],
46
65
  "devDependencies": {
47
66
  "@aircall/expression-parser": "^1.0.4",
48
- "@babel/cli": "^7.22.9",
49
- "@babel/core": "^7.22.9",
50
- "@babel/preset-env": "^7.22.9",
51
- "@babel/register": "^7.22.5",
67
+ "@babel/cli": "^7.23.9",
68
+ "@babel/core": "^7.23.9",
69
+ "@babel/preset-env": "^7.23.9",
70
+ "@babel/register": "^7.23.7",
52
71
  "@bonniernews/hot-bev": "^0.4.0",
53
- "bpmn-moddle": "^8.0.1",
54
- "c8": "^8.0.0",
72
+ "@types/node": "^16.18.79",
73
+ "bpmn-moddle": "^8.1.0",
74
+ "c8": "^9.1.0",
55
75
  "camunda-bpmn-moddle": "^7.0.1",
56
- "chai": "^4.3.7",
57
- "chronokinesis": "^5.0.2",
76
+ "chai": "^5.0.3",
77
+ "chronokinesis": "^6.0.0",
58
78
  "debug": "^4.3.4",
59
- "eslint": "^8.44.0",
60
- "eslint-plugin-import": "^2.27.5",
61
- "got": "^12.6.1",
79
+ "eslint": "^8.56.0",
80
+ "eslint-plugin-import": "^2.29.1",
81
+ "got": "^14.1.0",
62
82
  "mocha": "^10.1.0",
63
83
  "mocha-cakes-2": "^3.3.0",
64
84
  "moddle-context-serializer": "^4.0.0",
65
- "nock": "^13.3.1"
85
+ "nock": "^13.5.1"
66
86
  },
67
87
  "dependencies": {
68
88
  "smqp": "^8.0.0"
@@ -31,24 +31,23 @@ export default function Environment(options = {}) {
31
31
  this[kVariables] = options.variables || {};
32
32
  }
33
33
 
34
- Object.defineProperty(Environment.prototype, 'variables', {
35
- enumerable: true,
36
- get() {
37
- return this[kVariables];
34
+ Object.defineProperties(Environment.prototype, {
35
+ variables: {
36
+ get() {
37
+ return this[kVariables];
38
+ },
38
39
  },
39
- });
40
-
41
- Object.defineProperty(Environment.prototype, 'services', {
42
- enumerable: true,
43
- get() {
44
- return this[kServices];
45
- },
46
- set(value) {
47
- const services = this[kServices];
48
- for (const name in services) {
49
- if (!(name in value)) delete services[name];
50
- }
51
- Object.assign(services, value);
40
+ services: {
41
+ get() {
42
+ return this[kServices];
43
+ },
44
+ set(value) {
45
+ const services = this[kServices];
46
+ for (const name in services) {
47
+ if (!(name in value)) delete services[name];
48
+ }
49
+ Object.assign(services, value);
50
+ },
52
51
  },
53
52
  });
54
53
 
@@ -102,161 +102,126 @@ function Activity(Behaviour, activityDef, context) {
102
102
  this[kExtensions] = context.loadExtensions(this);
103
103
  }
104
104
 
105
- Object.defineProperty(Activity.prototype, 'counters', {
106
- enumerable: true,
107
- get() {
108
- return {...this[kCounters]};
105
+ Object.defineProperties(Activity.prototype, {
106
+ counters: {
107
+ get() {
108
+ return {...this[kCounters]};
109
+ },
109
110
  },
110
- });
111
-
112
- Object.defineProperty(Activity.prototype, 'execution', {
113
- enumerable: true,
114
- get() {
115
- return this[kExec].execution;
111
+ execution: {
112
+ get() {
113
+ return this[kExec].execution;
114
+ },
116
115
  },
117
- });
118
-
119
- Object.defineProperty(Activity.prototype, 'executionId', {
120
- enumerable: true,
121
- get() {
122
- return this[kExec].executionId;
116
+ executionId: {
117
+ get() {
118
+ return this[kExec].executionId;
119
+ },
123
120
  },
124
- });
125
-
126
- Object.defineProperty(Activity.prototype, 'extensions', {
127
- enumerable: true,
128
- get() {
129
- return this[kExtensions];
121
+ extensions: {
122
+ get() {
123
+ return this[kExtensions];
124
+ },
130
125
  },
131
- });
132
-
133
- Object.defineProperty(Activity.prototype, 'bpmnIo', {
134
- enumerable: true,
135
- get() {
136
- const extensions = this[kExtensions];
137
- return extensions && extensions.extensions.find(e => e.type === 'bpmnio');
126
+ bpmnIo: {
127
+ get() {
128
+ const extensions = this[kExtensions];
129
+ return extensions && extensions.extensions.find(e => e.type === 'bpmnio');
130
+ },
138
131
  },
139
- });
140
-
141
- Object.defineProperty(Activity.prototype, 'formatter', {
142
- enumerable: true,
143
- get() {
144
- let formatter = this[kFormatter];
145
- if (formatter) return formatter;
146
-
147
- const broker = this.broker;
148
- formatter = this[kFormatter] = new Formatter({
149
- id: this.id,
150
- broker,
151
- logger: this.logger,
152
- }, broker.getQueue('format-run-q'));
153
- return formatter;
132
+ formatter: {
133
+ get() {
134
+ let formatter = this[kFormatter];
135
+ if (formatter) return formatter;
136
+
137
+ const broker = this.broker;
138
+ formatter = this[kFormatter] = new Formatter({
139
+ id: this.id,
140
+ broker,
141
+ logger: this.logger,
142
+ }, broker.getQueue('format-run-q'));
143
+ return formatter;
144
+ },
154
145
  },
155
- });
156
-
157
- Object.defineProperty(Activity.prototype, 'isRunning', {
158
- enumerable: true,
159
- get() {
160
- if (!this[kConsuming]) return false;
161
- return !!this.status;
146
+ isRunning: {
147
+ get() {
148
+ if (!this[kConsuming]) return false;
149
+ return !!this.status;
150
+ },
162
151
  },
163
- });
164
-
165
- Object.defineProperty(Activity.prototype, 'outbound', {
166
- enumerable: true,
167
- get() {
168
- return this[kFlows].outboundSequenceFlows;
152
+ outbound: {
153
+ get() {
154
+ return this[kFlows].outboundSequenceFlows;
155
+ },
169
156
  },
170
- });
171
-
172
- Object.defineProperty(Activity.prototype, 'inbound', {
173
- enumerable: true,
174
- get() {
175
- return this[kFlows].inboundSequenceFlows;
157
+ inbound: {
158
+ get() {
159
+ return this[kFlows].inboundSequenceFlows;
160
+ },
176
161
  },
177
- });
178
-
179
- Object.defineProperty(Activity.prototype, 'isEnd', {
180
- enumerable: true,
181
- get() {
182
- return this[kFlags].isEnd;
162
+ isEnd: {
163
+ get() {
164
+ return this[kFlags].isEnd;
165
+ },
183
166
  },
184
- });
185
- Object.defineProperty(Activity.prototype, 'isStart', {
186
- enumerable: true,
187
- get() {
188
- return this[kFlags].isStart;
167
+ isStart: {
168
+ get() {
169
+ return this[kFlags].isStart;
170
+ },
189
171
  },
190
- });
191
- Object.defineProperty(Activity.prototype, 'isSubProcess', {
192
- enumerable: true,
193
- get() {
194
- return this[kFlags].isSubProcess;
172
+ isSubProcess: {
173
+ get() {
174
+ return this[kFlags].isSubProcess;
175
+ },
195
176
  },
196
- });
197
- Object.defineProperty(Activity.prototype, 'isTransaction', {
198
- enumerable: true,
199
- get() {
200
- return this[kFlags].isTransaction;
177
+ isTransaction: {
178
+ get() {
179
+ return this[kFlags].isTransaction;
180
+ },
201
181
  },
202
- });
203
-
204
- Object.defineProperty(Activity.prototype, 'isMultiInstance', {
205
- enumerable: true,
206
- get() {
207
- return this[kFlags].isMultiInstance;
182
+ isMultiInstance: {
183
+ get() {
184
+ return this[kFlags].isMultiInstance;
185
+ },
208
186
  },
209
- });
210
-
211
- Object.defineProperty(Activity.prototype, 'isThrowing', {
212
- enumerable: true,
213
- get() {
214
- return this[kFlags].isThrowing;
187
+ isThrowing: {
188
+ get() {
189
+ return this[kFlags].isThrowing;
190
+ },
215
191
  },
216
- });
217
- Object.defineProperty(Activity.prototype, 'isForCompensation', {
218
- enumerable: true,
219
- get() {
220
- return this[kFlags].isForCompensation;
192
+ isForCompensation: {
193
+ get() {
194
+ return this[kFlags].isForCompensation;
195
+ },
221
196
  },
222
- });
223
- Object.defineProperty(Activity.prototype, 'triggeredByEvent', {
224
- enumerable: true,
225
- get() {
226
- return this[kActivityDef].triggeredByEvent;
197
+ triggeredByEvent: {
198
+ get() {
199
+ return this[kActivityDef].triggeredByEvent;
200
+ },
227
201
  },
228
- });
229
-
230
- Object.defineProperty(Activity.prototype, 'attachedTo', {
231
- enumerable: true,
232
- get() {
233
- const attachedToId = this[kFlags].attachedTo;
234
- if (!attachedToId) return null;
235
- return this.getActivityById(attachedToId);
202
+ attachedTo: {
203
+ get() {
204
+ const attachedToId = this[kFlags].attachedTo;
205
+ if (!attachedToId) return null;
206
+ return this.getActivityById(attachedToId);
207
+ },
236
208
  },
237
- });
238
-
239
- Object.defineProperty(Activity.prototype, 'lane', {
240
- enumerable: true,
241
- get() {
209
+ lane: { get() {
242
210
  const laneId = this[kFlags].lane;
243
211
  if (!laneId) return undefined;
244
212
  const parent = this.parentElement;
245
213
  return parent.getLaneById && parent.getLaneById(laneId);
246
214
  },
247
- });
248
-
249
- Object.defineProperty(Activity.prototype, 'eventDefinitions', {
250
- enumerable: true,
251
- get() {
252
- return this[kEventDefinitions];
253
215
  },
254
- });
255
-
256
- Object.defineProperty(Activity.prototype, 'parentElement', {
257
- enumerable: true,
258
- get() {
259
- return this.context.getActivityParentById(this.id);
216
+ eventDefinitions: {
217
+ get() {
218
+ return this[kEventDefinitions];
219
+ },
220
+ },
221
+ parentElement: {
222
+ get() {
223
+ return this.context.getActivityParentById(this.id);
224
+ },
260
225
  },
261
226
  });
262
227
 
@@ -25,7 +25,6 @@ function ActivityExecution(activity, context) {
25
25
  }
26
26
 
27
27
  Object.defineProperty(ActivityExecution.prototype, 'completed', {
28
- enumerable: true,
29
28
  get() {
30
29
  return this[kCompleted];
31
30
  },
@@ -63,52 +63,42 @@ export function Definition(context, options) {
63
63
  this.logger = environment.Logger(type.toLowerCase());
64
64
  }
65
65
 
66
- Object.defineProperty(Definition.prototype, 'counters', {
67
- enumerable: true,
68
- get() {
69
- return {...this[kCounters]};
66
+ Object.defineProperties(Definition.prototype, {
67
+ counters: {
68
+ get() {
69
+ return {...this[kCounters]};
70
+ },
70
71
  },
71
- });
72
-
73
- Object.defineProperty(Definition.prototype, 'execution', {
74
- enumerable: true,
75
- get() {
76
- return this[kExec].execution;
72
+ execution: {
73
+ get() {
74
+ return this[kExec].execution;
75
+ },
77
76
  },
78
- });
79
-
80
- Object.defineProperty(Definition.prototype, 'executionId', {
81
- enumerable: true,
82
- get() {
83
- return this[kExec].executionId;
77
+ executionId: {
78
+ get() {
79
+ return this[kExec].executionId;
80
+ },
84
81
  },
85
- });
86
-
87
- Object.defineProperty(Definition.prototype, 'isRunning', {
88
- enumerable: true,
89
- get() {
90
- if (!this[kConsuming]) return false;
91
- return !!this.status;
82
+ isRunning: {
83
+ get() {
84
+ if (!this[kConsuming]) return false;
85
+ return !!this.status;
86
+ },
92
87
  },
93
- });
94
-
95
- Object.defineProperty(Definition.prototype, 'status', {
96
- enumerable: true,
97
- get() {
98
- return this[kStatus];
88
+ status: {
89
+ get() {
90
+ return this[kStatus];
91
+ },
99
92
  },
100
- });
101
-
102
- Object.defineProperty(Definition.prototype, 'stopped', {
103
- enumerable: true,
104
- get() {
105
- return this[kStopped];
93
+ stopped: {
94
+ get() {
95
+ return this[kStopped];
96
+ },
106
97
  },
107
- });
108
-
109
- Object.defineProperty(Definition.prototype, 'activityStatus', {
110
- get() {
111
- return this[kExec].execution && this[kExec].execution.activityStatus || 'idle';
98
+ activityStatus: {
99
+ get() {
100
+ return this[kExec].execution && this[kExec].execution.activityStatus || 'idle';
101
+ },
112
102
  },
113
103
  });
114
104