bpmn-elements 5.1.3 → 7.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 (119) hide show
  1. package/CHANGELOG.md +322 -0
  2. package/README.md +9 -3
  3. package/dist/index.js +71 -39
  4. package/dist/src/Api.js +77 -76
  5. package/dist/src/Context.js +169 -164
  6. package/dist/src/Environment.js +90 -102
  7. package/dist/src/EventBroker.js +89 -88
  8. package/dist/src/ExtensionsMapper.js +2 -2
  9. package/dist/src/MessageFormatter.js +164 -95
  10. package/dist/src/Scripts.js +6 -2
  11. package/dist/src/Timers.js +4 -6
  12. package/dist/src/activity/Activity.js +1108 -901
  13. package/dist/src/activity/ActivityExecution.js +342 -297
  14. package/dist/src/activity/Dummy.js +3 -3
  15. package/dist/src/definition/Definition.js +498 -444
  16. package/dist/src/definition/DefinitionExecution.js +722 -409
  17. package/dist/src/error/Errors.js +17 -7
  18. package/dist/src/eventDefinitions/CancelEventDefinition.js +190 -150
  19. package/dist/src/eventDefinitions/CompensateEventDefinition.js +194 -161
  20. package/dist/src/eventDefinitions/ConditionalEventDefinition.js +197 -135
  21. package/dist/src/eventDefinitions/ErrorEventDefinition.js +207 -165
  22. package/dist/src/eventDefinitions/EscalationEventDefinition.js +175 -141
  23. package/dist/src/eventDefinitions/EventDefinitionExecution.js +157 -129
  24. package/dist/src/eventDefinitions/LinkEventDefinition.js +174 -149
  25. package/dist/src/eventDefinitions/MessageEventDefinition.js +213 -176
  26. package/dist/src/eventDefinitions/SignalEventDefinition.js +203 -161
  27. package/dist/src/eventDefinitions/TerminateEventDefinition.js +21 -23
  28. package/dist/src/eventDefinitions/TimerEventDefinition.js +243 -228
  29. package/dist/src/events/BoundaryEvent.js +180 -144
  30. package/dist/src/events/EndEvent.js +18 -23
  31. package/dist/src/events/IntermediateCatchEvent.js +44 -58
  32. package/dist/src/events/IntermediateThrowEvent.js +18 -23
  33. package/dist/src/events/StartEvent.js +109 -94
  34. package/dist/src/flows/Association.js +94 -101
  35. package/dist/src/flows/MessageFlow.js +86 -103
  36. package/dist/src/flows/SequenceFlow.js +172 -184
  37. package/dist/src/gateways/EventBasedGateway.js +88 -84
  38. package/dist/src/gateways/ExclusiveGateway.js +13 -16
  39. package/dist/src/gateways/InclusiveGateway.js +11 -14
  40. package/dist/src/gateways/ParallelGateway.js +11 -14
  41. package/dist/src/getPropertyValue.js +34 -34
  42. package/dist/src/io/BpmnIO.js +31 -0
  43. package/dist/src/io/EnvironmentDataObject.js +33 -29
  44. package/dist/src/io/EnvironmentDataStore.js +52 -0
  45. package/dist/src/io/EnvironmentDataStoreReference.js +52 -0
  46. package/dist/src/io/InputOutputSpecification.js +177 -168
  47. package/dist/src/io/Properties.js +252 -0
  48. package/dist/src/messageHelper.js +1 -1
  49. package/dist/src/process/Process.js +433 -359
  50. package/dist/src/process/ProcessExecution.js +744 -645
  51. package/dist/src/shared.js +3 -6
  52. package/dist/src/tasks/CallActivity.js +160 -0
  53. package/dist/src/tasks/LoopCharacteristics.js +309 -330
  54. package/dist/src/tasks/ReceiveTask.js +233 -182
  55. package/dist/src/tasks/ScriptTask.js +35 -41
  56. package/dist/src/tasks/ServiceImplementation.js +13 -20
  57. package/dist/src/tasks/ServiceTask.js +82 -75
  58. package/dist/src/tasks/SignalTask.js +97 -93
  59. package/dist/src/tasks/StandardLoopCharacteristics.js +1 -1
  60. package/dist/src/tasks/SubProcess.js +195 -175
  61. package/dist/src/tasks/Task.js +17 -19
  62. package/index.js +8 -0
  63. package/package.json +16 -15
  64. package/src/Api.js +65 -59
  65. package/src/Context.js +142 -132
  66. package/src/Environment.js +88 -100
  67. package/src/EventBroker.js +67 -68
  68. package/src/ExtensionsMapper.js +2 -2
  69. package/src/MessageFormatter.js +132 -74
  70. package/src/Timers.js +4 -4
  71. package/src/activity/Activity.js +916 -757
  72. package/src/activity/ActivityExecution.js +293 -247
  73. package/src/activity/Dummy.js +2 -2
  74. package/src/definition/Definition.js +436 -401
  75. package/src/definition/DefinitionExecution.js +603 -343
  76. package/src/error/Errors.js +11 -6
  77. package/src/eventDefinitions/CancelEventDefinition.js +164 -121
  78. package/src/eventDefinitions/CompensateEventDefinition.js +158 -124
  79. package/src/eventDefinitions/ConditionalEventDefinition.js +147 -104
  80. package/src/eventDefinitions/ErrorEventDefinition.js +190 -131
  81. package/src/eventDefinitions/EscalationEventDefinition.js +139 -101
  82. package/src/eventDefinitions/EventDefinitionExecution.js +127 -95
  83. package/src/eventDefinitions/LinkEventDefinition.js +160 -129
  84. package/src/eventDefinitions/MessageEventDefinition.js +178 -121
  85. package/src/eventDefinitions/SignalEventDefinition.js +162 -106
  86. package/src/eventDefinitions/TerminateEventDefinition.js +19 -19
  87. package/src/eventDefinitions/TimerEventDefinition.js +202 -167
  88. package/src/events/BoundaryEvent.js +156 -115
  89. package/src/events/EndEvent.js +15 -18
  90. package/src/events/IntermediateCatchEvent.js +40 -44
  91. package/src/events/IntermediateThrowEvent.js +15 -18
  92. package/src/events/StartEvent.js +84 -50
  93. package/src/flows/Association.js +98 -113
  94. package/src/flows/MessageFlow.js +81 -97
  95. package/src/flows/SequenceFlow.js +145 -163
  96. package/src/gateways/EventBasedGateway.js +75 -68
  97. package/src/gateways/ExclusiveGateway.js +8 -13
  98. package/src/gateways/InclusiveGateway.js +8 -13
  99. package/src/gateways/ParallelGateway.js +8 -13
  100. package/src/getPropertyValue.js +34 -33
  101. package/src/io/BpmnIO.js +20 -0
  102. package/src/io/EnvironmentDataObject.js +29 -18
  103. package/src/io/EnvironmentDataStore.js +33 -0
  104. package/src/io/EnvironmentDataStoreReference.js +33 -0
  105. package/src/io/InputOutputSpecification.js +154 -157
  106. package/src/io/Properties.js +199 -0
  107. package/src/process/Process.js +374 -333
  108. package/src/process/ProcessExecution.js +606 -554
  109. package/src/shared.js +1 -5
  110. package/src/tasks/CallActivity.js +130 -0
  111. package/src/tasks/LoopCharacteristics.js +290 -289
  112. package/src/tasks/ReceiveTask.js +174 -107
  113. package/src/tasks/ScriptTask.js +27 -30
  114. package/src/tasks/ServiceImplementation.js +13 -18
  115. package/src/tasks/ServiceTask.js +67 -60
  116. package/src/tasks/SignalTask.js +77 -52
  117. package/src/tasks/StandardLoopCharacteristics.js +1 -1
  118. package/src/tasks/SubProcess.js +184 -157
  119. package/src/tasks/Task.js +15 -19
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = SubProcess;
7
6
  exports.SubProcessBehaviour = SubProcessBehaviour;
