bpmn-elements 7.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 (68) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/src/Context.js +50 -40
  3. package/dist/src/Environment.js +39 -19
  4. package/dist/src/MessageFormatter.js +11 -11
  5. package/dist/src/activity/Activity.js +91 -91
  6. package/dist/src/activity/ActivityExecution.js +35 -35
  7. package/dist/src/definition/Definition.js +50 -50
  8. package/dist/src/definition/DefinitionExecution.js +114 -125
  9. package/dist/src/eventDefinitions/CancelEventDefinition.js +16 -16
  10. package/dist/src/eventDefinitions/CompensateEventDefinition.js +24 -24
  11. package/dist/src/eventDefinitions/ConditionalEventDefinition.js +8 -8
  12. package/dist/src/eventDefinitions/ErrorEventDefinition.js +26 -26
  13. package/dist/src/eventDefinitions/EscalationEventDefinition.js +20 -20
  14. package/dist/src/eventDefinitions/EventDefinitionExecution.js +14 -14
  15. package/dist/src/eventDefinitions/LinkEventDefinition.js +15 -15
  16. package/dist/src/eventDefinitions/MessageEventDefinition.js +23 -23
  17. package/dist/src/eventDefinitions/SignalEventDefinition.js +24 -24
  18. package/dist/src/eventDefinitions/TimerEventDefinition.js +21 -21
  19. package/dist/src/events/BoundaryEvent.js +20 -20
  20. package/dist/src/events/EndEvent.js +3 -3
  21. package/dist/src/events/IntermediateCatchEvent.js +3 -3
  22. package/dist/src/events/IntermediateThrowEvent.js +3 -3
  23. package/dist/src/events/StartEvent.js +9 -9
  24. package/dist/src/flows/Association.js +7 -7
  25. package/dist/src/flows/MessageFlow.js +9 -9
  26. package/dist/src/flows/SequenceFlow.js +7 -7
  27. package/dist/src/gateways/EventBasedGateway.js +11 -11
  28. package/dist/src/io/InputOutputSpecification.js +4 -4
  29. package/dist/src/io/Properties.js +9 -9
  30. package/dist/src/process/Process.js +64 -61
  31. package/dist/src/process/ProcessExecution.js +93 -90
  32. package/dist/src/tasks/ReceiveTask.js +16 -16
  33. package/dist/src/tasks/SubProcess.js +16 -18
  34. package/package.json +9 -9
  35. package/src/Context.js +48 -40
  36. package/src/Environment.js +48 -20
  37. package/src/EventBroker.js +1 -1
  38. package/src/MessageFormatter.js +11 -11
  39. package/src/activity/Activity.js +91 -91
  40. package/src/activity/ActivityExecution.js +34 -34
  41. package/src/definition/Definition.js +51 -50
  42. package/src/definition/DefinitionExecution.js +111 -113
  43. package/src/eventDefinitions/CancelEventDefinition.js +16 -16
  44. package/src/eventDefinitions/CompensateEventDefinition.js +25 -24
  45. package/src/eventDefinitions/ConditionalEventDefinition.js +8 -8
  46. package/src/eventDefinitions/ErrorEventDefinition.js +26 -26
  47. package/src/eventDefinitions/EscalationEventDefinition.js +20 -20
  48. package/src/eventDefinitions/EventDefinitionExecution.js +14 -14
  49. package/src/eventDefinitions/LinkEventDefinition.js +15 -15
  50. package/src/eventDefinitions/MessageEventDefinition.js +23 -23
  51. package/src/eventDefinitions/SignalEventDefinition.js +24 -24
  52. package/src/eventDefinitions/TimerEventDefinition.js +21 -21
  53. package/src/events/BoundaryEvent.js +20 -20
  54. package/src/events/EndEvent.js +3 -3
  55. package/src/events/IntermediateCatchEvent.js +3 -3
  56. package/src/events/IntermediateThrowEvent.js +3 -3
  57. package/src/events/StartEvent.js +9 -9
  58. package/src/flows/Association.js +7 -7
  59. package/src/flows/MessageFlow.js +9 -9
  60. package/src/flows/SequenceFlow.js +7 -7
  61. package/src/gateways/EventBasedGateway.js +11 -11
  62. package/src/io/BpmnIO.js +5 -1
  63. package/src/io/InputOutputSpecification.js +4 -4
  64. package/src/io/Properties.js +9 -9
  65. package/src/process/Process.js +62 -58
  66. package/src/process/ProcessExecution.js +86 -88
  67. package/src/tasks/ReceiveTask.js +16 -16
  68. package/src/tasks/SubProcess.js +16 -16
