bpmn-elements 16.2.0 → 16.2.2
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.
- package/dist/Api.js +1 -1
- package/dist/Context.js +2 -4
- package/dist/Environment.js +3 -3
- package/dist/EventBroker.js +1 -1
- package/dist/MessageFormatter.js +2 -2
- package/dist/Tracker.js +1 -0
- package/dist/activity/Activity.js +19 -13
- package/dist/activity/ActivityExecution.js +2 -2
- package/dist/activity/outbound-evaluator.js +0 -3
- package/dist/definition/Definition.js +4 -4
- package/dist/definition/DefinitionExecution.js +6 -6
- package/dist/error/Errors.js +7 -10
- package/dist/eventDefinitions/CancelEventDefinition.js +1 -2
- package/dist/eventDefinitions/CompensateEventDefinition.js +2 -3
- package/dist/eventDefinitions/ConditionalEventDefinition.js +2 -3
- package/dist/eventDefinitions/ErrorEventDefinition.js +3 -4
- package/dist/eventDefinitions/EscalationEventDefinition.js +1 -2
- package/dist/eventDefinitions/LinkEventDefinition.js +1 -2
- package/dist/eventDefinitions/MessageEventDefinition.js +2 -3
- package/dist/eventDefinitions/SignalEventDefinition.js +2 -3
- package/dist/eventDefinitions/TimerEventDefinition.js +2 -3
- package/dist/events/BoundaryEvent.js +2 -3
- package/dist/events/StartEvent.js +1 -2
- package/dist/flows/Association.js +2 -2
- package/dist/flows/SequenceFlow.js +3 -7
- package/dist/getPropertyValue.js +1 -2
- package/dist/io/EnvironmentDataObject.js +1 -1
- package/dist/io/EnvironmentDataStore.js +1 -1
- package/dist/io/EnvironmentDataStoreReference.js +1 -1
- package/dist/io/InputOutputSpecification.js +2 -2
- package/dist/io/Properties.js +14 -14
- package/dist/process/Process.js +5 -7
- package/dist/process/ProcessExecution.js +13 -13
- package/dist/tasks/CallActivity.js +7 -2
- package/dist/tasks/ServiceTask.js +1 -1
- package/package.json +5 -5
- package/src/Api.js +6 -8
- package/src/Context.js +2 -1
- package/src/Environment.js +3 -3
- package/src/EventBroker.js +6 -8
- package/src/MessageFormatter.js +3 -5
- package/src/Tracker.js +1 -0
- package/src/activity/Activity.js +18 -13
- package/src/activity/ActivityExecution.js +2 -2
- package/src/activity/outbound-evaluator.js +0 -1
- package/src/definition/Definition.js +4 -4
- package/src/definition/DefinitionExecution.js +6 -6
- package/src/error/Errors.js +11 -17
- package/src/eventDefinitions/CancelEventDefinition.js +1 -2
- package/src/eventDefinitions/CompensateEventDefinition.js +2 -3
- package/src/eventDefinitions/ConditionalEventDefinition.js +2 -3
- package/src/eventDefinitions/ErrorEventDefinition.js +3 -4
- package/src/eventDefinitions/EscalationEventDefinition.js +1 -2
- package/src/eventDefinitions/LinkEventDefinition.js +1 -2
- package/src/eventDefinitions/MessageEventDefinition.js +2 -3
- package/src/eventDefinitions/SignalEventDefinition.js +2 -3
- package/src/eventDefinitions/TimerEventDefinition.js +2 -3
- package/src/events/BoundaryEvent.js +2 -3
- package/src/events/StartEvent.js +1 -2
- package/src/flows/Association.js +2 -2
- package/src/flows/SequenceFlow.js +3 -3
- package/src/getPropertyValue.js +1 -3
- package/src/io/EnvironmentDataObject.js +1 -1
- package/src/io/EnvironmentDataStore.js +1 -1
- package/src/io/EnvironmentDataStoreReference.js +1 -1
- package/src/io/InputOutputSpecification.js +2 -2
- package/src/io/Properties.js +14 -14
- package/src/messageHelper.js +6 -8
- package/src/process/Process.js +5 -7
- package/src/process/ProcessExecution.js +13 -13
- package/src/tasks/CallActivity.js +7 -3
- package/src/tasks/ServiceTask.js +1 -1
|
@@ -34,8 +34,8 @@ function ProcessExecution(parentActivity, context) {
|
|
|
34
34
|
associations: context.getAssociations(id),
|
|
35
35
|
flows: context.getSequenceFlows(id),
|
|
36
36
|
outboundMessageFlows: context.getMessageFlows(id),
|
|
37
|
-
startActivities:
|
|
38
|
-
triggeredByEvent:
|
|
37
|
+
startActivities: new Set(),
|
|
38
|
+
triggeredByEvent: new Set(),
|
|
39
39
|
detachedActivities: new Set(),
|
|
40
40
|
startSequences: {},
|
|
41
41
|
};
|
|
@@ -126,7 +126,7 @@ ProcessExecution.prototype.resume = function resume() {
|
|
|
126
126
|
|
|
127
127
|
const { startActivities, detachedActivities, postponed } = this[kElements];
|
|
128
128
|
|
|
129
|
-
if (startActivities.
|
|
129
|
+
if (startActivities.size > 1) {
|
|
130
130
|
for (const a of startActivities) a.shake();
|
|
131
131
|
}
|
|
132
132
|
|
|
@@ -185,7 +185,7 @@ ProcessExecution.prototype.getState = function getState() {
|
|
|
185
185
|
}, []),
|
|
186
186
|
...(flows.length && { flows: flowStates }),
|
|
187
187
|
...(outboundMessageFlows.length && {
|
|
188
|
-
messageFlows: outboundMessageFlows.
|
|
188
|
+
messageFlows: outboundMessageFlows.map((f) => f.getState()).filter(Boolean),
|
|
189
189
|
}),
|
|
190
190
|
...(associations.length && { associations: associations.map((f) => f.getState()).filter(Boolean) }),
|
|
191
191
|
};
|
|
@@ -370,7 +370,7 @@ ProcessExecution.prototype._start = function start() {
|
|
|
370
370
|
this.broker.publish(this._exchangeName, 'execute.start', cloneContent(executeContent));
|
|
371
371
|
|
|
372
372
|
const { startActivities, postponed, detachedActivities } = this[kElements];
|
|
373
|
-
if (startActivities.
|
|
373
|
+
if (startActivities.size > 1) {
|
|
374
374
|
for (const a of startActivities) a.shake();
|
|
375
375
|
}
|
|
376
376
|
|
|
@@ -430,8 +430,8 @@ ProcessExecution.prototype._activate = function activate() {
|
|
|
430
430
|
});
|
|
431
431
|
}
|
|
432
432
|
|
|
433
|
-
startActivities.
|
|
434
|
-
triggeredByEvent.
|
|
433
|
+
startActivities.clear();
|
|
434
|
+
triggeredByEvent.clear();
|
|
435
435
|
|
|
436
436
|
for (const activity of children) {
|
|
437
437
|
if (activity.placeholder) continue;
|
|
@@ -441,8 +441,8 @@ ProcessExecution.prototype._activate = function activate() {
|
|
|
441
441
|
consumerTag: '_process-activity-consumer',
|
|
442
442
|
priority: 200,
|
|
443
443
|
});
|
|
444
|
-
if (activity.isStart) startActivities.
|
|
445
|
-
if (activity.triggeredByEvent) triggeredByEvent.
|
|
444
|
+
if (activity.isStart) startActivities.add(activity);
|
|
445
|
+
if (activity.triggeredByEvent) triggeredByEvent.add(activity);
|
|
446
446
|
}
|
|
447
447
|
|
|
448
448
|
this[kActivated] = true;
|
|
@@ -483,14 +483,14 @@ ProcessExecution.prototype._onDelegateEvent = function onDelegateEvent(message)
|
|
|
483
483
|
let delegate = true;
|
|
484
484
|
|
|
485
485
|
const content = message.content;
|
|
486
|
-
if (content.message
|
|
486
|
+
if (content.message?.id) {
|
|
487
487
|
this._debug(`delegate ${eventType} event with id <${content.message.id}>`);
|
|
488
488
|
} else {
|
|
489
489
|
this._debug(`delegate ${eventType} anonymous event`);
|
|
490
490
|
}
|
|
491
491
|
|
|
492
492
|
for (const activity of this[kElements].triggeredByEvent) {
|
|
493
|
-
if (activity.getStartActivities({ referenceId: content.message
|
|
493
|
+
if (activity.getStartActivities({ referenceId: content.message?.id, referenceType: eventType }).length) {
|
|
494
494
|
delegate = false;
|
|
495
495
|
activity.run(content.message);
|
|
496
496
|
}
|
|
@@ -607,7 +607,7 @@ ProcessExecution.prototype._onChildMessage = function onChildMessage(routingKey,
|
|
|
607
607
|
case 'activity.error': {
|
|
608
608
|
let eventCaughtBy;
|
|
609
609
|
for (const msg of this[kElements].postponed) {
|
|
610
|
-
if (msg.fields.routingKey === 'activity.catch' && msg.content.source
|
|
610
|
+
if (msg.fields.routingKey === 'activity.catch' && msg.content.source?.executionId === content.executionId) {
|
|
611
611
|
eventCaughtBy = msg;
|
|
612
612
|
break;
|
|
613
613
|
}
|
|
@@ -693,7 +693,7 @@ ProcessExecution.prototype._onChildCompleted = function onChildCompleted(message
|
|
|
693
693
|
);
|
|
694
694
|
}
|
|
695
695
|
|
|
696
|
-
if (isEnd && startActivities.
|
|
696
|
+
if (isEnd && startActivities.size) {
|
|
697
697
|
const startSequences = this[kElements].startSequences;
|
|
698
698
|
for (const msg of postponed) {
|
|
699
699
|
const postponedId = msg.content.id;
|
|
@@ -8,7 +8,6 @@ export default function CallActivity(activityDef, context) {
|
|
|
8
8
|
|
|
9
9
|
export function CallActivityBehaviour(activity) {
|
|
10
10
|
const { id, type, behaviour = {} } = activity;
|
|
11
|
-
|
|
12
11
|
this.id = id;
|
|
13
12
|
this.type = type;
|
|
14
13
|
this.calledElement = behaviour.calledElement;
|
|
@@ -60,7 +59,11 @@ CallActivityBehaviour.prototype.execute = function execute(executeMessage) {
|
|
|
60
59
|
);
|
|
61
60
|
broker.subscribeTmp('api', '#.signal.*', (...args) => this._onDelegatedApiMessage(calledElement, executeMessage, ...args), {
|
|
62
61
|
noAck: true,
|
|
63
|
-
consumerTag: `_api-delegated-${executionId}`,
|
|
62
|
+
consumerTag: `_api-delegated-signal-${executionId}`,
|
|
63
|
+
});
|
|
64
|
+
broker.subscribeTmp('api', '#.cancel.*', (...args) => this._onDelegatedApiMessage(calledElement, executeMessage, ...args), {
|
|
65
|
+
noAck: true,
|
|
66
|
+
consumerTag: `_api-delegated-cancel-${executionId}`,
|
|
64
67
|
});
|
|
65
68
|
|
|
66
69
|
broker.publish(
|
|
@@ -176,5 +179,6 @@ CallActivityBehaviour.prototype._onApiMessage = function onApiMessage(calledElem
|
|
|
176
179
|
CallActivityBehaviour.prototype._stop = function stop(executionId) {
|
|
177
180
|
const broker = this.broker;
|
|
178
181
|
broker.cancel(`_api-${executionId}`);
|
|
179
|
-
broker.cancel(`_api-delegated-${executionId}`);
|
|
182
|
+
broker.cancel(`_api-delegated-signal-${executionId}`);
|
|
183
|
+
broker.cancel(`_api-delegated-cancel-${executionId}`);
|
|
180
184
|
};
|
package/src/tasks/ServiceTask.js
CHANGED
|
@@ -73,7 +73,7 @@ ServiceTaskBehaviour.prototype._onApiMessage = function onApiMessage(executeMess
|
|
|
73
73
|
const executionId = executeMessage.content.executionId;
|
|
74
74
|
broker.cancel(`_api-${executionId}`);
|
|
75
75
|
const service = this.service;
|
|
76
|
-
if (service
|
|
76
|
+
if (service?.stop) service.stop(message);
|
|
77
77
|
return this.activity.logger.debug(`<${executionId} (${this.id})> stopped`);
|
|
78
78
|
}
|
|
79
79
|
}
|