bpmn-elements 8.1.0 → 8.2.1

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 (79) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/index.js +0 -49
  3. package/dist/src/Api.js +4 -19
  4. package/dist/src/Context.js +7 -36
  5. package/dist/src/Environment.js +18 -44
  6. package/dist/src/EventBroker.js +8 -27
  7. package/dist/src/Expressions.js +0 -13
  8. package/dist/src/ExtensionsMapper.js +32 -44
  9. package/dist/src/MessageFormatter.js +0 -33
  10. package/dist/src/Scripts.js +2 -9
  11. package/dist/src/Timers.js +0 -9
  12. package/dist/src/activity/Activity.js +62 -294
  13. package/dist/src/activity/ActivityExecution.js +8 -76
  14. package/dist/src/activity/Dummy.js +2 -3
  15. package/dist/src/activity/Escalation.js +4 -4
  16. package/dist/src/activity/ExecutionScope.js +0 -4
  17. package/dist/src/activity/Message.js +4 -4
  18. package/dist/src/activity/Signal.js +4 -4
  19. package/dist/src/definition/Definition.js +12 -133
  20. package/dist/src/definition/DefinitionExecution.js +10 -160
  21. package/dist/src/error/BpmnError.js +2 -3
  22. package/dist/src/error/Errors.js +0 -16
  23. package/dist/src/eventDefinitions/CancelEventDefinition.js +2 -35
  24. package/dist/src/eventDefinitions/CompensateEventDefinition.js +3 -34
  25. package/dist/src/eventDefinitions/ConditionalEventDefinition.js +3 -42
  26. package/dist/src/eventDefinitions/ErrorEventDefinition.js +11 -41
  27. package/dist/src/eventDefinitions/EscalationEventDefinition.js +7 -37
  28. package/dist/src/eventDefinitions/EventDefinitionExecution.js +0 -30
  29. package/dist/src/eventDefinitions/LinkEventDefinition.js +11 -37
  30. package/dist/src/eventDefinitions/MessageEventDefinition.js +11 -44
  31. package/dist/src/eventDefinitions/SignalEventDefinition.js +9 -46
  32. package/dist/src/eventDefinitions/TerminateEventDefinition.js +0 -3
  33. package/dist/src/eventDefinitions/TimerEventDefinition.js +8 -52
  34. package/dist/src/events/BoundaryEvent.js +4 -44
  35. package/dist/src/events/EndEvent.js +2 -11
  36. package/dist/src/events/IntermediateCatchEvent.js +0 -13
  37. package/dist/src/events/IntermediateThrowEvent.js +2 -11
  38. package/dist/src/events/StartEvent.js +5 -25
  39. package/dist/src/flows/Association.js +4 -27
  40. package/dist/src/flows/MessageFlow.js +6 -18
  41. package/dist/src/flows/SequenceFlow.js +4 -39
  42. package/dist/src/gateways/EventBasedGateway.js +0 -21
  43. package/dist/src/gateways/ExclusiveGateway.js +0 -6
  44. package/dist/src/gateways/InclusiveGateway.js +0 -6
  45. package/dist/src/gateways/ParallelGateway.js +2 -7
  46. package/dist/src/getPropertyValue.js +0 -30
  47. package/dist/src/io/BpmnIO.js +8 -5
  48. package/dist/src/io/EnvironmentDataObject.js +0 -8
  49. package/dist/src/io/EnvironmentDataStore.js +0 -8
  50. package/dist/src/io/EnvironmentDataStoreReference.js +0 -8
  51. package/dist/src/io/InputOutputSpecification.js +25 -36
  52. package/dist/src/io/Properties.js +15 -47
  53. package/dist/src/messageHelper.js +10 -23
  54. package/dist/src/process/Process.js +10 -112
  55. package/dist/src/process/ProcessExecution.js +14 -170
  56. package/dist/src/shared.js +0 -7
  57. package/dist/src/tasks/CallActivity.js +2 -23
  58. package/dist/src/tasks/LoopCharacteristics.js +16 -67
  59. package/dist/src/tasks/ReceiveTask.js +8 -48
  60. package/dist/src/tasks/ScriptTask.js +1 -15
  61. package/dist/src/tasks/ServiceImplementation.js +0 -4
  62. package/dist/src/tasks/ServiceTask.js +1 -25
  63. package/dist/src/tasks/SignalTask.js +2 -21
  64. package/dist/src/tasks/StandardLoopCharacteristics.js +4 -5
  65. package/dist/src/tasks/SubProcess.js +4 -52
  66. package/dist/src/tasks/Task.js +0 -8
  67. package/dist/src/tasks/Transaction.js +0 -3
  68. package/package.json +8 -8
  69. package/src/Context.js +7 -3
  70. package/src/ExtensionsMapper.js +35 -35
  71. package/src/activity/Activity.js +22 -51
  72. package/src/gateways/EventBasedGateway.js +0 -1
  73. package/src/io/BpmnIO.js +7 -0
  74. package/src/io/EnvironmentDataObject.js +1 -0
  75. package/src/io/InputOutputSpecification.js +17 -6
  76. package/src/io/Properties.js +9 -11
  77. package/src/process/ProcessExecution.js +2 -1
  78. package/src/tasks/ServiceTask.js +1 -3
  79. package/src/tasks/StandardLoopCharacteristics.js +0 -1
