bpmn-elements 6.0.0 → 8.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 (116) hide show
  1. package/CHANGELOG.md +335 -0
  2. package/README.md +3 -0
  3. package/dist/index.js +52 -44
  4. package/dist/src/Api.js +77 -76
  5. package/dist/src/Context.js +176 -172
  6. package/dist/src/Environment.js +110 -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/activity/Activity.js +1106 -916
  12. package/dist/src/activity/ActivityExecution.js +342 -297
  13. package/dist/src/activity/Dummy.js +3 -3
  14. package/dist/src/definition/Definition.js +498 -444
  15. package/dist/src/definition/DefinitionExecution.js +710 -408
  16. package/dist/src/error/Errors.js +17 -7
  17. package/dist/src/eventDefinitions/CancelEventDefinition.js +190 -150
  18. package/dist/src/eventDefinitions/CompensateEventDefinition.js +194 -161
  19. package/dist/src/eventDefinitions/ConditionalEventDefinition.js +197 -135
  20. package/dist/src/eventDefinitions/ErrorEventDefinition.js +207 -165
  21. package/dist/src/eventDefinitions/EscalationEventDefinition.js +175 -141
  22. package/dist/src/eventDefinitions/EventDefinitionExecution.js +157 -129
  23. package/dist/src/eventDefinitions/LinkEventDefinition.js +174 -149
  24. package/dist/src/eventDefinitions/MessageEventDefinition.js +213 -176
  25. package/dist/src/eventDefinitions/SignalEventDefinition.js +203 -161
  26. package/dist/src/eventDefinitions/TerminateEventDefinition.js +21 -23
  27. package/dist/src/eventDefinitions/TimerEventDefinition.js +243 -228
  28. package/dist/src/events/BoundaryEvent.js +180 -144
  29. package/dist/src/events/EndEvent.js +18 -23
  30. package/dist/src/events/IntermediateCatchEvent.js +44 -58
  31. package/dist/src/events/IntermediateThrowEvent.js +18 -23
  32. package/dist/src/events/StartEvent.js +109 -94
  33. package/dist/src/flows/Association.js +94 -100
  34. package/dist/src/flows/MessageFlow.js +86 -103
  35. package/dist/src/flows/SequenceFlow.js +173 -182
  36. package/dist/src/gateways/EventBasedGateway.js +88 -84
  37. package/dist/src/gateways/ExclusiveGateway.js +13 -16
  38. package/dist/src/gateways/InclusiveGateway.js +11 -14
  39. package/dist/src/gateways/ParallelGateway.js +11 -14
  40. package/dist/src/getPropertyValue.js +34 -34
  41. package/dist/src/io/BpmnIO.js +17 -14
  42. package/dist/src/io/EnvironmentDataObject.js +33 -29
  43. package/dist/src/io/EnvironmentDataStore.js +33 -29
  44. package/dist/src/io/EnvironmentDataStoreReference.js +35 -31
  45. package/dist/src/io/InputOutputSpecification.js +177 -168
  46. package/dist/src/io/Properties.js +117 -124
  47. package/dist/src/messageHelper.js +1 -1
  48. package/dist/src/process/Process.js +439 -362
  49. package/dist/src/process/ProcessExecution.js +748 -646
  50. package/dist/src/shared.js +2 -2
  51. package/dist/src/tasks/CallActivity.js +160 -0
  52. package/dist/src/tasks/LoopCharacteristics.js +309 -330
  53. package/dist/src/tasks/ReceiveTask.js +233 -182
  54. package/dist/src/tasks/ScriptTask.js +35 -41
  55. package/dist/src/tasks/ServiceImplementation.js +13 -20
  56. package/dist/src/tasks/ServiceTask.js +82 -75
  57. package/dist/src/tasks/SignalTask.js +97 -93
  58. package/dist/src/tasks/StandardLoopCharacteristics.js +1 -1
  59. package/dist/src/tasks/SubProcess.js +193 -175
  60. package/dist/src/tasks/Task.js +17 -19
  61. package/index.js +2 -0
  62. package/package.json +15 -15
  63. package/src/Api.js +65 -59
  64. package/src/Context.js +145 -140
  65. package/src/Environment.js +116 -100
  66. package/src/EventBroker.js +67 -68
  67. package/src/ExtensionsMapper.js +2 -2
  68. package/src/MessageFormatter.js +132 -74
  69. package/src/activity/Activity.js +915 -775
  70. package/src/activity/ActivityExecution.js +293 -247
  71. package/src/activity/Dummy.js +2 -2
  72. package/src/definition/Definition.js +437 -401
  73. package/src/definition/DefinitionExecution.js +598 -340
  74. package/src/error/Errors.js +11 -6
  75. package/src/eventDefinitions/CancelEventDefinition.js +164 -121
  76. package/src/eventDefinitions/CompensateEventDefinition.js +159 -124
  77. package/src/eventDefinitions/ConditionalEventDefinition.js +147 -104
  78. package/src/eventDefinitions/ErrorEventDefinition.js +190 -131
  79. package/src/eventDefinitions/EscalationEventDefinition.js +139 -101
  80. package/src/eventDefinitions/EventDefinitionExecution.js +127 -95
  81. package/src/eventDefinitions/LinkEventDefinition.js +160 -129
  82. package/src/eventDefinitions/MessageEventDefinition.js +178 -121
  83. package/src/eventDefinitions/SignalEventDefinition.js +162 -106
  84. package/src/eventDefinitions/TerminateEventDefinition.js +19 -19
  85. package/src/eventDefinitions/TimerEventDefinition.js +202 -167
  86. package/src/events/BoundaryEvent.js +156 -115
  87. package/src/events/EndEvent.js +15 -18
  88. package/src/events/IntermediateCatchEvent.js +40 -44
  89. package/src/events/IntermediateThrowEvent.js +15 -18
  90. package/src/events/StartEvent.js +84 -50
  91. package/src/flows/Association.js +98 -112
  92. package/src/flows/MessageFlow.js +81 -97
  93. package/src/flows/SequenceFlow.js +146 -160
  94. package/src/gateways/EventBasedGateway.js +75 -68
  95. package/src/gateways/ExclusiveGateway.js +8 -13
  96. package/src/gateways/InclusiveGateway.js +8 -13
  97. package/src/gateways/ParallelGateway.js +8 -13
  98. package/src/getPropertyValue.js +34 -33
  99. package/src/io/BpmnIO.js +20 -15
  100. package/src/io/EnvironmentDataObject.js +29 -18
  101. package/src/io/EnvironmentDataStore.js +29 -18
  102. package/src/io/EnvironmentDataStoreReference.js +31 -20
  103. package/src/io/InputOutputSpecification.js +154 -157
  104. package/src/io/Properties.js +95 -97
  105. package/src/process/Process.js +378 -333
  106. package/src/process/ProcessExecution.js +603 -553
  107. package/src/tasks/CallActivity.js +130 -0
  108. package/src/tasks/LoopCharacteristics.js +290 -289
  109. package/src/tasks/ReceiveTask.js +174 -107
  110. package/src/tasks/ScriptTask.js +27 -30
  111. package/src/tasks/ServiceImplementation.js +13 -18
  112. package/src/tasks/ServiceTask.js +67 -60
  113. package/src/tasks/SignalTask.js +77 -52
  114. package/src/tasks/StandardLoopCharacteristics.js +1 -1
  115. package/src/tasks/SubProcess.js +184 -157
  116. 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 kExecutions = Symbol.for('executions');