@@ -7,19 +7,19 @@ import {Formatter} from '../MessageFormatter';
7
7
  import {cloneContent, cloneParent, cloneMessage} from '../messageHelper';
8
8
  import {makeErrorFromMessage, ActivityError} from '../error/Errors';
9
9
 
10
- const activityDefSymbol = Symbol.for('activityDefinition');
11
- const bpmnIoSymbol = Symbol.for('bpmnIo');
12
- const consumingSymbol = Symbol.for('consuming');
13
- const countersSymbol = Symbol.for('counters');
14
- const eventDefinitionsSymbol = Symbol.for('eventDefinitions');
15
- const execSymbol = Symbol.for('exec');
16
- const executeMessageSymbol = Symbol.for('executeMessage');
17
- const extensionsSymbol = Symbol.for('extensions');
18
- const flagsSymbol = Symbol.for('flags');
19
- const flowsSymbol = Symbol.for('flows');
20
- const formatterSymbol = Symbol.for('formatter');
21
- const messageHandlersSymbol = Symbol.for('messageHandlers');
22
- const stateMessageSymbol = Symbol.for('stateMessage');
10
+ const kActivityDef = Symbol.for('activityDefinition');
11
+ const kBpmnIo = Symbol.for('bpmnIo');
12
+ const kConsuming = Symbol.for('consuming');
13
+ const kCounters = Symbol.for('counters');
14
+ const kEventDefinitions = Symbol.for('eventDefinitions');
15
+ const kExec = Symbol.for('exec');
16
+ const kExecuteMessage = Symbol.for('executeMessage');
17
+ const kExtensions = Symbol.for('extensions');
18
+ const kFlags = Symbol.for('flags');
19
+ const kFlows = Symbol.for('flows');
20
+ const kFormatter = Symbol.for('formatter');
21
+ const kMessageHandlers = Symbol.for('messageHandlers');
22
+ const kStateMessage = Symbol.for('stateMessage');
23
23
 
24
24
  export default Activity;
25
25
 