@@ -5,18 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.ReceiveTaskBehaviour = ReceiveTaskBehaviour;
7
7
  exports.default = ReceiveTask;
8
-
9
8
  var _Activity = _interopRequireDefault(require("../activity/Activity"));
10
-
11
9
  var _messageHelper = require("../messageHelper");
12
-
13
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
11
  const kCompleted = Symbol.for('completed');
16
12
  const kExecuteMessage = Symbol.for('executeMessage');
17
13
  const kReferenceElement = Symbol.for('referenceElement');
18
14
  const kReferenceInfo = Symbol.for('referenceInfo');
19
-
20
15
  function ReceiveTask(activityDef, context) {
21
16
  const task = new _Activity.default(ReceiveTaskBehaviour, activityDef, context);
22
17
  task.broker.assertQueue('message', {
@@ -28,7 +23,6 @@ function ReceiveTask(activityDef, context) {
28
23
  });
29
24
  return task;
30
25
  }
31
-
32
26
  function ReceiveTaskBehaviour(activity) {
33
27
  const {
34
28
  id,
@@ -47,11 +41,9 @@ function ReceiveTaskBehaviour(activity) {
47
41
  this.broker = activity.broker;
48
42
  this[kReferenceElement] = reference.id && activity.getActivityById(reference.id);
49
43
  }
50
-
51
44
  ReceiveTaskBehaviour.prototype.execute = function execute(executeMessage) {
52
45
  return new ReceiveTaskExecution(this).execute(executeMessage);
53
46
  };
54
-
55
47
  function ReceiveTaskExecution(parent) {
56
48
  const {
57
49
  activity,
@@ -67,9 +59,7 @@ function ReceiveTaskExecution(parent) {
67
59
  this.referenceElement = parent[kReferenceElement];
68
60
  this[kCompleted] = false;
69
61
  }
70
-
71
62
  const proto = ReceiveTaskExecution.prototype;
72
-
73
63
  proto.execute = function execute(executeMessage) {
74
64
  this[kExecuteMessage] = executeMessage;
75
65
  const executeContent = executeMessage.content;
@@ -78,19 +68,14 @@ proto.execute = function execute(executeMessage) {
78
68
  isRootScope
79
69
  } = executeContent;
80
70
  this.executionId = executionId;
81
-
82
71
  const info = this[kReferenceInfo] = this._getReferenceInfo(executeMessage);
83
-
84
72
  if (isRootScope) {
85
73
  this._setupMessageHandling(executionId);
86
74
  }
87
-
88
75
  const loopCharacteristics = this.loopCharacteristics;
89
-
90
76
  if (loopCharacteristics && executeMessage.content.isRootScope) {
91
77
  return loopCharacteristics.execute(executeMessage);
92
78
  }
93
-
94
79
  const broker = this.broker;
95
80
  broker.consume('message', this._onCatchMessage.bind(this), {
96
81
  noAck: true,
@@ -102,15 +87,13 @@ proto.execute = function execute(executeMessage) {
102
87
  consumerTag: `_api-${executionId}`,
103
88
  priority: 400
104
89
  });
105
-
106
90
  this._debug(`expect ${info.description}`);
107
-
108
91
  broker.publish('event', 'activity.wait', (0, _messageHelper.cloneContent)(executeContent, {
109
- message: { ...info.message
92
+ message: {
93
+ ...info.message
110
94
  }
111
95
  }));
112
96
  };
113
-
114
97
  proto._onCatchMessage = function onCatchMessage(routingKey, message) {
115
98
  const content = message.content;
116
99
  const {
@@ -121,16 +104,13 @@ proto._onCatchMessage = function onCatchMessage(routingKey, message) {
121
104
  message: referenceMessage,
122
105
  description
123
106
  } = this[kReferenceInfo];
124
-
125
107
  if (!referenceMessage.id && signalId || signalExecutionId) {
126
108
  if (this.loopCharacteristics && signalExecutionId !== this.executionId) return;
127
109
  if (signalId !== this.id && signalExecutionId !== this.executionId) return;
128
-
129
110
  this._debug('caught direct message');
130
111
  } else if (referenceMessage.id !== signalId) return;else {
131
112
  this._debug(`caught ${description}`);
132
113
  }
133
-
134
114
  const {
135
115
  type: messageType,
136
116
  correlationId
@@ -138,7 +118,8 @@ proto._onCatchMessage = function onCatchMessage(routingKey, message) {
138
118
  const broker = this.broker;
139
119
  const executeContent = this[kExecuteMessage].content;
140
120
  broker.publish('event', 'activity.consumed', (0, _messageHelper.cloneContent)(executeContent, {
141
- message: { ...message.content.message
121
+ message: {
122
+ ...message.content.message
142
123
  }
143
124
  }), {
144
125
  correlationId,
@@ -150,18 +131,15 @@ proto._onCatchMessage = function onCatchMessage(routingKey, message) {
150
131
  type: 'catch',
151
132
  correlationId
152
133
  });
153
-
154
134
  this._complete(message.content.message, {
155
135
  correlationId
156
136
  });
157
137
  };
158
-
159
138
  proto._onApiMessage = function onApiMessage(routingKey, message) {
160
139
  const {
161
140
  type: messageType,
162
141
  correlationId
163
142
  } = message.properties;
164
-
165
143
  switch (messageType) {
166
144
  case 'message':
167
145
  case 'signal':
@@ -170,42 +148,33 @@ proto._onApiMessage = function onApiMessage(routingKey, message) {
170
148
  correlationId
171
149
  });
172
150
  }
173
-
174
151
  case 'discard':
175
152
  {
176
153
  this[kCompleted] = true;
177
-
178
154
  this._stop();
179
-
180
155
  return this.broker.publish('execution', 'execute.discard', (0, _messageHelper.cloneContent)(this[kExecuteMessage].content), {
181
156
  correlationId
182
157
  });
183
158
  }
184
-
185
159
  case 'stop':
186
160
  {
187
161
  return this._stop();
188
162
  }
189
163
  }
190
164
  };
191
-
192
165
  proto._complete = function complete(output, options) {
193
166
  this[kCompleted] = true;
194
-
195
167
  this._stop();
196
-
197
168
  return this.broker.publish('execution', 'execute.completed', (0, _messageHelper.cloneContent)(this[kExecuteMessage].content, {
198
169
  output
199
170
  }), options);
200
171
  };
201
-
202
172
  proto._stop = function stop() {
203
173
  const broker = this.broker,
204
- executionId = this.executionId;
174
+ executionId = this.executionId;
205
175
  broker.cancel(`_onmessage-${executionId}`);
206
176
  broker.cancel(`_api-${executionId}`);
207
177
  };
208
-
209
178
  proto._setupMessageHandling = function setupMessageHandling(executionId) {
210
179
  const broker = this.broker;
211
180
  broker.subscribeTmp('api', '#.signal.*', this._onDelegateMessage.bind(this), {
@@ -226,58 +195,49 @@ proto._setupMessageHandling = function setupMessageHandling(executionId) {
226
195
  noAck: true
227
196
  });
228
197
  };
229
-
230
198
  proto._onDelegateMessage = function onDelegateMessage(_, message) {
231
199
  if (!message.properties.delegate) return;
232
200
  this.broker.sendToQueue('message', message.content, message.properties);
233
201
  };
234
-
235
202
  proto._onStopApiMessage = function onStopApiMessage() {
236
203
  this._stopMessageHandling(true);
237
204
  };
238
-
239
205
  proto._onExecutionComplete = function onExecutionComplete(routingKey, {
240
206
  content
241
207
  }) {
242
208
  if (!content.isRootScope) return;
243
-
244
209
  switch (routingKey) {
245
210
  case 'execute.completed':
246
211
  case 'execute.error':
247
212
  case 'execute.discard':
248
213
  this._stopMessageHandling();
249
-
250
214
  break;
251
215
  }
252
216
  };
253
-
254
217
  proto._stopMessageHandling = function stop(keepMessageQ) {
255
218
  const broker = this.broker,
256
- executionId = this.executionId;
219
+ executionId = this.executionId;
257
220
  broker.cancel(`_api-delegated-${executionId}`);
258
221
  broker.cancel(`_api-stop-${executionId}`);
259
222
  broker.cancel(`_execution-complete-${executionId}`);
260
223
  if (!keepMessageQ) broker.purgeQueue('message');
261
224
  };
262
-
263
225
  proto._getReferenceInfo = function getReferenceInfo(message) {
264
226
  const referenceElement = this.referenceElement;
265
-
266
227
  if (!referenceElement) {
267
228
  return {
268
- message: { ...this.reference
229
+ message: {
230
+ ...this.reference
269
231
  },
270
232
  description: 'anonymous message'
271
233
  };
272
234
  }
273
-
274
235
  const result = {
275
236
  message: referenceElement.resolve(message)
276
237
  };
277
238
  result.description = `${result.message.name} <${result.message.id}>`;
278
239
  return result;
279
240
  };
280
-
281
241
  proto._debug = function debug(msg) {
282
242
  this.logger.debug(`<${this.executionId} (${this.id})> ${msg}`);
283
243
  };
@@ -5,21 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.ScriptTaskBehaviour = ScriptTaskBehaviour;
7
7
  exports.default = ScriptTask;
8
-
9
8
  var _Activity = _interopRequireDefault(require("../activity/Activity"));
10
-
11
9
  var _ExecutionScope = _interopRequireDefault(require("../activity/ExecutionScope"));
12
-
13
10
  var _Errors = require("../error/Errors");
14
-
15
11
  var _messageHelper = require("../messageHelper");
16
-
17
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
-
19
13
  function ScriptTask(activityDef, context) {
20
14
  return new _Activity.default(ScriptTaskBehaviour, activityDef, context);
21
15
  }
22
-
23
16
  function ScriptTaskBehaviour(activity) {
24
17
  const {
25
18
  id,
@@ -34,25 +27,19 @@ function ScriptTaskBehaviour(activity) {
34
27
  const environment = this.environment = activity.environment;
35
28
  environment.registerScript(activity);
36
29
  }
37
-
38
30
  ScriptTaskBehaviour.prototype.execute = function execute(executeMessage) {
39
31
  const executeContent = executeMessage.content;
40
32
  const loopCharacteristics = this.loopCharacteristics;
41
-
42
33
  if (loopCharacteristics && executeContent.isRootScope) {
43
34
  return loopCharacteristics.execute(executeMessage);
44
35
  }
45
-
46
36
  const activity = this.activity,
47
- scriptFormat = this.scriptFormat;
37
+ scriptFormat = this.scriptFormat;
48
38
  const script = this.environment.getScript(scriptFormat, activity, (0, _messageHelper.cloneMessage)(executeMessage));
49
-
50
39
  if (!script) {
51
40
  return activity.emitFatal(new _Errors.ActivityError(`Script format ${scriptFormat} is unsupported or was not registered for <${activity.id}>`, executeMessage), executeContent);
52
41
  }
53
-
54
42
  return script.execute((0, _ExecutionScope.default)(activity, executeMessage), scriptCallback);
55
-
56
43
  function scriptCallback(err, output) {
57
44
  if (err) {
58
45
  activity.logger.error(`<${executeContent.executionId} (${activity.id})>`, err);
@@ -62,7 +49,6 @@ ScriptTaskBehaviour.prototype.execute = function execute(executeMessage) {
62
49
  mandatory: true
63
50
  }));
64
51
  }
65
-
66
52
  return activity.broker.publish('execution', 'execute.completed', (0, _messageHelper.cloneContent)(executeContent, {
67
53
  output
68
54
  }));
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = ServiceImplementation;
7
-
8
7
  var _ExecutionScope = _interopRequireDefault(require("../activity/ExecutionScope"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
9
  function ServiceImplementation(activity) {
13
10
  this.type = `${activity.type}:implementation`;
14
11
  this.implementation = activity.behaviour.implementation;
15
12
  this.activity = activity;
16
13
  }
17
-
18
14
  ServiceImplementation.prototype.execute = function execute(executionMessage, callback) {
19
15
  const activity = this.activity;
20
16
  const implementation = this.implementation;
@@ -5,19 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.ServiceTaskBehaviour = ServiceTaskBehaviour;
7
7
  exports.default = ServiceTask;
8
-
9
8
  var _Activity = _interopRequireDefault(require("../activity/Activity"));
10
-
11
9
  var _Errors = require("../error/Errors");
12
-
13
10
  var _messageHelper = require("../messageHelper");
14
-
15
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
-
17
12
  function ServiceTask(activityDef, context) {
18
13
  return new _Activity.default(ServiceTaskBehaviour, activityDef, context);
19
14
  }
20
-
21
15
  function ServiceTaskBehaviour(activity) {
22
16
  const {
23
17
  id,
@@ -31,17 +25,13 @@ function ServiceTaskBehaviour(activity) {
31
25
  this.environment = activity.environment;
32
26
  this.broker = activity.broker;
33
27
  }
34
-
35
28
  const proto = ServiceTaskBehaviour.prototype;
36
-
37
29
  proto.execute = function execute(executeMessage) {
38
30
  const executeContent = executeMessage.content;
39
31
  const loopCharacteristics = this.loopCharacteristics;
40
-
41
32
  if (loopCharacteristics && executeContent.isRootScope) {
42
33
  return loopCharacteristics.execute(executeMessage);
43
34
  }
44
-
45
35
  const executionId = executeContent.executionId;
46
36
  const service = this.service = this.getService(executeMessage);
47
37
  if (!service) return this.activity.emitFatal(new _Errors.ActivityError(`<${this.id}> service not defined`, executeMessage), executeContent);
@@ -51,7 +41,6 @@ proto.execute = function execute(executeMessage) {
51
41
  });
52
42
  return service.execute(executeMessage, (err, output) => {
53
43
  broker.cancel(`_api-${executionId}`);
54
-
55
44
  if (err) {
56
45
  this.activity.logger.error(`<${executionId} (${this.id})>`, err);
57
46
  return broker.publish('execution', 'execute.error', (0, _messageHelper.cloneContent)(executeContent, {
@@ -60,44 +49,33 @@ proto.execute = function execute(executeMessage) {
60
49
  mandatory: true
61
50
  }));
62
51
  }
63
-
64
52
  return broker.publish('execution', 'execute.completed', (0, _messageHelper.cloneContent)(executeContent, {
65
53
  output,
66
54
  state: 'complete'
67
55
  }));
68
56
  });
69
57
  };
70
-
71
58
  proto.getService = function getService(message) {
72
59
  let Service = this.activity.behaviour.Service;
73
-
74
- if (!Service) {
75
- Service = this.environment.settings.enableDummyService ? DummyService : null;
76
- }
77
-
60
+ if (!Service && this.environment.settings.enableDummyService) Service = DummyService;
78
61
  return Service && new Service(this.activity, (0, _messageHelper.cloneMessage)(message));
79
62
  };
80
-
81
63
  proto._onApiMessage = function onApiMessage(executeMessage, _, message) {
82
64
  const broker = this.broker;
83
-
84
65
  switch (message.properties.type) {
85
66
  case 'discard':
86
67
  {
87
68
  const executionId = executeMessage.content.executionId;
88
69
  broker.cancel(`_api-${executionId}`);
89
70
  const service = this.service;
90
-
91
71
  if (service) {
92
72
  if (service.discard) service.discard(message);else if (service.stop) service.stop(message);
93
73
  }
94
-
95
74
  this.activity.logger.debug(`<${executionId} (${this.id})> discarded`);
96
75
  return broker.publish('execution', 'execute.discard', (0, _messageHelper.cloneContent)(executeMessage.content, {
97
76
  state: 'discard'
98
77
  }));
99
78
  }
100
-
101
79
  case 'stop':
102
80
  {
103
81
  const executionId = executeMessage.content.executionId;
@@ -108,12 +86,10 @@ proto._onApiMessage = function onApiMessage(executeMessage, _, message) {
108
86
  }
109
87
  }
110
88
  };
111
-
112
89
  function DummyService(activity) {
113
90
  this.type = 'dummyservice';
114
91
  this.activity = activity;
115
92
  }
116
-
117
93
  DummyService.prototype.execute = function executeDummyService(...args) {
118
94
  const activity = this.activity;
119
95
  activity.logger.debug(`<${activity.id}> executing dummy service`);
@@ -5,19 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.SignalTaskBehaviour = SignalTaskBehaviour;
7
7
  exports.default = SignalTask;
8
-
9
8
  var _Activity = _interopRequireDefault(require("../activity/Activity"));
10
-
11
9
  var _Errors = require("../error/Errors");
12
-
13
10
  var _messageHelper = require("../messageHelper");
14
-
15
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
-
17
12
  function SignalTask(activityDef, context) {
18
13
  return new _Activity.default(SignalTaskBehaviour, activityDef, context);
19
14
  }
20
-
21
15
  function SignalTaskBehaviour(activity) {
22
16
  const {
23
17
  id,
@@ -30,17 +24,13 @@ function SignalTaskBehaviour(activity) {
30
24
  this.activity = activity;
31
25
  this.broker = activity.broker;
32
26
  }
33
-
34
27
  const proto = SignalTaskBehaviour.prototype;
35
-
36
28
  proto.execute = function execute(executeMessage) {
37
29
  const executeContent = executeMessage.content;
38
30
  const loopCharacteristics = this.loopCharacteristics;
39
-
40
31
  if (loopCharacteristics && executeContent.isRootScope) {
41
32
  return loopCharacteristics.execute(executeMessage);
42
33
  }
43
-
44
34
  const executionId = executeContent.executionId;
45
35
  const broker = this.broker;
46
36
  broker.subscribeTmp('api', `activity.#.${executionId}`, (...args) => this._onApiMessage(executeMessage, ...args), {
@@ -55,7 +45,6 @@ proto.execute = function execute(executeMessage) {
55
45
  state: 'wait'
56
46
  }));
57
47
  };
58
-
59
48
  proto._onDelegatedApiMessage = function onDelegatedApiMessage(executeMessage, routingKey, message) {
60
49
  if (!message.properties.delegate) return;
61
50
  const {
@@ -74,7 +63,8 @@ proto._onDelegatedApiMessage = function onDelegatedApiMessage(executeMessage, ro
74
63
  correlationId
75
64
  } = message.properties;
76
65
  this.broker.publish('event', 'activity.consumed', (0, _messageHelper.cloneContent)(executeContent, {
77
- message: { ...delegateContent.message
66
+ message: {
67
+ ...delegateContent.message
78
68
  }
79
69
  }), {
80
70
  correlationId,
@@ -82,47 +72,38 @@ proto._onDelegatedApiMessage = function onDelegatedApiMessage(executeMessage, ro
82
72
  });
83
73
  return this._onApiMessage(executeMessage, routingKey, message);
84
74
  };
85
-
86
75
  proto._onApiMessage = function onApiMessage(executeMessage, routingKey, message) {
87
76
  const {
88
77
  type: messageType,
89
78
  correlationId
90
79
  } = message.properties;
91
80
  const executeContent = executeMessage.content;
92
-
93
81
  switch (messageType) {
94
82
  case 'stop':
95
83
  return this._stop(executeContent.executionId);
96
-
97
84
  case 'signal':
98
85
  this._stop(executeContent.executionId);
99
-
100
86
  return this.broker.publish('execution', 'execute.completed', (0, _messageHelper.cloneContent)(executeContent, {
101
87
  output: message.content.message,
102
88
  state: 'signal'
103
89
  }), {
104
90
  correlationId
105
91
  });
106
-
107
92
  case 'error':
108
93
  this._stop(executeContent.executionId);
109
-
110
94
  return this.broker.publish('execution', 'execute.error', (0, _messageHelper.cloneContent)(executeContent, {
111
95
  error: new _Errors.ActivityError(message.content.message, executeMessage, message.content)
112
96
  }, {
113
97
  mandatory: true,
114
98
  correlationId
115
99
  }));
116
-
117
100
  case 'discard':
118
101
  this._stop(executeContent.executionId);
119
-
120
102
  return this.broker.publish('execution', 'execute.discard', (0, _messageHelper.cloneContent)(executeContent), {
121
103
  correlationId
122
104
  });
123
105
  }
124
106
  };
125
-
126
107
  proto._stop = function stop(executionId) {
127
108
  const broker = this.broker;
128
109
  broker.cancel(`_api-${executionId}`);
@@ -4,19 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = StandardLoopCharacteristics;
7
-
8
7
  var _LoopCharacteristics = _interopRequireDefault(require("./LoopCharacteristics"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
9
  function StandardLoopCharacteristics(activity, loopCharacteristics) {
13
10
  let {
14
11
  behaviour
15
12
  } = loopCharacteristics;
16
- behaviour = { ...behaviour,
13
+ behaviour = {
14
+ ...behaviour,
17
15
  isSequential: true
18
16
  };
19
- return new _LoopCharacteristics.default(activity, { ...loopCharacteristics,
17
+ return new _LoopCharacteristics.default(activity, {
18
+ ...loopCharacteristics,
20
19
  behaviour
21
20
  });
22
21
  }