bpmn-elements 14.0.1 → 15.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 (55) hide show
  1. package/README.md +0 -4
  2. package/dist/Context.js +41 -35
  3. package/dist/Environment.js +1 -1
  4. package/dist/Expressions.js +1 -1
  5. package/dist/MessageFormatter.js +0 -1
  6. package/dist/Timers.js +5 -9
  7. package/dist/Tracker.js +15 -19
  8. package/dist/activity/Activity.js +17 -11
  9. package/dist/activity/ActivityExecution.js +43 -29
  10. package/dist/definition/Definition.js +1 -1
  11. package/dist/definition/DefinitionExecution.js +64 -55
  12. package/dist/eventDefinitions/EscalationEventDefinition.js +1 -1
  13. package/dist/eventDefinitions/LinkEventDefinition.js +1 -1
  14. package/dist/eventDefinitions/MessageEventDefinition.js +1 -1
  15. package/dist/eventDefinitions/SignalEventDefinition.js +3 -2
  16. package/dist/events/BoundaryEvent.js +11 -9
  17. package/dist/events/EndEvent.js +1 -1
  18. package/dist/events/IntermediateCatchEvent.js +1 -1
  19. package/dist/events/IntermediateThrowEvent.js +1 -1
  20. package/dist/events/StartEvent.js +1 -1
  21. package/dist/flows/SequenceFlow.js +1 -1
  22. package/dist/gateways/EventBasedGateway.js +1 -1
  23. package/dist/gateways/ExclusiveGateway.js +1 -1
  24. package/dist/gateways/InclusiveGateway.js +1 -1
  25. package/dist/gateways/ParallelGateway.js +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/io/InputOutputSpecification.js +1 -1
  28. package/dist/io/Properties.js +1 -1
  29. package/dist/process/Process.js +1 -1
  30. package/dist/process/ProcessExecution.js +67 -40
  31. package/dist/tasks/CallActivity.js +1 -1
  32. package/dist/tasks/LoopCharacteristics.js +2 -2
  33. package/dist/tasks/ReceiveTask.js +1 -1
  34. package/dist/tasks/ScriptTask.js +1 -1
  35. package/dist/tasks/ServiceImplementation.js +1 -1
  36. package/dist/tasks/ServiceTask.js +1 -1
  37. package/dist/tasks/SignalTask.js +1 -1
  38. package/dist/tasks/StandardLoopCharacteristics.js +1 -1
  39. package/dist/tasks/SubProcess.js +27 -28
  40. package/dist/tasks/Task.js +1 -1
  41. package/dist/tasks/Transaction.js +1 -1
  42. package/package.json +5 -3
  43. package/src/Context.js +51 -35
  44. package/src/MessageFormatter.js +0 -3
  45. package/src/Timers.js +5 -9
  46. package/src/Tracker.js +13 -17
  47. package/src/activity/Activity.js +5 -3
  48. package/src/activity/ActivityExecution.js +43 -26
  49. package/src/definition/DefinitionExecution.js +64 -54
  50. package/src/eventDefinitions/SignalEventDefinition.js +1 -1
  51. package/src/events/BoundaryEvent.js +10 -8
  52. package/src/process/ProcessExecution.js +70 -40
  53. package/src/tasks/LoopCharacteristics.js +2 -2
  54. package/src/tasks/SubProcess.js +27 -27
  55. package/types/types.d.ts +1 -1