7
+ exports.default = SubProcess;
8
8
 
9
9
  var _Activity = _interopRequireDefault(require("../activity/Activity"));
10
10
 
@@ -14,9 +14,12 @@ var _messageHelper = require("../messageHelper");
14
14
 
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
16
 
17
+ const executionsSymbol = Symbol.for('executions');
18
+ const messageHandlersSymbol = Symbol.for('messageHandlers');
19
+
17
20
  function SubProcess(activityDef, context) {
18
21
  const triggeredByEvent = activityDef.behaviour && activityDef.behaviour.triggeredByEvent;
19
- const subProcess = (0, _Activity.default)(SubProcessBehaviour, { ...activityDef,
22
+ const subProcess = new _Activity.default(SubProcessBehaviour, { ...activityDef,
20
23
  isSubProcess: true,
21
24
  triggeredByEvent
22
25
  }, context);
@@ -37,7 +40,7 @@ function SubProcess(activityDef, context) {
37
40
  startId
38
41
  } = message.content;
39
42
  const last = message.content.sequence.pop();
40
- const sequence = (0, _ProcessExecution.default)(subProcess, context).shake(startId);
43
+ const sequence = new _ProcessExecution.default(subProcess, context).shake(startId);
41
44
  message.content.sequence.push({ ...last,
42
45
  isSubProcess: true,
43
46
  sequence
@@ -49,214 +52,231 @@ function SubProcessBehaviour(activity, context) {
49
52
  const {
50
53
  id,
51
54
  type,
52
- broker,
53
- behaviour,
54
- environment,
55
- logger
55
+ behaviour
56
56
  } = activity;
57
- const loopCharacteristics = behaviour.loopCharacteristics && behaviour.loopCharacteristics.Behaviour(activity, behaviour.loopCharacteristics);
58
- const processExecutions = [];
59
- let rootExecutionId;
60
- const source = {
61
- id,
62
- type,
63
- loopCharacteristics,
64
-
65
- get execution() {
66
- return processExecutions[0];
67
- },
68
-
69
- get executions() {
70
- return processExecutions;
71
- },
57
+ this.id = id;
58
+ this.type = type;
59
+ this.loopCharacteristics = behaviour.loopCharacteristics && new behaviour.loopCharacteristics.Behaviour(activity, behaviour.loopCharacteristics);
60
+ this.activity = activity;
61
+ this.context = context;
62
+ this.environment = activity.environment;
63
+ this.broker = activity.broker;
64
+ this.executionId = undefined;
65
+ this[executionsSymbol] = [];
66
+ this[messageHandlersSymbol] = {
67
+ onApiRootMessage: this._onApiRootMessage.bind(this),
68
+ onExecutionCompleted: this._onExecutionCompleted.bind(this)
69
+ };
70
+ }
72
71
 
73
- execute,
74
- getApi,
75
- getState,
72
+ const proto = SubProcessBehaviour.prototype;
73
+ Object.defineProperty(proto, 'execution', {
74
+ get() {
75
+ return this[executionsSymbol][0];
76
+ }
76
77
 
77
- getPostponed() {
78
- return this.executions.reduce((result, pe) => {
79
- result = result.concat(pe.getPostponed());
80
- return result;
81
- }, []);
82
- },
78
+ });
79
+ Object.defineProperty(proto, 'executions', {
80
+ get() {
81
+ return this[executionsSymbol].slice();
82
+ }
83
83
 
84
- recover
85
- };
86
- return source;
84
+ });
87
85
 
88
- function execute(executeMessage) {
89
- const content = executeMessage.content;
86
+ proto.execute = function execute(executeMessage) {
87
+ const content = executeMessage.content;
88
+ let executionId = this.executionId;
90
89
 
91
- if (content.isRootScope) {
92
- rootExecutionId = content.executionId;
93
- }
90
+ if (content.isRootScope) {
91
+ executionId = this.executionId = content.executionId;
92
+ }
94
93
 
95
- if (loopCharacteristics && content.isRootScope) {
96
- broker.subscribeTmp('api', `activity.#.${rootExecutionId}`, onApiRootMessage, {
97
- noAck: true,
98
- consumerTag: `_api-${rootExecutionId}`,
99
- priority: 200
100
- });
101
- return loopCharacteristics.execute(executeMessage);
102
- }
94
+ const loopCharacteristics = this.loopCharacteristics;
103
95
 
104
- const processExecution = upsertExecution(executeMessage);
105
- if (!processExecution) return;
106
- return processExecution.execute(executeMessage);
96
+ if (loopCharacteristics && content.isRootScope) {
97
+ this.broker.subscribeTmp('api', `activity.#.${executionId}`, this[messageHandlersSymbol].onApiRootMessage, {
98
+ noAck: true,
99
+ consumerTag: `_api-${executionId}`,
100
+ priority: 200
101
+ });
102
+ return loopCharacteristics.execute(executeMessage);
103
+ }
107
104
 
108
- function onApiRootMessage(routingKey, message) {
109
- const messageType = message.properties.type;
105
+ const processExecution = this._upsertExecution(executeMessage);
110
106
 
111
- switch (messageType) {
112
- case 'stop':
113
- broker.cancel(`_api-${rootExecutionId}`);
114
- stop();
115
- break;
107
+ if (!processExecution) return;
108
+ return processExecution.execute(executeMessage);
109
+ };
116
110
 
117
- case 'discard':
118
- broker.cancel(`_api-${rootExecutionId}`);
119
- discard();
120
- break;
121
- }
122
- }
111
+ proto.stop = function stop() {
112
+ for (const execution of this[executionsSymbol]) {
113
+ this.broker.cancel(`_sub-process-execution-${execution.executionId}`);
114
+ this.broker.cancel(`_sub-process-api-${execution.executionId}`);
115
+ execution.stop();
123
116
  }
117
+ };
124
118
 
125
- function stop() {
126
- return processExecutions.forEach(pe => {
127
- broker.cancel(`_sub-process-execution-${pe.executionId}`);
128
- broker.cancel(`_sub-process-api-${pe.executionId}`);
129
- pe.stop();
130
- });
119
+ proto.discard = function discard() {
120
+ for (const execution of this[executionsSymbol]) {
121
+ this.broker.cancel(`_sub-process-execution-${execution.executionId}`);
122
+ this.broker.cancel(`_sub-process-api-${execution.executionId}`);
123
+ execution.discard();
124
+ }
125
+ };
126
+
127
+ proto.getState = function getState() {
128
+ if (this.loopCharacteristics) {
129
+ return {
130
+ executions: this[executionsSymbol].map(pe => {
131
+ const state = pe.getState();
132
+ state.environment = pe.environment.getState();
133
+ return state;
134
+ })
135
+ };
131
136
  }
132
137
 
133
- function discard() {
134
- return processExecutions.forEach(pe => {
135
- broker.cancel(`_sub-process-execution-${pe.executionId}`);
136
- broker.cancel(`_sub-process-api-${pe.executionId}`);
137
- pe.discard();
138
- });
138
+ const execution = this.execution;
139
+
140
+ if (execution) {
141
+ const state = execution.getState();
142
+ state.environment = execution.environment.getState();
143
+ return state;
139
144
  }
145
+ };
140
146
 
141
- function getState() {
142
- if (loopCharacteristics) {
143
- return {
144
- executions: processExecutions.map(getExecutionState)
145
- };
146
- }
147
+ proto.recover = function recover(state) {
148
+ if (!state) return;
149
+ const executions = this[executionsSymbol];
150
+ const loopCharacteristics = this.loopCharacteristics;
147
151
 
148
- if (processExecutions.length) {
149
- return getExecutionState(processExecutions[0]);
150
- }
152
+ if (loopCharacteristics && state.executions) {
153
+ executions.splice(0);
151
154
 
152
- function getExecutionState(pe) {
153
- const state = pe.getState();
154
- state.environment = pe.environment.getState();
155
- return state;
155
+ for (const se of state.executions) {
156
+ this.recover(se);
156
157
  }
157
- }
158
158
 
159
- function recover(state) {
160
- if (!state) return;
159
+ return;
160
+ }
161
161
 
162
- if (loopCharacteristics && state.executions) {
163
- processExecutions.splice(0);
164
- return state.executions.forEach(recover);
165
- } else if (!loopCharacteristics) {
166
- processExecutions.splice(0);
167
- }
162
+ if (!loopCharacteristics) {
163
+ executions.splice(0);
164
+ }
168
165
 
169
- const subEnvironment = environment.clone().recover(state.environment);
170
- const subContext = context.clone(subEnvironment);
171
- const execution = (0, _ProcessExecution.default)(activity, subContext).recover(state);
172
- processExecutions.push(execution);
173
- return execution;
166
+ const subEnvironment = this.environment.clone().recover(state.environment);
167
+ const subContext = this.context.clone(subEnvironment);
168
+ const execution = new _ProcessExecution.default(this.activity, subContext).recover(state);
169
+ executions.push(execution);
170
+ return execution;
171
+ };
172
+
173
+ proto.getPostponed = function getPostponed() {
174
+ return this[executionsSymbol].reduce((result, pe) => {
175
+ result = result.concat(pe.getPostponed());
176
+ return result;
177
+ }, []);
178
+ };
179
+
180
+ proto._onApiRootMessage = function onApiRootMessage(_, message) {
181
+ const messageType = message.properties.type;
182
+
183
+ switch (messageType) {
184
+ case 'stop':
185
+ this.broker.cancel(message.fields.consumerTag);
186
+ this.stop();
187
+ break;
188
+
189
+ case 'discard':
190
+ this.broker.cancel(message.fields.consumerTag);
191
+ this.discard();
192
+ break;
174
193
  }
194
+ };
175
195
 
176
- function upsertExecution(executeMessage) {
177
- const content = executeMessage.content;
178
- const executionId = content.executionId;
179
- let execution = getExecutionById(executionId);
196
+ proto._upsertExecution = function upsertExecution(executeMessage) {
197
+ const content = executeMessage.content;
198
+ const executionId = content.executionId;
180
199
 
181
- if (execution) {
182
- if (executeMessage.fields.redelivered) addListeners(execution, executionId);
183
- return execution;
184
- }
200
+ let execution = this._getExecutionById(executionId);
185
201
 
186
- const subEnvironment = environment.clone({
187
- output: {}
188
- });
189
- const subContext = context.clone(subEnvironment);
190
- execution = (0, _ProcessExecution.default)(activity, subContext);
191
- processExecutions.push(execution);
192
- addListeners(execution, executionId);
202
+ if (execution) {
203
+ if (executeMessage.fields.redelivered) this._addListeners(execution, executionId);
193
204
  return execution;
194
205
  }
195
206
 
196
- function addListeners(processExecution, executionId) {
197
- const executionConsumerTag = `_sub-process-execution-${executionId}`;
198
- broker.subscribeTmp('subprocess-execution', `execution.#.${executionId}`, onExecutionCompleted, {
199
- noAck: true,
200
- consumerTag: executionConsumerTag
201
- });
207
+ const subEnvironment = this.environment.clone({
208
+ output: {}
209
+ });
210
+ const subContext = this.context.clone(subEnvironment);
211
+ execution = new _ProcessExecution.default(this.activity, subContext);
212
+ this[executionsSymbol].push(execution);
213
+
214
+ this._addListeners(execution, executionId);
202
215
 
203
- function onExecutionCompleted(_, message) {
204
- const content = message.content;
205
- const messageType = message.properties.type;
206
- if (message.fields.redelivered && message.properties.persistent === false) return;
207
-
208
- switch (messageType) {
209
- case 'stopped':
210
- {
211
- broker.cancel(executionConsumerTag);
212
- break;
213
- }
214
-
215
- case 'discard':
216
- {
217
- broker.cancel(executionConsumerTag);
218
- broker.publish('execution', 'execute.discard', (0, _messageHelper.cloneContent)(content));
219
- break;
220
- }
221
-
222
- case 'completed':
223
- {
224
- broker.cancel(executionConsumerTag);
225
- broker.publish('execution', 'execute.completed', (0, _messageHelper.cloneContent)(content));
226
- break;
227
- }
228
-
229
- case 'error':
230
- {
231
- broker.cancel(executionConsumerTag);
232
- const {
233
- error
234
- } = content;
235
- logger.error(`<${id}>`, error);
236
- broker.publish('execution', 'execute.error', (0, _messageHelper.cloneContent)(content));
237
- break;
238
- }
216
+ return execution;
217
+ };
218
+
219
+ proto._addListeners = function addListeners(processExecution, executionId) {
220
+ this.broker.subscribeTmp('subprocess-execution', `execution.#.${executionId}`, this[messageHandlersSymbol].onExecutionCompleted, {
221
+ noAck: true,
222
+ consumerTag: `_sub-process-execution-${executionId}`
223
+ });
224
+ };
225
+
226
+ proto._onExecutionCompleted = function onExecutionCompleted(_, message) {
227
+ if (message.fields.redelivered && message.properties.persistent === false) return;
228
+ const content = message.content;
229
+ const messageType = message.properties.type;
230
+ const broker = this.broker;
231
+
232
+ switch (messageType) {
233
+ case 'stopped':
234
+ {
235
+ broker.cancel(message.fields.consumerTag);
236
+ break;
239
237
  }
240
- }
241
- }
242
238
 
243
- function getApi(apiMessage) {
244
- const content = apiMessage.content;
245
- if (content.id === id) return;
246
- let execution;
239
+ case 'discard':
240
+ {
241
+ broker.cancel(message.fields.consumerTag);
242
+ broker.publish('execution', 'execute.discard', (0, _messageHelper.cloneContent)(content));
243
+ break;
244
+ }
247
245
 
248
- if (execution = getExecutionById(content.parent.executionId)) {
249
- return execution.getApi(apiMessage);
250
- }
246
+ case 'completed':
247
+ {
248
+ broker.cancel(message.fields.consumerTag);
249
+ broker.publish('execution', 'execute.completed', (0, _messageHelper.cloneContent)(content));
250
+ break;
251
+ }
252
+
253
+ case 'error':
254
+ {
255
+ broker.cancel(message.fields.consumerTag);
256
+ const {
257
+ error
258
+ } = content;
259
+ this.activity.logger.error(`<${this.id}>`, error);
260
+ broker.publish('execution', 'execute.error', (0, _messageHelper.cloneContent)(content));
261
+ break;
262
+ }
263
+ }
264
+ };
251
265
 
252
- const parentPath = content.parent.path;
266
+ proto.getApi = function getApi(apiMessage) {
267
+ const content = apiMessage.content;
268
+ if (content.id === this.id) return;
269
+ let execution;
253
270
 
254
- for (let i = 0; i < parentPath.length; i++) {
255
- if (execution = getExecutionById(parentPath[i].executionId)) return execution.getApi(apiMessage);
256
- }
271
+ if (execution = this._getExecutionById(content.parent.executionId)) {
272
+ return execution.getApi(apiMessage);
257
273
  }
258
274
 
259
- function getExecutionById(executionId) {
260
- return processExecutions.find(pe => pe.executionId === executionId);
275
+ for (const pp of content.parent.path) {
276
+ if (execution = this._getExecutionById(pp.executionId)) return execution.getApi(apiMessage);
261
277
  }
262
- }
278
+ };
279
+
280
+ proto._getExecutionById = function getExecutionById(executionId) {
281
+ return this[executionsSymbol].find(pe => pe.executionId === executionId);
282
+ };
@@ -3,15 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = Task;
7
6
  exports.TaskBehaviour = TaskBehaviour;
7
+ exports.default = Task;
8
8
 
9
9
  var _Activity = _interopRequireDefault(require("../activity/Activity"));
10
10
 
11
+ var _messageHelper = require("../messageHelper");
12
+
11
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
14
 
13
15
  function Task(activityDef, context) {
14
- return (0, _Activity.default)(TaskBehaviour, activityDef, context);
16
+ return new _Activity.default(TaskBehaviour, activityDef, context);
15
17
  }
16
18
 
17
19
  function TaskBehaviour(activity) {
@@ -21,23 +23,19 @@ function TaskBehaviour(activity) {
21
23
  behaviour,
22
24
  broker
23
25
  } = activity;
24
- const loopCharacteristics = behaviour.loopCharacteristics && behaviour.loopCharacteristics.Behaviour(activity, behaviour.loopCharacteristics);
25
- const source = {
26
- id,
27
- type,
28
- loopCharacteristics,
29
- execute
30
- };
31
- return source;
32
-
33
- function execute(executeMessage) {
34
- const content = executeMessage.content;
26
+ this.id = id;
27
+ this.type = type;
28
+ this.loopCharacteristics = behaviour.loopCharacteristics && new behaviour.loopCharacteristics.Behaviour(activity, behaviour.loopCharacteristics);
29
+ this.broker = broker;
30
+ }
35
31
 
36
- if (loopCharacteristics && content.isRootScope) {
37
- return loopCharacteristics.execute(executeMessage);
38
- }
32
+ TaskBehaviour.prototype.execute = function execute(executeMessage) {
33
+ const executeContent = executeMessage.content;
34
+ const loopCharacteristics = this.loopCharacteristics;
39
35
 
40
- return broker.publish('execution', 'execute.completed', { ...content
41
- });
36
+ if (loopCharacteristics && executeContent.isRootScope) {
37
+ return loopCharacteristics.execute(executeMessage);
42
38
  }
43
- }
39
+
40
+ return this.broker.publish('execution', 'execute.completed', (0, _messageHelper.cloneContent)(executeContent));
41
+ };
package/index.js CHANGED
@@ -2,11 +2,14 @@ import Activity from './src/activity/Activity';
2
2
  import Association from './src/flows/Association';
3
3
  import BoundaryEvent from './src/events/BoundaryEvent';
4
4
  import BpmnError from './src/error/BpmnError';
5
+ import CallActivity from './src/tasks/CallActivity';
5
6
  import CancelEventDefinition from './src/eventDefinitions/CancelEventDefinition';
6
7
  import CompensateEventDefinition from './src/eventDefinitions/CompensateEventDefinition';
7
8
  import ConditionalEventDefinition from './src/eventDefinitions/ConditionalEventDefinition';
8
9
  import Context from './src/Context';
9
10
  import DataObject from './src/io/EnvironmentDataObject';
11
+ import DataStore from './src/io/EnvironmentDataStore';
12
+ import DataStoreReference from './src/io/EnvironmentDataStoreReference';
10
13
  import Definition from './src/definition/Definition';
11
14
  import Dummy from './src/activity/Dummy';
12
15
  import EndEvent from './src/events/EndEvent';
@@ -27,6 +30,7 @@ import MessageEventDefinition from './src/eventDefinitions/MessageEventDefinitio
27
30
  import MessageFlow from './src/flows/MessageFlow';
28
31
  import ParallelGateway from './src/gateways/ParallelGateway';
29
32
  import Process from './src/process/Process';
33
+ import Properties from './src/io/Properties';
30
34
  import ReceiveTask from './src/tasks/ReceiveTask';
31
35
  import ScriptTask from './src/tasks/ScriptTask';
32
36
  import SequenceFlow from './src/flows/SequenceFlow';
@@ -48,11 +52,14 @@ export {
48
52
  Activity,
49
53
  BoundaryEvent,
50
54
  BpmnError,
55
+ CallActivity,
51
56
  CancelEventDefinition,
52
57
  CompensateEventDefinition,
53
58
  ConditionalEventDefinition,
54
59
  Context,
55
60
  DataObject,
61
+ DataStore,
62
+ DataStoreReference,
56
63
  Definition,
57
64
  Dummy,
58
65
  Dummy as TextAnnotation,
@@ -76,6 +83,7 @@ export {
76
83
  LoopCharacteristics as MultiInstanceLoopCharacteristics,
77
84
  ParallelGateway,
78
85
  Process,
86
+ Properties,
79
87
  ReceiveTask,
80
88
  ScriptTask,
81
89
  SequenceFlow,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmn-elements",
3
- "version": "5.1.3",
3
+ "version": "7.0.0",
4
4
  "description": "Executable workflow elements based on BPMN 2.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "index.js",
@@ -10,7 +10,8 @@
10
10
  "prepare": "npm run dist",
11
11
  "cov:html": "nyc mocha -R dot && nyc report --reporter=html",
12
12
  "test:lcov": "nyc mocha -R dot && nyc report --reporter lcov && npm run posttest",
13
- "dist": "babel index.js -d dist && rm -rf dist/src && babel src -d dist/src",
13
+ "dist": "babel index.js -d dist && babel src -d dist/src",
14
+ "predist": "node -e \"fs.rmdirSync('./dist/src', {recursive: true});\"",
14
15
  "test-md": "node scripts/test-markdown ./API.md && node scripts/test-markdown ./docs/Examples.md",
15
16
  "toc": "node scripts/generate-api-toc ./API.md,./docs/Examples.md,./docs/Form.md"
16
17
  },
@@ -46,25 +47,25 @@
46
47
  ],
47
48
  "devDependencies": {
48
49
  "@aircall/expression-parser": "^1.0.2",
49
- "@babel/cli": "^7.14.3",
50
- "@babel/core": "^7.13.8",
51
- "@babel/preset-env": "^7.13.8",
52
- "@babel/register": "^7.15.3",
50
+ "@babel/cli": "^7.17.0",
51
+ "@babel/core": "^7.17.0",
52
+ "@babel/preset-env": "^7.16.11",
53
+ "@babel/register": "^7.17.0",
53
54
  "bpmn-moddle": "^7.1.2",
54
- "camunda-bpmn-moddle": "^5.0.0",
55
- "chai": "^4.2.0",
55
+ "camunda-bpmn-moddle": "^6.1.0",
56
+ "chai": "^4.3.6",
56
57
  "chronokinesis": "^3.0.0",
57
- "debug": "^4.3.1",
58
- "eslint": "^7.27.0",
59
- "got": "^11.8.2",
60
- "mocha": "^9.0.2",
58
+ "debug": "^4.3.3",
59
+ "eslint": "^7.32.0",
60
+ "got": "^11.8.3",
61
+ "mocha": "^9.2.0",
61
62
  "mocha-cakes-2": "^3.3.0",
62
- "moddle-context-serializer": "^1.0.0",
63
- "nock": "^13.0.9",
63
+ "moddle-context-serializer": "^2.0.0",
64
+ "nock": "^13.2.4",
64
65
  "nyc": "^15.1.0"
65
66
  },
66
67
  "dependencies": {
67
68
  "iso8601-duration": "^1.3.0",
68
- "smqp": "^5.0.0"
69
+ "smqp": "^6.0.0"
69
70
  }
70
71
  }