18
+ const kMessageHandlers = 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,229 @@ 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[kExecutions] = [];
66
+ this[kMessageHandlers] = {
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[kExecutions][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[kExecutions].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[kMessageHandlers].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[kExecutions]) {
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[kExecutions]) {
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[kExecutions].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[kExecutions];
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[kExecutions].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
+ const subContext = this.context.clone(subEnvironment);
209
+ execution = new _ProcessExecution.default(this.activity, subContext);
210
+ this[kExecutions].push(execution);
211
+
212
+ this._addListeners(execution, executionId);
213
+
214
+ return execution;
215
+ };
202
216
 
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
- }
217
+ proto._addListeners = function addListeners(processExecution, executionId) {
218
+ this.broker.subscribeTmp('subprocess-execution', `execution.#.${executionId}`, this[kMessageHandlers].onExecutionCompleted, {
219
+ noAck: true,
220
+ consumerTag: `_sub-process-execution-${executionId}`
221
+ });
222
+ };
223
+
224
+ proto._onExecutionCompleted = function onExecutionCompleted(_, message) {
225
+ if (message.fields.redelivered && message.properties.persistent === false) return;
226
+ const content = message.content;
227
+ const messageType = message.properties.type;
228
+ const broker = this.broker;
229
+
230
+ switch (messageType) {
231
+ case 'stopped':
232
+ {
233
+ broker.cancel(message.fields.consumerTag);
234
+ break;
239
235
  }
240
- }
241
- }
242
236
 