@@ -27,7 +27,7 @@ function Activity(Behaviour, activityDef, context) {
27
27
  const {id, type = 'activity', name, behaviour = {}} = activityDef;
28
28
  const {attachedTo: attachedToRef, eventDefinitions} = behaviour;
29
29
 
30
- this[activityDefSymbol] = activityDef;
30
+ this[kActivityDef] = activityDef;
31
31
  this.id = id;
32
32
  this.type = type;
33
33
  this.name = name;
@@ -37,7 +37,7 @@ function Activity(Behaviour, activityDef, context) {
37
37
  this.logger = context.environment.Logger(type.toLowerCase());
38
38
  this.environment = context.environment;
39
39
  this.context = context;
40
- this[countersSymbol] = {
40
+ this[kCounters] = {
41
41
  taken: 0,
42
42
  discarded: 0,
43
43
  };
@@ -60,7 +60,7 @@ function Activity(Behaviour, activityDef, context) {
60
60
  const inboundAssociations = context.getInboundAssociations(id);
61
61
  const inboundTriggers = attachedToActivity ? [attachedToActivity] : inboundSequenceFlows.slice();
62
62
  const outboundSequenceFlows = context.getOutboundSequenceFlows(id);
63
- const flows = this[flowsSymbol] = {
63
+ const flows = this[kFlows] = {
64
64
  inboundSequenceFlows,
65
65
  inboundAssociations,
66
66
  inboundJoinFlows: [],
@@ -71,7 +71,7 @@ function Activity(Behaviour, activityDef, context) {
71
71
 
72
72
  const isForCompensation = !!behaviour.isForCompensation;
73
73
  const isParallelJoin = activityDef.isParallelGateway && flows.inboundSequenceFlows.length > 1;
74
- this[flagsSymbol] = {
74
+ this[kFlags] = {
75
75
  isEnd: flows.outboundSequenceFlows.length === 0,
76
76
  isStart: flows.inboundSequenceFlows.length === 0 && !attachedTo && !behaviour.triggeredByEvent && !isForCompensation,
77
77
  isSubProcess: activityDef.isSubProcess,
@@ -82,9 +82,9 @@ function Activity(Behaviour, activityDef, context) {
82
82
  isParallelJoin,
83
83
  isThrowing: activityDef.isThrowing,
84
84
  };
85
- this[execSymbol] = {};
85
+ this[kExec] = {};
86
86
 
87
- this[messageHandlersSymbol] = {
87
+ this[kMessageHandlers] = {
88
88
  onInbound: isParallelJoin ? this._onJoinInbound.bind(this) : this._onInbound.bind(this),
89
89
  onRunMessage: this._onRunMessage.bind(this),
90
90
  onApiMessage: this._onApiMessage.bind(this),
@@ -104,7 +104,7 @@ function Activity(Behaviour, activityDef, context) {
104
104
  }
105
105
  }
106
106
 
107
- this[eventDefinitionsSymbol] = eventDefinitions && eventDefinitions.map((ed) => new ed.Behaviour(this, ed, this.context));
107
+ this[kEventDefinitions] = eventDefinitions && eventDefinitions.map((ed) => new ed.Behaviour(this, ed, this.context));
108
108
  }
109
109
 
110
110
  const proto = Activity.prototype;
@@ -112,29 +112,29 @@ const proto = Activity.prototype;
112
112
  Object.defineProperty(proto, 'counters', {
113
113
  enumerable: true,
114
114
  get() {
115
- return {...this[countersSymbol]};
115
+ return {...this[kCounters]};
116
116
  },
117
117
  });
118
118
 
119
119
  Object.defineProperty(proto, 'execution', {
120
120
  enumerable: true,
121
121
  get() {
122
- return this[execSymbol].execution;
122
+ return this[kExec].execution;
123
123
  },
124
124
  });
125
125
 
126
126
  Object.defineProperty(proto, 'executionId', {
127
127
  enumerable: true,
128
128
  get() {
129
- return this[execSymbol].executionId;
129
+ return this[kExec].executionId;
130
130
  },
131
131
  });
132
132
 
133
133
  Object.defineProperty(proto, 'bpmnIo', {
134
134
  enumerable: true,
135
135
  get() {
136
- if (bpmnIoSymbol in this) return this[bpmnIoSymbol];
137
- const bpmnIo = this[bpmnIoSymbol] = new BpmnIO(this, this.context);
136
+ if (kBpmnIo in this) return this[kBpmnIo];
137
+ const bpmnIo = this[kBpmnIo] = new BpmnIO(this, this.context);
138
138
  return bpmnIo;
139
139
  },
140
140
  });
@@ -142,8 +142,8 @@ Object.defineProperty(proto, 'bpmnIo', {
142
142
  Object.defineProperty(proto, 'extensions', {
143
143
  enumerable: true,
144
144
  get() {
145
- if (extensionsSymbol in this) return this[extensionsSymbol];
146
- const extensions = this[extensionsSymbol] = this.context.loadExtensions(this);
145
+ if (kExtensions in this) return this[kExtensions];
146
+ const extensions = this[kExtensions] = this.context.loadExtensions(this);
147
147
  return extensions;
148
148
  },
149
149
  });
@@ -151,11 +151,11 @@ Object.defineProperty(proto, 'extensions', {
151
151
  Object.defineProperty(proto, 'formatter', {
152
152
  enumerable: true,
153
153
  get() {
154
- let formatter = this[formatterSymbol];
154
+ let formatter = this[kFormatter];
155
155
  if (formatter) return formatter;
156
156
 
157
157
  const broker = this.broker;
158
- formatter = this[formatterSymbol] = new Formatter({
158
+ formatter = this[kFormatter] = new Formatter({
159
159
  id: this.id,
160
160
  broker,
161
161
  logger: this.logger,
@@ -167,7 +167,7 @@ Object.defineProperty(proto, 'formatter', {
167
167
  Object.defineProperty(proto, 'isRunning', {
168
168
  enumerable: true,
169
169
  get() {
170
- if (!this[consumingSymbol]) return false;
170
+ if (!this[kConsuming]) return false;
171
171
  return !!this.status;
172
172
  },
173
173
  });
@@ -175,66 +175,66 @@ Object.defineProperty(proto, 'isRunning', {
175
175
  Object.defineProperty(proto, 'outbound', {
176
176
  enumerable: true,
177
177
  get() {
178
- return this[flowsSymbol].outboundSequenceFlows;
178
+ return this[kFlows].outboundSequenceFlows;
179
179
  },
180
180
  });
181
181
 
182
182
  Object.defineProperty(proto, 'inbound', {
183
183
  enumerable: true,
184
184
  get() {
185
- return this[flowsSymbol].inboundSequenceFlows;
185
+ return this[kFlows].inboundSequenceFlows;
186
186
  },
187
187
  });
188
188
 
189
189
  Object.defineProperty(proto, 'isEnd', {
190
190
  enumerable: true,
191
191
  get() {
192
- return this[flagsSymbol].isEnd;
192
+ return this[kFlags].isEnd;
193
193
  },
194
194
  });
195
195
  Object.defineProperty(proto, 'isStart', {
196
196
  enumerable: true,
197
197
  get() {
198
- return this[flagsSymbol].isStart;
198
+ return this[kFlags].isStart;
199
199
  },
200
200
  });
201
201
  Object.defineProperty(proto, 'isSubProcess', {
202
202
  enumerable: true,
203
203
  get() {
204
- return this[flagsSymbol].isSubProcess;
204
+ return this[kFlags].isSubProcess;
205
205
  },
206
206
  });
207
207
 
208
208
  Object.defineProperty(proto, 'isMultiInstance', {
209
209
  enumerable: true,
210
210
  get() {
211
- return this[flagsSymbol].isMultiInstance;
211
+ return this[kFlags].isMultiInstance;
212
212
  },
213
213
  });
214
214
 
215
215
  Object.defineProperty(proto, 'isThrowing', {
216
216
  enumerable: true,
217
217
  get() {
218
- return this[flagsSymbol].isThrowing;
218
+ return this[kFlags].isThrowing;
219
219
  },
220
220
  });
221
221
  Object.defineProperty(proto, 'isForCompensation', {
222
222
  enumerable: true,
223
223
  get() {
224
- return this[flagsSymbol].isForCompensation;
224
+ return this[kFlags].isForCompensation;
225
225
  },
226
226
  });
227
227
  Object.defineProperty(proto, 'triggeredByEvent', {
228
228
  enumerable: true,
229
229
  get() {
230
- return this[activityDefSymbol].triggeredByEvent;
230
+ return this[kActivityDef].triggeredByEvent;
231
231
  },
232
232
  });
233
233
 
234
234
  Object.defineProperty(proto, 'attachedTo', {
235
235
  enumerable: true,
236
236
  get() {
237
- const attachedToId = this[flagsSymbol].attachedTo;
237
+ const attachedToId = this[kFlags].attachedTo;
238
238
  if (!attachedToId) return null;
239
239
  return this.getActivityById(attachedToId);
240
240
  },
@@ -243,12 +243,12 @@ Object.defineProperty(proto, 'attachedTo', {
243
243
  Object.defineProperty(proto, 'eventDefinitions', {
244
244
  enumerable: true,
245
245
  get() {
246
- return this[eventDefinitionsSymbol];
246
+ return this[kEventDefinitions];
247
247
  },
248
248
  });
249
249
 
250
250
  proto.activate = function activate() {
251
- if (this[flagsSymbol].isForCompensation) return;
251
+ if (this[kFlags].isForCompensation) return;
252
252
  return this._consumeInbound();
253
253
  };
254
254
 
@@ -260,7 +260,7 @@ proto.deactivate = function deactivate() {
260
260
 
261
261
  proto.init = function init(initContent) {
262
262
  const id = this.id;
263
- const exec = this[execSymbol];
263
+ const exec = this[kExec];
264
264
  const executionId = exec.initExecutionId = exec.initExecutionId || getUniqueId(id);
265
265
  this.logger.debug(`<${id}> initialized with executionId <${executionId}>`);
266
266
  this._publishEvent('init', this._createMessage({...initContent, executionId}));
@@ -270,7 +270,7 @@ proto.run = function run(runContent) {
270
270
  const id = this.id;
271
271
  if (this.isRunning) throw new Error(`activity <${id}> is already running`);
272
272
 
273
- const exec = this[execSymbol];
273
+ const exec = this[kExec];
274
274
  const executionId = exec.executionId = exec.initExecutionId || getUniqueId(id);
275
275
  exec.initExecutionId = null;
276
276
 
@@ -291,10 +291,10 @@ proto.recover = function recover(state) {
291
291
 
292
292
  this.stopped = state.stopped;
293
293
  this.status = state.status;
294
- const exec = this[execSymbol];
294
+ const exec = this[kExec];
295
295
  exec.executionId = state.executionId;
296
296
 
297
- this[countersSymbol] = {...this[countersSymbol], ...state.counters};
297
+ this[kCounters] = {...this[kCounters], ...state.counters};
298
298
 
299
299
  if (state.execution) {
300
300
  exec.execution = new ActivityExecution(this, this.context).recover(state.execution);
@@ -306,7 +306,7 @@ proto.recover = function recover(state) {
306
306
  };
307
307
 
308
308
  proto.resume = function resume() {
309
- if (this[consumingSymbol]) {
309
+ if (this[kConsuming]) {
310
310
  throw new Error(`cannot resume running activity <${this.id}>`);
311
311
  }
312
312
  if (!this.status) return this.activate();
@@ -322,24 +322,24 @@ proto.resume = function resume() {
322
322
 
323
323
  proto.discard = function discard(discardContent) {
324
324
  if (!this.status) return this._runDiscard(discardContent);
325
- const execution = this[execSymbol].execution;
325
+ const execution = this[kExec].execution;
326
326
  if (execution && !execution.completed) return execution.discard();
327
327
 
328
328
  this._deactivateRunConsumers();
329
329
  const broker = this.broker;
330
330
  broker.getQueue('run-q').purge();
331
- broker.publish('run', 'run.discard', cloneContent(this[stateMessageSymbol].content));
331
+ broker.publish('run', 'run.discard', cloneContent(this[kStateMessage].content));
332
332
  this._consumeRunQ();
333
333
  };
334
334
 
335
335
  proto.stop = function stop() {
336
- if (!this[consumingSymbol]) return;
336
+ if (!this[kConsuming]) return;
337
337
  return this.getApi().stop();
338
338
  };
339
339
 
340
340
  proto.next = function next() {
341
341
  if (!this.environment.settings.step) return;
342
- const stateMessage = this[stateMessageSymbol];
342
+ const stateMessage = this[kStateMessage];
343
343
  if (!stateMessage) return;
344
344
  if (this.status === 'executing') return false;
345
345
  if (this.status === 'formatting') return false;
@@ -353,13 +353,13 @@ proto.shake = function shake() {
353
353
  };
354
354
 
355
355
  proto.evaluateOutbound = function evaluateOutbound(fromMessage, discardRestAtTake, callback) {
356
- return this[flowsSymbol].outboundEvaluator.evaluate(fromMessage, discardRestAtTake, callback);
356
+ return this[kFlows].outboundEvaluator.evaluate(fromMessage, discardRestAtTake, callback);
357
357
  };
358
358
 
359
359
  proto.getState = function getState() {
360
360
  const msg = this._createMessage();
361
361
 
362
- const exec = this[execSymbol];
362
+ const exec = this[kExec];
363
363
  return {
364
364
  ...msg,
365
365
  executionId: exec.executionId,
@@ -372,9 +372,9 @@ proto.getState = function getState() {
372
372
  };
373
373
 
374
374
  proto.getApi = function getApi(message) {
375
- const execution = this[execSymbol].execution;
375
+ const execution = this[kExec].execution;
376
376
  if (execution && !execution.completed) return execution.getApi(message);
377
- return ActivityApi(this.broker, message || this[stateMessageSymbol]);
377
+ return ActivityApi(this.broker, message || this[kStateMessage]);
378
378
  };
379
379
 
380
380
  proto.getActivityById = function getActivityById(elementId) {
@@ -382,7 +382,7 @@ proto.getActivityById = function getActivityById(elementId) {
382
382
  };
383
383
 
384
384
  proto._runDiscard = function runDiscard(discardContent) {
385
- const exec = this[execSymbol];
385
+ const exec = this[kExec];
386
386
  const executionId = exec.executionId = exec.initExecutionId || getUniqueId(this.id);
387
387
  exec.initExecutionId = null;
388
388
 
@@ -398,7 +398,7 @@ proto._discardRun = function discardRun() {
398
398
  const status = this.status;
399
399
  if (!status) return;
400
400
 
401
- const execution = this[execSymbol].execution;
401
+ const execution = this[kExec].execution;
402
402
  if (execution && !execution.completed) return;
403
403
  switch (status) {
404
404
  case 'executing':
@@ -411,7 +411,7 @@ proto._discardRun = function discardRun() {
411
411
  if (this.extensions) this.extensions.deactivate();
412
412
  const broker = this.broker;
413
413
  broker.getQueue('run-q').purge();
414
- broker.publish('run', 'run.discard', cloneContent(this[stateMessageSymbol].content));
414
+ broker.publish('run', 'run.discard', cloneContent(this[kStateMessage].content));
415
415
  this._consumeRunQ();
416
416
  };
417
417
 
@@ -423,21 +423,21 @@ proto._shakeOutbound = function shakeOutbound(sourceMessage) {
423
423
  const broker = this.broker;
424
424
  this.broker.publish('api', 'activity.shake.start', message.content, {persistent: false, type: 'shake'});
425
425
 
426
- if (this[flagsSymbol].isEnd) {
426
+ if (this[kFlags].isEnd) {
427
427
  return broker.publish('event', 'activity.shake.end', message.content, {persistent: false, type: 'shake'});
428
428
  }
429
429
 
430
- for (const flow of this[flowsSymbol].outboundSequenceFlows) flow.shake(message);
430
+ for (const flow of this[kFlows].outboundSequenceFlows) flow.shake(message);
431
431
  };
432
432
 
433
433
  proto._consumeInbound = function consumeInbound() {
434
434
  if (this.status) return;
435
435
  const inboundQ = this.broker.getQueue('inbound-q');
436
- if (this[flagsSymbol].isParallelJoin) {
437
- return inboundQ.consume(this[messageHandlersSymbol].onInbound, {consumerTag: '_run-on-inbound', prefetch: 1000});
436
+ if (this[kFlags].isParallelJoin) {
437
+ return inboundQ.consume(this[kMessageHandlers].onInbound, {consumerTag: '_run-on-inbound', prefetch: 1000});
438
438
  }
439
439
 
440
- return inboundQ.consume(this[messageHandlersSymbol].onInbound, {consumerTag: '_run-on-inbound'});
440
+ return inboundQ.consume(this[kMessageHandlers].onInbound, {consumerTag: '_run-on-inbound'});
441
441
  };
442
442
 
443
443
  proto._onInbound = function onInbound(routingKey, message) {
@@ -478,7 +478,7 @@ proto._onInbound = function onInbound(routingKey, message) {
478
478
 
479
479
  proto._onJoinInbound = function onJoinInbound(routingKey, message) {
480
480
  const {content} = message;
481
- const {inboundSequenceFlows, inboundJoinFlows, inboundTriggers} = this[flowsSymbol];
481
+ const {inboundSequenceFlows, inboundJoinFlows, inboundTriggers} = this[kFlows];
482
482
  const idx = inboundJoinFlows.findIndex((msg) => msg.content.id === content.id);
483
483
 
484
484
  inboundJoinFlows.push(message);
@@ -522,7 +522,7 @@ proto._onInboundEvent = function onInboundEvent(routingKey, message) {
522
522
  switch (routingKey) {
523
523
  case 'activity.enter':
524
524
  case 'activity.discard': {
525
- if (content.id === this[flagsSymbol].attachedTo) {
525
+ if (content.id === this[kFlags].attachedTo) {
526
526
  inboundQ.queueMessage(fields, cloneContent(content), properties);
527
527
  }
528
528
  break;
@@ -539,7 +539,7 @@ proto._onInboundEvent = function onInboundEvent(routingKey, message) {
539
539
  return inboundQ.purge();
540
540
  }
541
541
  case 'association.complete': {
542
- if (!this[flagsSymbol].isForCompensation) break;
542
+ if (!this[kFlags].isForCompensation) break;
543
543
 
544
544
  inboundQ.queueMessage(fields, cloneContent(content), properties);
545
545
 
@@ -557,10 +557,10 @@ proto._onInboundEvent = function onInboundEvent(routingKey, message) {
557
557
  };
558
558
 
559
559
  proto._consumeRunQ = function consumeRunQ() {
560
- if (this[consumingSymbol]) return;
560
+ if (this[kConsuming]) return;
561
561
 
562
- this[consumingSymbol] = true;
563
- this.broker.getQueue('run-q').assertConsumer(this[messageHandlersSymbol].onRunMessage, {exclusive: true, consumerTag: '_activity-run'});
562
+ this[kConsuming] = true;
563
+ this.broker.getQueue('run-q').assertConsumer(this[kMessageHandlers].onRunMessage, {exclusive: true, consumerTag: '_activity-run'});
564
564
  };
565
565
 
566
566
  proto._onRunMessage = function onRunMessage(routingKey, message, messageProperties) {
@@ -591,7 +591,7 @@ proto._continueRunMessage = function continueRunMessage(routingKey, message) {
591
591
 
592
592
  const id = this.id;
593
593
  const step = this.environment.settings.step;
594
- this[stateMessageSymbol] = message;
594
+ this[kStateMessage] = message;
595
595
 
596
596
  switch (routingKey) {
597
597
  case 'run.enter': {
@@ -599,7 +599,7 @@ proto._continueRunMessage = function continueRunMessage(routingKey, message) {
599
599
 
600
600
  this.status = 'entered';
601
601
  if (!isRedelivered) {
602
- this[execSymbol].execution = null;
602
+ this[kExec].execution = null;
603
603
  }
604
604
 
605
605
  if (this.extensions) this.extensions.activate(cloneMessage(message), this);
@@ -612,7 +612,7 @@ proto._continueRunMessage = function continueRunMessage(routingKey, message) {
612
612
  this.logger.debug(`<${id}> discard`, isRedelivered ? 'redelivered' : '');
613
613
 
614
614
  this.status = 'discard';
615
- this[execSymbol].execution = null;
615
+ this[kExec].execution = null;
616
616
 
617
617
  if (this.extensions) this.extensions.activate(cloneMessage(message), this);
618
618
  if (this.bpmnIo) this.bpmnIo.activate(message);
@@ -636,16 +636,16 @@ proto._continueRunMessage = function continueRunMessage(routingKey, message) {
636
636
  case 'run.execute.passthrough': {
637
637
  const execution = this.execution;
638
638
  if (!isRedelivered && execution) {
639
- this[executeMessageSymbol] = message;
639
+ this[kExecuteMessage] = message;
640
640
  return execution.passthrough(message);
641
641
  }
642
642
  }
643
643
  case 'run.execute': {
644
644
  this.status = 'executing';
645
- this[executeMessageSymbol] = message;
645
+ this[kExecuteMessage] = message;
646
646
 
647
- this.broker.getQueue('execution-q').assertConsumer(this[messageHandlersSymbol].onExecutionMessage, {exclusive: true, consumerTag: '_activity-execution'});
648
- const exec = this[execSymbol];
647
+ this.broker.getQueue('execution-q').assertConsumer(this[kMessageHandlers].onExecutionMessage, {exclusive: true, consumerTag: '_activity-execution'});
648
+ const exec = this[kExec];
649
649
  if (!exec.execution) exec.execution = new ActivityExecution(this, this.context);
650
650
 
651
651
  if (isRedelivered) {
@@ -662,7 +662,7 @@ proto._continueRunMessage = function continueRunMessage(routingKey, message) {
662
662
  case 'run.end': {
663
663
  if (this.status === 'end') break;
664
664
 
665
- this[countersSymbol].taken++;
665
+ this[kCounters].taken++;
666
666
 
667
667
  this.status = 'end';
668
668
 
@@ -682,7 +682,7 @@ proto._continueRunMessage = function continueRunMessage(routingKey, message) {
682
682
  }
683
683
  case 'run.discarded': {
684
684
  this.logger.debug(`<${content.executionId} (${id})> discarded`);
685
- this[countersSymbol].discarded++;
685
+ this[kCounters].discarded++;
686
686
 
687
687
  this.status = 'discarded';
688
688
  content.outbound = undefined;
@@ -727,7 +727,7 @@ proto._continueRunMessage = function continueRunMessage(routingKey, message) {
727
727
  };
728
728
 
729
729
  proto._onExecutionMessage = function onExecutionMessage(routingKey, message) {
730
- const executeMessage = this[executeMessageSymbol];
730
+ const executeMessage = this[kExecuteMessage];
731
731
  const content = cloneContent({
732
732
  ...executeMessage.content,
733
733
  ...message.content,
@@ -771,8 +771,8 @@ proto._onExecutionMessage = function onExecutionMessage(routingKey, message) {
771
771
 
772
772
  proto._ackRunExecuteMessage = function ackRunExecuteMessage() {
773
773
  if (this.environment.settings.step) return;
774
- const executeMessage = this[executeMessageSymbol];
775
- this[executeMessageSymbol] = null;
774
+ const executeMessage = this[kExecuteMessage];
775
+ this[kExecuteMessage] = null;
776
776
  executeMessage.ack();
777
777
  };
778
778
 
@@ -798,13 +798,13 @@ proto._doRunLeave = function doRunLeave(message, isDiscarded, onOutbound) {
798
798
  };
799
799
 
800
800
  proto._doOutbound = function doOutbound(fromMessage, isDiscarded, callback) {
801
- const outboundSequenceFlows = this[flowsSymbol].outboundSequenceFlows;
801
+ const outboundSequenceFlows = this[kFlows].outboundSequenceFlows;
802
802
  if (!outboundSequenceFlows.length) return callback(null, []);
803
803
 
804
804
  const fromContent = fromMessage.content;
805
805
 
806
806
  let discardSequence = fromContent.discardSequence;
807
- if (isDiscarded && !discardSequence && this[flagsSymbol].attachedTo && fromContent.inbound && fromContent.inbound[0]) {
807
+ if (isDiscarded && !discardSequence && this[kFlags].attachedTo && fromContent.inbound && fromContent.inbound[0]) {
808
808
  discardSequence = [fromContent.inbound[0].id];
809
809
  }
810
810
 
@@ -844,7 +844,7 @@ proto._doRunOutbound = function doRunOutbound(outboundList, content, discardSequ
844
844
  proto._onResumeMessage = function onResumeMessage(message) {
845
845
  message.ack();
846
846
 
847
- const stateMessage = this[stateMessageSymbol];
847
+ const stateMessage = this[kStateMessage];
848
848
  const {fields} = stateMessage;
849
849
 
850
850
  switch (fields.routingKey) {
@@ -875,11 +875,11 @@ proto._publishEvent = function publishEvent(state, content, properties = {}) {
875
875
  };
876
876
 
877
877
  proto._onStop = function onStop(message) {
878
- const running = this[consumingSymbol];
878
+ const running = this[kConsuming];
879
879
 
880
880
  this.stopped = true;
881
881
 
882
- this[consumingSymbol] = false;
882
+ this[kConsuming] = false;
883
883
  const broker = this.broker;
884
884
  broker.cancel('_activity-run');
885
885
  broker.cancel('_activity-api');
@@ -894,11 +894,11 @@ proto._onStop = function onStop(message) {
894
894
  };
895
895
 
896
896
  proto._consumeApi = function consumeApi() {
897
- const executionId = this[execSymbol].executionId;
897
+ const executionId = this[kExec].executionId;
898
898
  if (!executionId) return;
899
899
  const broker = this.broker;
900
900
  broker.cancel('_activity-api');
901
- broker.subscribeTmp('api', `activity.*.${executionId}`, this[messageHandlersSymbol].onApiMessage, {noAck: true, consumerTag: '_activity-api', priority: 100});
901
+ broker.subscribeTmp('api', `activity.*.${executionId}`, this[kMessageHandlers].onApiMessage, {noAck: true, consumerTag: '_activity-api', priority: 100});
902
902
  };
903
903
 
904
904
  proto._onApiMessage = function onApiMessage(routingKey, message) {
@@ -926,7 +926,7 @@ proto._createMessage = function createMessage(override) {
926
926
  ...(parent ? {parent: cloneParent(parent)} : undefined),
927
927
  };
928
928
 
929
- for (const [flag, value] of Object.entries(this[flagsSymbol])) {
929
+ for (const [flag, value] of Object.entries(this[kFlags])) {
930
930
  if (value) result[flag] = value;
931
931
  }
932
932
 
@@ -934,7 +934,7 @@ proto._createMessage = function createMessage(override) {
934
934
  };
935
935
 
936
936
  proto._getOutboundSequenceFlowById = function getOutboundSequenceFlowById(flowId) {
937
- return this[flowsSymbol].outboundSequenceFlows.find((flow) => flow.id === flowId);
937
+ return this[kFlows].outboundSequenceFlows.find((flow) => flow.id === flowId);
938
938
  };
939
939
 
940
940
  proto._resumeExtensions = function resumeExtensions(message, callback) {
@@ -956,7 +956,7 @@ proto._deactivateRunConsumers = function _deactivateRunConsumers() {
956
956
  broker.cancel('_activity-api');
957
957
  broker.cancel('_activity-run');
958
958
  broker.cancel('_activity-execution');
959
- this[consumingSymbol] = false;
959
+ this[kConsuming] = false;
960
960
  };
961
961
 
962
962
  function OutboundEvaluator(activity, outboundFlows) {