@@ -8,7 +8,7 @@ var _getPropertyValue = _interopRequireDefault(require("../getPropertyValue.js")
8
8
  var _Api = require("../Api.js");
9
9
  var _shared = require("../shared.js");
10
10
  var _messageHelper = require("../messageHelper.js");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  const kActivated = Symbol.for('activated');
13
13
  const kProcessesQ = Symbol.for('processesQ');
14
14
  const kCompleted = Symbol.for('completed');
@@ -27,20 +27,20 @@ function DefinitionExecution(definition, context) {
27
27
  const environment = this.environment = definition.environment;
28
28
  this.context = context;
29
29
  const processes = context.getProcesses();
30
- const ids = [];
31
- const executable = [];
30
+ const ids = new Set();
31
+ const executable = new Set();
32
32
  for (const bp of processes) {
33
33
  bp.environment.assignVariables(environment.variables);
34
34
  bp.environment.assignSettings(environment.settings);
35
- ids.push(bp.id);
36
- if (bp.isExecutable) executable.push(bp);
35
+ ids.add(bp.id);
36
+ if (bp.isExecutable) executable.add(bp);
37
37
  }
38
38
  this[kProcesses] = {
39
39
  processes,
40
- running: [],
41
40
  ids,
42
41
  executable,
43
- postponed: []
42
+ running: new Set(),
43
+ postponed: new Set()
44
44
  };
45
45
  broker.assertExchange('execution', 'topic', {
46
46
  autoDelete: false,
@@ -80,12 +80,12 @@ Object.defineProperties(DefinitionExecution.prototype, {
80
80
  },
81
81
  processes: {
82
82
  get() {
83
- return this[kProcesses].running;
83
+ return [...this[kProcesses].running];
84
84
  }
85
85
  },
86
86
  postponedCount: {
87
87
  get() {
88
- return this[kProcesses].postponed.length;
88
+ return this[kProcesses].postponed.size;
89
89
  }
90
90
  },
91
91
  isRunning: {
@@ -97,7 +97,7 @@ Object.defineProperties(DefinitionExecution.prototype, {
97
97
  get() {
98
98
  let status = 'idle';
99
99
  const running = this[kProcesses].running;
100
- if (!running || !running.length) return status;
100
+ if (!running.size) return status;
101
101
  for (const bp of running) {
102
102
  const bpStatus = bp.activityStatus;
103
103
  switch (bp.activityStatus) {
@@ -141,12 +141,14 @@ DefinitionExecution.prototype.execute = function execute(executeMessage) {
141
141
  if (content.processId) {
142
142
  const startWithProcess = this.getProcessById(content.processId);
143
143
  if (startWithProcess) {
144
- executable.splice(0);
145
- executable.push(startWithProcess);
144
+ executable.clear();
145
+ executable.add(startWithProcess);
146
146
  }
147
147
  }
148
148
  this._debug('execute definition');
149
- running.push(...executable);
149
+ for (const bp of executable) {
150
+ running.add(bp);
151
+ }
150
152
  this._activate(executable);
151
153
  this._start();
152
154
  return true;
@@ -159,7 +161,7 @@ DefinitionExecution.prototype.resume = function resume() {
159
161
  postponed
160
162
  } = this[kProcesses];
161
163
  this._activate(running);
162
- postponed.splice(0);
164
+ postponed.clear();
163
165
  this[kProcessesQ].consume(this[kMessageHandlers].onProcessMessage, {
164
166
  prefetch: 1000,
165
167
  consumerTag: `_definition-activity-${this.executionId}`
@@ -175,20 +177,20 @@ DefinitionExecution.prototype.recover = function recover(state) {
175
177
  this[kStatus] = state.status;
176
178
  this._debug(`recover ${this[kStatus]} definition execution`);
177
179
  const running = this[kProcesses].running;
178
- running.splice(0);
179
- const ids = [];
180
+ running.clear();
181
+ const ids = new Set();
180
182
  for (const bpState of state.processes) {
181
183
  const bpid = bpState.id;
182
184
  let bp;
183
- if (ids.indexOf(bpid) > -1) {
185
+ if (ids.has(bpid)) {
184
186
  bp = this.context.getNewProcessById(bpid);
185
187
  } else {
186
188
  bp = this.getProcessById(bpid);
187
189
  }
188
190
  if (!bp) continue;
189
- ids.push(bpid);
191
+ ids.add(bpid);
190
192
  bp.recover(bpState);
191
- running.push(bp);
193
+ running.add(bp);
192
194
  }
193
195
  return this;
194
196
  };
@@ -200,7 +202,7 @@ DefinitionExecution.prototype.getProcesses = function getProcesses() {
200
202
  running,
201
203
  processes
202
204
  } = this[kProcesses];
203
- const result = running.slice();
205
+ const result = [...running];
204
206
  for (const bp of processes) {
205
207
  if (!result.find(runningBp => bp.id === runningBp.id)) result.push(bp);
206
208
  }
@@ -213,23 +215,27 @@ DefinitionExecution.prototype.getProcessesById = function getProcessesById(proce
213
215
  return this.getProcesses().filter(bp => bp.id === processId);
214
216
  };
215
217
  DefinitionExecution.prototype.getProcessByExecutionId = function getProcessByExecutionId(processExecutionId) {
216
- const running = this[kProcesses].running;
217
- return running.find(bp => bp.executionId === processExecutionId);
218
+ for (const bp of this[kProcesses].running) {
219
+ if (bp.executionId === processExecutionId) return bp;
220
+ }
218
221
  };
219
222
  DefinitionExecution.prototype.getRunningProcesses = function getRunningProcesses() {
220
- const running = this[kProcesses].running;
221
- return running.filter(bp => bp.executionId);
223
+ return [...this[kProcesses].running].filter(bp => bp.executionId);
222
224
  };
223
225
  DefinitionExecution.prototype.getExecutableProcesses = function getExecutableProcesses() {
224
- return this[kProcesses].executable.slice();
226
+ return [...this[kProcesses].executable];
225
227
  };
226
228
  DefinitionExecution.prototype.getState = function getState() {
229
+ const processes = [];
230
+ for (const bp of this[kProcesses].running) {
231
+ processes.push(bp.getState());
232
+ }
227
233
  return {
228
234
  executionId: this.executionId,
229
235
  stopped: this[kStopped],
230
236
  completed: this[kCompleted],
231
237
  status: this[kStatus],
232
- processes: this[kProcesses].running.map(bp => bp.getState())
238
+ processes
233
239
  };
234
240
  };
235
241
  DefinitionExecution.prototype.getApi = function getApi(apiMessage) {
@@ -244,20 +250,21 @@ DefinitionExecution.prototype.getApi = function getApi(apiMessage) {
244
250
  const postponed = this[kProcesses].postponed;
245
251
  const self = this;
246
252
  api.getExecuting = function getExecuting() {
247
- return postponed.reduce((result, msg) => {
253
+ const apis = [];
254
+ for (const msg of postponed) {
248
255
  const bpApi = self._getProcessApi(msg);
249
- if (bpApi) result.push(bpApi);
250
- return result;
251
- }, []);
256
+ if (bpApi) apis.push(bpApi);
257
+ }
258
+ return apis;
252
259
  };
253
260
  return api;
254
261
  };
255
262
  DefinitionExecution.prototype.getPostponed = function getPostponed(...args) {
256
- const running = this[kProcesses].running;
257
- return running.reduce((result, p) => {
258
- result = result.concat(p.getPostponed(...args));
259
- return result;
260
- }, []);
263
+ let result = [];
264
+ for (const bp of this[kProcesses].running) {
265
+ result = result.concat(bp.getPostponed(...args));
266
+ }
267
+ return result;
261
268
  };
262
269
  DefinitionExecution.prototype._start = function start() {
263
270
  const {
@@ -265,10 +272,10 @@ DefinitionExecution.prototype._start = function start() {
265
272
  executable,
266
273
  postponed
267
274
  } = this[kProcesses];
268
- if (!ids.length) {
275
+ if (!ids.size) {
269
276
  return this._complete('completed');
270
277
  }
271
- if (!executable.length) {
278
+ if (!executable.size) {
272
279
  return this._complete('error', {
273
280
  error: new Error('No executable process')
274
281
  });
@@ -276,7 +283,7 @@ DefinitionExecution.prototype._start = function start() {
276
283
  this[kStatus] = 'start';
277
284
  for (const bp of executable) bp.init();
278
285
  for (const bp of executable) bp.run();
279
- postponed.splice(0);
286
+ postponed.clear();
280
287
  this[kProcessesQ].assertConsumer(this[kMessageHandlers].onProcessMessage, {
281
288
  prefetch: 1000,
282
289
  consumerTag: `_definition-activity-${this.executionId}`
@@ -331,7 +338,7 @@ DefinitionExecution.prototype._onChildEvent = function onChildEvent(routingKey,
331
338
  const message = (0, _messageHelper.cloneMessage)(originalMessage);
332
339
  const content = message.content;
333
340
  const parent = content.parent = content.parent || {};
334
- const isDirectChild = this[kProcesses].ids.indexOf(content.id) > -1;
341
+ const isDirectChild = this[kProcesses].ids.has(content.id);
335
342
  if (isDirectChild) {
336
343
  parent.executionId = this.executionId;
337
344
  } else {
@@ -424,7 +431,7 @@ DefinitionExecution.prototype._onProcessMessage = function onProcessMessage(rout
424
431
  type: 'error'
425
432
  });
426
433
  } else {
427
- for (const bp of this[kProcesses].running.slice()) {
434
+ for (const bp of new Set(this[kProcesses].running)) {
428
435
  if (bp.id !== childId) bp.stop();
429
436
  }
430
437
  Object.assign(this.environment.output, content.output);
@@ -439,12 +446,15 @@ DefinitionExecution.prototype._onProcessMessage = function onProcessMessage(rout
439
446
  DefinitionExecution.prototype._stateChangeMessage = function stateChangeMessage(message, postponeMessage) {
440
447
  let previousMsg;
441
448
  const postponed = this[kProcesses].postponed;
442
- const idx = postponed.findIndex(msg => msg.content.executionId === message.content.executionId);
443
- if (idx > -1) {
444
- previousMsg = postponed.splice(idx, 1)[0];
449
+ for (const msg of postponed) {
450
+ if (msg.content.executionId === message.content.executionId) {
451
+ previousMsg = msg;
452
+ postponed.delete(msg);
453
+ break;
454
+ }
445
455
  }
446
456
  if (previousMsg) previousMsg.ack();
447
- if (postponeMessage) postponed.push(message);
457
+ if (postponeMessage) postponed.add(message);
448
458
  };
449
459
  DefinitionExecution.prototype._onProcessCompleted = function onProcessCompleted(message) {
450
460
  this._stateChangeMessage(message, false);
@@ -467,9 +477,9 @@ DefinitionExecution.prototype._onProcessCompleted = function onProcessCompleted(
467
477
  };
468
478
  DefinitionExecution.prototype._onStopped = function onStopped(message) {
469
479
  const running = this[kProcesses].running;
470
- this._debug(`stop definition execution (stop process executions ${running.length})`);
480
+ this._debug(`stop definition execution (stop process executions ${running.size})`);
471
481
  this[kProcessesQ].close();
472
- for (const bp of running.slice()) bp.stop();
482
+ for (const bp of new Set(running)) bp.stop();
473
483
  this._deactivate();
474
484
  this[kStopped] = true;
475
485
  return this.broker.publish('execution', `execution.stopped.${this.executionId}`, (0, _messageHelper.cloneContent)(this[kExecuteMessage].content, {
@@ -490,7 +500,7 @@ DefinitionExecution.prototype._onApiMessage = function onApiMessage(routingKey,
490
500
  });
491
501
  }
492
502
  if (delegate) {
493
- for (const bp of this[kProcesses].running.slice()) {
503
+ for (const bp of new Set(this[kProcesses].running)) {
494
504
  bp.broker.publish('api', routingKey, (0, _messageHelper.cloneContent)(message.content), message.properties);
495
505
  }
496
506
  }
@@ -515,7 +525,7 @@ DefinitionExecution.prototype._startProcessesByMessage = function startProcesses
515
525
  if (!bp.executionId) {
516
526
  this._debug(`start <${bp.id}> by <${reference.referenceId}> (${reference.referenceType})`);
517
527
  this._activateProcess(bp);
518
- running.push(bp);
528
+ running.add(bp);
519
529
  bp.init();
520
530
  bp.run();
521
531
  if (reference.referenceType === 'message') return;
@@ -524,7 +534,7 @@ DefinitionExecution.prototype._startProcessesByMessage = function startProcesses
524
534
  this._debug(`start new <${bp.id}> by <${reference.referenceId}> (${reference.referenceType})`);
525
535
  const targetProcess = this.context.getNewProcessById(bp.id);
526
536
  this._activateProcess(targetProcess);
527
- running.push(targetProcess);
537
+ running.add(targetProcess);
528
538
  targetProcess.init();
529
539
  targetProcess.run();
530
540
  if (reference.referenceType === 'message') return;
@@ -551,7 +561,7 @@ DefinitionExecution.prototype._onMessageOutbound = function onMessageOutbound(ro
551
561
  if (found) return;
552
562
  targetProcess = targetProcess || this.context.getNewProcessById(target.processId);
553
563
  this._activateProcess(targetProcess);
554
- this[kProcesses].running.push(targetProcess);
564
+ this[kProcesses].running.add(targetProcess);
555
565
  targetProcess.init();
556
566
  targetProcess.run();
557
567
  targetProcess.sendMessage(message);
@@ -583,7 +593,7 @@ DefinitionExecution.prototype._onCallActivity = function onCallActivity(routingK
583
593
  if (!targetProcess) return;
584
594
  this._debug(`call from <${fromParent.id}.${fromId}> to <${calledElement}>`);
585
595
  this._activateProcess(targetProcess);
586
- this[kProcesses].running.push(targetProcess);
596
+ this[kProcesses].running.add(targetProcess);
587
597
  targetProcess.init(bpExecutionId);
588
598
  targetProcess.run({
589
599
  inbound: [(0, _messageHelper.cloneContent)(content)]
@@ -639,10 +649,9 @@ DefinitionExecution.prototype._onDelegateMessage = function onDelegateMessage(ro
639
649
  });
640
650
  };
641
651
  DefinitionExecution.prototype._removeProcessByExecutionId = function removeProcessByExecutionId(processExecutionId) {
642
- const running = this[kProcesses].running;
643
- const idx = running.findIndex(p => p.executionId === processExecutionId);
644
- if (idx === -1) return;
645
- return running.splice(idx, 1)[0];
652
+ const bp = this.getProcessByExecutionId(processExecutionId);
653
+ if (bp) this[kProcesses].running.delete(bp);
654
+ return bp;
646
655
  };
647
656
  DefinitionExecution.prototype._complete = function complete(completionType, content, options) {
648
657
  this._deactivate();
@@ -7,7 +7,7 @@ exports.default = EscalationEventDefinition;
7
7
  var _getPropertyValue = _interopRequireDefault(require("../getPropertyValue.js"));
8
8
  var _shared = require("../shared.js");
9
9
  var _messageHelper = require("../messageHelper.js");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const kCompleted = Symbol.for('completed');
12
12
  const kMessageQ = Symbol.for('messageQ');
13
13
  const kExecuteMessage = Symbol.for('executeMessage');
@@ -7,7 +7,7 @@ exports.default = LinkEventDefinition;
7
7
  var _getPropertyValue = _interopRequireDefault(require("../getPropertyValue.js"));
8
8
  var _shared = require("../shared.js");
9
9
  var _messageHelper = require("../messageHelper.js");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const kCompleted = Symbol.for('completed');
12
12
  const kMessageQ = Symbol.for('messageQ');
13
13
  const kExecuteMessage = Symbol.for('executeMessage');
@@ -7,7 +7,7 @@ exports.default = MessageEventDefinition;
7
7
  var _getPropertyValue = _interopRequireDefault(require("../getPropertyValue.js"));
8
8
  var _shared = require("../shared.js");
9
9
  var _messageHelper = require("../messageHelper.js");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const kCompleted = Symbol.for('completed');
12
12
  const kMessageQ = Symbol.for('messageQ');
13
13
  const kExecuteMessage = Symbol.for('executeMessage');
@@ -7,7 +7,7 @@ exports.default = SignalEventDefinition;
7
7
  var _getPropertyValue = _interopRequireDefault(require("../getPropertyValue.js"));
8
8
  var _shared = require("../shared.js");
9
9
  var _messageHelper = require("../messageHelper.js");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const kCompleted = Symbol.for('completed');
12
12
  const kMessageQ = Symbol.for('messageQ');
13
13
  const kExecuteMessage = Symbol.for('executeMessage');
@@ -120,7 +120,8 @@ SignalEventDefinition.prototype.executeThrow = function executeThrow(executeMess
120
120
  throwContent.parent = (0, _messageHelper.shiftParent)(parent);
121
121
  const broker = this.broker;
122
122
  broker.publish('event', 'activity.signal', throwContent, {
123
- type: 'signal'
123
+ type: 'signal',
124
+ delegate: true
124
125
  });
125
126
  return broker.publish('execution', 'execute.completed', (0, _messageHelper.cloneContent)(executeContent));
126
127
  };
@@ -9,7 +9,7 @@ var _Activity = _interopRequireDefault(require("../activity/Activity.js"));
9
9
  var _EventDefinitionExecution = _interopRequireDefault(require("../eventDefinitions/EventDefinitionExecution.js"));
10
10
  var _messageHelper = require("../messageHelper.js");
11
11
  var _shared = require("../shared.js");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
13
  const kAttachedTags = Symbol.for('attachedConsumers');
14
14
  const kCompleteContent = Symbol.for('completeContent');
15
15
  const kExecuteMessage = Symbol.for('executeMessage');
@@ -26,8 +26,8 @@ function BoundaryEventBehaviour(activity) {
26
26
  this.environment = activity.environment;
27
27
  this.broker = activity.broker;
28
28
  this[kExecution] = activity.eventDefinitions && new _EventDefinitionExecution.default(activity, activity.eventDefinitions, 'execute.bound.completed');
29
- this[kShovels] = [];
30
- this[kAttachedTags] = [];
29
+ this[kShovels] = new Set();
30
+ this[kAttachedTags] = new Set();
31
31
  }
32
32
  Object.defineProperties(BoundaryEventBehaviour.prototype, {
33
33
  executionId: {
@@ -62,7 +62,7 @@ BoundaryEventBehaviour.prototype.execute = function execute(executeMessage) {
62
62
  consumerTag,
63
63
  priority: 300
64
64
  });
65
- this[kAttachedTags].push(consumerTag);
65
+ this[kAttachedTags].add(consumerTag);
66
66
  broker.subscribeOnce('api', `activity.#.${executionId}`, this._onApiMessage.bind(this), {
67
67
  consumerTag: `_api-${executionId}`
68
68
  });
@@ -117,7 +117,7 @@ BoundaryEventBehaviour.prototype._onCompleted = function onCompleted(_, {
117
117
  this.activity.logger.debug(`<${executionId} (${this.id})> cancel ${attachedTo.status} activity <${attachedToContent.executionId} (${attachedToContent.id})>`);
118
118
  if (content.isRecovered && !attachedTo.isRunning) {
119
119
  const attachedExecuteTag = `_on-attached-execute-${executionId}`;
120
- this[kAttachedTags].push(attachedExecuteTag);
120
+ this[kAttachedTags].add(attachedExecuteTag);
121
121
  attachedTo.broker.subscribeOnce('execution', '#', () => {
122
122
  attachedTo.getApi({
123
123
  content: attachedToContent
@@ -151,7 +151,7 @@ BoundaryEventBehaviour.prototype._onExpectMessage = function onExpectMessage(_,
151
151
  } = content;
152
152
  const attachedTo = this.attachedTo;
153
153
  const errorConsumerTag = `_bound-error-listener-${executionId}`;
154
- this[kAttachedTags].push(errorConsumerTag);
154
+ this[kAttachedTags].add(errorConsumerTag);
155
155
  attachedTo.broker.subscribeTmp('event', pattern, (__, message) => {
156
156
  if (message.content.id !== attachedTo.id) return;
157
157
  this.broker.publish(exchange, expectRoutingKey, (0, _messageHelper.cloneContent)(message.content, {
@@ -183,7 +183,7 @@ BoundaryEventBehaviour.prototype._onDetachMessage = function onDetachMessage(_,
183
183
  sourcePattern
184
184
  } = content;
185
185
  const shovelName = `_detached-${(0, _shared.brokerSafeId)(id)}_${detachId}`;
186
- this[kShovels].push(shovelName);
186
+ this[kShovels].add(shovelName);
187
187
  const broker = this.broker;
188
188
  attachedTo.broker.createShovel(shovelName, {
189
189
  exchange: sourceExchange,
@@ -231,8 +231,10 @@ BoundaryEventBehaviour.prototype._stop = function stop(detach) {
231
231
  const attachedTo = this.attachedTo,
232
232
  broker = this.broker,
233
233
  executionId = this.executionId;
234
- for (const tag of this[kAttachedTags].splice(0)) attachedTo.broker.cancel(tag);
235
- for (const shovelName of this[kShovels].splice(0)) attachedTo.broker.closeShovel(shovelName);
234
+ for (const tag of this[kAttachedTags]) attachedTo.broker.cancel(tag);
235
+ this[kAttachedTags].clear();
236
+ for (const shovelName of this[kShovels]) attachedTo.broker.closeShovel(shovelName);
237
+ this[kShovels].clear();
236
238
  broker.cancel('_execution-tag');
237
239
  broker.cancel(`_execution-completed-${executionId}`);
238
240
  if (detach) return;
@@ -8,7 +8,7 @@ exports.default = EndEvent;
8
8
  var _Activity = _interopRequireDefault(require("../activity/Activity.js"));
9
9
  var _EventDefinitionExecution = _interopRequireDefault(require("../eventDefinitions/EventDefinitionExecution.js"));
10
10
  var _messageHelper = require("../messageHelper.js");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  const kExecution = Symbol.for('execution');
13
13
  function EndEvent(activityDef, context) {
14
14
  return new _Activity.default(EndEventBehaviour, {
@@ -8,7 +8,7 @@ exports.default = IntermediateCatchEvent;
8
8
  var _Activity = _interopRequireDefault(require("../activity/Activity.js"));
9
9
  var _EventDefinitionExecution = _interopRequireDefault(require("../eventDefinitions/EventDefinitionExecution.js"));
10
10
  var _messageHelper = require("../messageHelper.js");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  const kExecution = Symbol.for('execution');
13
13
  function IntermediateCatchEvent(activityDef, context) {
14
14
  return new _Activity.default(IntermediateCatchEventBehaviour, activityDef, context);
@@ -8,7 +8,7 @@ exports.default = IntermediateThrowEvent;
8
8
  var _Activity = _interopRequireDefault(require("../activity/Activity.js"));
9
9
  var _EventDefinitionExecution = _interopRequireDefault(require("../eventDefinitions/EventDefinitionExecution.js"));
10
10
  var _messageHelper = require("../messageHelper.js");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  const kExecution = Symbol.for('execution');
13
13
  function IntermediateThrowEvent(activityDef, context) {
14
14
  return new _Activity.default(IntermediateThrowEventBehaviour, {
@@ -8,7 +8,7 @@ exports.default = StartEvent;
8
8
  var _Activity = _interopRequireDefault(require("../activity/Activity.js"));
9
9
  var _EventDefinitionExecution = _interopRequireDefault(require("../eventDefinitions/EventDefinitionExecution.js"));
10
10
  var _messageHelper = require("../messageHelper.js");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  const kExecuteMessage = Symbol.for('executeMessage');
13
13
  const kExecution = Symbol.for('execution');
14
14
  function StartEvent(activityDef, context) {
@@ -9,7 +9,7 @@ var _messageHelper = require("../messageHelper.js");
9
9
  var _shared = require("../shared.js");
10
10
  var _EventBroker = require("../EventBroker.js");
11
11
  var _Api = require("../Api.js");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
13
  const kCounters = Symbol.for('counters');
14
14
  var _default = exports.default = SequenceFlow;
15
15
  function SequenceFlow(flowDef, {
@@ -7,7 +7,7 @@ exports.EventBasedGatewayBehaviour = EventBasedGatewayBehaviour;
7
7
  exports.default = EventBasedGateway;
8
8
  var _Activity = _interopRequireDefault(require("../activity/Activity.js"));
9
9
  var _messageHelper = require("../messageHelper.js");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const kCompleted = Symbol.for('completed');
12
12
  const kTargets = Symbol.for('targets');
13
13
  function EventBasedGateway(activityDef, context) {
@@ -7,7 +7,7 @@ exports.ExclusiveGatewayBehaviour = ExclusiveGatewayBehaviour;
7
7
  exports.default = ExclusiveGateway;
8
8
  var _Activity = _interopRequireDefault(require("../activity/Activity.js"));
9
9
  var _messageHelper = require("../messageHelper.js");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  function ExclusiveGateway(activityDef, context) {
12
12
  return new _Activity.default(ExclusiveGatewayBehaviour, activityDef, context);
13
13
  }
@@ -7,7 +7,7 @@ exports.InclusiveGatewayBehaviour = InclusiveGatewayBehaviour;
7
7
  exports.default = InclusiveGateway;
8
8
  var _Activity = _interopRequireDefault(require("../activity/Activity.js"));
9
9
  var _messageHelper = require("../messageHelper.js");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  function InclusiveGateway(activityDef, context) {
12
12
  return new _Activity.default(InclusiveGatewayBehaviour, activityDef, context);
13
13
  }
@@ -7,7 +7,7 @@ exports.ParallelGatewayBehaviour = ParallelGatewayBehaviour;
7
7
  exports.default = ParallelGateway;
8
8
  var _Activity = _interopRequireDefault(require("../activity/Activity.js"));
9
9
  var _messageHelper = require("../messageHelper.js");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  function ParallelGateway(activityDef, context) {
12
12
  return new _Activity.default(ParallelGatewayBehaviour, {
13
13
  ...activityDef,
package/dist/index.js CHANGED
@@ -408,4 +408,4 @@ var _TimerEventDefinition = _interopRequireDefault(require("./eventDefinitions/T
408
408
  var _Transaction = _interopRequireDefault(require("./tasks/Transaction.js"));
409
409
  var _Timers = require("./Timers.js");
410
410
  var _Errors = require("./error/Errors.js");
411
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
411
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = IoSpecification;
7
7
  var _getPropertyValue = _interopRequireDefault(require("../getPropertyValue.js"));
8
8
  var _shared = require("../shared.js");
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
10
  const kConsuming = Symbol.for('consuming');
11
11
  function IoSpecification(activity, ioSpecificationDef, context) {
12
12
  const {
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = Properties;
7
7
  var _getPropertyValue = _interopRequireDefault(require("../getPropertyValue.js"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
9
  const kProperties = Symbol.for('properties');
10
10
  const kConsuming = Symbol.for('consuming');
11
11
  function Properties(activity, propertiesDef, context) {
@@ -11,7 +11,7 @@ var _Api = require("../Api.js");
11
11
  var _EventBroker = require("../EventBroker.js");
12
12
  var _messageHelper = require("../messageHelper.js");
13
13
  var _Errors = require("../error/Errors.js");
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
15
  const kConsuming = Symbol.for('consuming');
16
16
  const kCounters = Symbol.for('counters');
17
17
  const kExec = Symbol.for('execution');