243
- function getApi(apiMessage) {
244
- const content = apiMessage.content;
245
- if (content.id === id) return;
246
- let execution;
237
+ case 'discard':
238
+ {
239
+ broker.cancel(message.fields.consumerTag);
240
+ broker.publish('execution', 'execute.discard', (0, _messageHelper.cloneContent)(content));
241
+ break;
242
+ }
247
243
 
248
- if (execution = getExecutionById(content.parent.executionId)) {
249
- return execution.getApi(apiMessage);
250
- }
244
+ case 'completed':
245
+ {
246
+ broker.cancel(message.fields.consumerTag);
247
+ broker.publish('execution', 'execute.completed', (0, _messageHelper.cloneContent)(content));
248
+ break;
249
+ }
250
+
251
+ case 'error':
252
+ {
253
+ broker.cancel(message.fields.consumerTag);
254
+ const {
255
+ error
256
+ } = content;
257
+ this.activity.logger.error(`<${this.id}>`, error);
258
+ broker.publish('execution', 'execute.error', (0, _messageHelper.cloneContent)(content));
259
+ break;
260
+ }
261
+ }
262
+ };
251
263
 
252
- const parentPath = content.parent.path;
264
+ proto.getApi = function getApi(apiMessage) {
265
+ const content = apiMessage.content;
266
+ if (content.id === this.id) return;
267
+ let execution;
253
268
 
254
- for (let i = 0; i < parentPath.length; i++) {
255
- if (execution = getExecutionById(parentPath[i].executionId)) return execution.getApi(apiMessage);
256
- }
269
+ if (execution = this._getExecutionById(content.parent.executionId)) {
270
+ return execution.getApi(apiMessage);
257
271
  }
258
272
 
259
- function getExecutionById(executionId) {
260
- return processExecutions.find(pe => pe.executionId === executionId);
273
+ for (const pp of content.parent.path) {
274
+ if (execution = this._getExecutionById(pp.executionId)) return execution.getApi(apiMessage);
261
275
  }
262
- }
276
+ };
277
+
278
+ proto._getExecutionById = function getExecutionById(executionId) {
279
+ return this[kExecutions].find(pe => pe.executionId === executionId);
280
+ };
@@ -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,6 +2,7 @@ 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';
@@ -51,6 +52,7 @@ export {
51
52
  Activity,
52
53
  BoundaryEvent,
53
54
  BpmnError,
55
+ CallActivity,
54
56
  CancelEventDefinition,
55
57
  CompensateEventDefinition,
56
58
  ConditionalEventDefinition,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmn-elements",
3
- "version": "6.0.0",
3
+ "version": "8.0.0",
4
4
  "description": "Executable workflow elements based on BPMN 2.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "index.js",
@@ -46,26 +46,26 @@
46
46
  "index.js"
47
47
  ],
48
48
  "devDependencies": {
49
- "@aircall/expression-parser": "^1.0.2",
50
- "@babel/cli": "^7.15.7",
51
- "@babel/core": "^7.13.8",
52
- "@babel/preset-env": "^7.13.8",
53
- "@babel/register": "^7.15.3",
49
+ "@aircall/expression-parser": "^1.0.4",
50
+ "@babel/cli": "^7.17.6",
51
+ "@babel/core": "^7.17.8",
52
+ "@babel/preset-env": "^7.16.11",
53
+ "@babel/register": "^7.17.7",
54
54
  "bpmn-moddle": "^7.1.2",
55
- "camunda-bpmn-moddle": "^6.1.0",
56
- "chai": "^4.2.0",
55
+ "camunda-bpmn-moddle": "^6.1.2",
56
+ "chai": "^4.3.6",
57
57
  "chronokinesis": "^3.0.0",
58
- "debug": "^4.3.1",
59
- "eslint": "^7.27.0",
60
- "got": "^11.8.2",
61
- "mocha": "^9.1.0",
58
+ "debug": "^4.3.4",
59
+ "eslint": "^7.32.0",
60
+ "got": "^11.8.3",
61
+ "mocha": "^9.2.2",
62
62
  "mocha-cakes-2": "^3.3.0",
63
- "moddle-context-serializer": "^1.1.1",
64
- "nock": "^13.1.2",
63
+ "moddle-context-serializer": "^2.1.0",
64
+ "nock": "^13.2.4",
65
65
  "nyc": "^15.1.0"
66
66
  },
67
67
  "dependencies": {
68
68
  "iso8601-duration": "^1.3.0",
69
- "smqp": "^5.1.0"
69
+ "smqp": "^6.0.0"
70
70
  }
71
71
  }