bpmn-elements 8.2.4 → 9.1.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.
- package/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/dist/{src/Api.js → Api.js} +11 -12
- package/dist/{src/Context.js → Context.js} +26 -27
- package/dist/{src/Environment.js → Environment.js} +15 -16
- package/dist/{src/EventBroker.js → EventBroker.js} +5 -1
- package/dist/{src/Expressions.js → Expressions.js} +1 -1
- package/dist/{src/MessageFormatter.js → MessageFormatter.js} +3 -3
- package/dist/Tracker.js +89 -0
- package/dist/{src/activity → activity}/Activity.js +109 -120
- package/dist/{src/activity → activity}/ActivityExecution.js +28 -32
- package/dist/{src/activity → activity}/Dummy.js +1 -1
- package/dist/{src/activity → activity}/ExecutionScope.js +2 -2
- package/dist/{src/definition → definition}/Definition.js +64 -59
- package/dist/{src/definition → definition}/DefinitionExecution.js +68 -46
- package/dist/{src/error → error}/Errors.js +1 -1
- package/dist/eventDefinitions/CancelEventDefinition.js +127 -0
- package/dist/{src/eventDefinitions → eventDefinitions}/CompensateEventDefinition.js +64 -52
- package/dist/{src/eventDefinitions → eventDefinitions}/ConditionalEventDefinition.js +24 -16
- package/dist/{src/eventDefinitions → eventDefinitions}/ErrorEventDefinition.js +15 -14
- package/dist/{src/eventDefinitions → eventDefinitions}/EscalationEventDefinition.js +12 -13
- package/dist/{src/eventDefinitions → eventDefinitions}/EventDefinitionExecution.js +10 -11
- package/dist/{src/eventDefinitions → eventDefinitions}/LinkEventDefinition.js +14 -15
- package/dist/{src/eventDefinitions → eventDefinitions}/MessageEventDefinition.js +13 -14
- package/dist/{src/eventDefinitions → eventDefinitions}/SignalEventDefinition.js +13 -14
- package/dist/{src/eventDefinitions → eventDefinitions}/TerminateEventDefinition.js +1 -1
- package/dist/{src/eventDefinitions → eventDefinitions}/TimerEventDefinition.js +15 -16
- package/dist/{src/events → events}/BoundaryEvent.js +39 -25
- package/dist/{src/events → events}/EndEvent.js +3 -3
- package/dist/{src/events → events}/IntermediateCatchEvent.js +3 -3
- package/dist/{src/events → events}/IntermediateThrowEvent.js +3 -3
- package/dist/{src/events → events}/StartEvent.js +8 -9
- package/dist/{src/flows → flows}/Association.js +14 -22
- package/dist/{src/flows → flows}/MessageFlow.js +16 -14
- package/dist/{src/flows → flows}/SequenceFlow.js +16 -18
- package/dist/{src/gateways → gateways}/EventBasedGateway.js +3 -4
- package/dist/{src/gateways → gateways}/ExclusiveGateway.js +2 -2
- package/dist/{src/gateways → gateways}/InclusiveGateway.js +2 -2
- package/dist/{src/gateways → gateways}/ParallelGateway.js +2 -2
- package/dist/index.js +48 -48
- package/dist/{src/io → io}/InputOutputSpecification.js +8 -9
- package/dist/{src/io → io}/Properties.js +7 -8
- package/dist/package.json +3 -0
- package/dist/{src/process → process}/Process.js +44 -40
- package/dist/{src/process → process}/ProcessExecution.js +169 -78
- package/dist/{src/tasks → tasks}/CallActivity.js +7 -8
- package/dist/{src/tasks → tasks}/LoopCharacteristics.js +2 -2
- package/dist/{src/tasks → tasks}/ReceiveTask.js +14 -15
- package/dist/{src/tasks → tasks}/ScriptTask.js +4 -4
- package/dist/{src/tasks → tasks}/ServiceImplementation.js +1 -1
- package/dist/{src/tasks → tasks}/ServiceTask.js +6 -7
- package/dist/{src/tasks → tasks}/SignalTask.js +7 -8
- package/dist/{src/tasks → tasks}/StandardLoopCharacteristics.js +1 -1
- package/dist/{src/tasks → tasks}/SubProcess.js +19 -19
- package/dist/{src/tasks → tasks}/Task.js +2 -2
- package/dist/{src/tasks → tasks}/Transaction.js +1 -1
- package/package.json +31 -31
- package/src/Api.js +11 -13
- package/src/Context.js +26 -28
- package/src/Environment.js +15 -17
- package/src/EventBroker.js +2 -1
- package/src/Expressions.js +1 -1
- package/src/MessageFormatter.js +3 -3
- package/src/Tracker.js +73 -0
- package/src/activity/Activity.js +106 -114
- package/src/activity/ActivityExecution.js +28 -32
- package/src/activity/Dummy.js +1 -1
- package/src/activity/ExecutionScope.js +2 -2
- package/src/definition/Definition.js +65 -64
- package/src/definition/DefinitionExecution.js +71 -47
- package/src/error/Errors.js +1 -1
- package/src/eventDefinitions/CancelEventDefinition.js +32 -78
- package/src/eventDefinitions/CompensateEventDefinition.js +58 -52
- package/src/eventDefinitions/ConditionalEventDefinition.js +25 -17
- package/src/eventDefinitions/ErrorEventDefinition.js +15 -15
- package/src/eventDefinitions/EscalationEventDefinition.js +12 -14
- package/src/eventDefinitions/EventDefinitionExecution.js +10 -12
- package/src/eventDefinitions/LinkEventDefinition.js +14 -16
- package/src/eventDefinitions/MessageEventDefinition.js +13 -15
- package/src/eventDefinitions/SignalEventDefinition.js +13 -15
- package/src/eventDefinitions/TerminateEventDefinition.js +1 -1
- package/src/eventDefinitions/TimerEventDefinition.js +15 -17
- package/src/events/BoundaryEvent.js +34 -24
- package/src/events/EndEvent.js +3 -3
- package/src/events/IntermediateCatchEvent.js +3 -3
- package/src/events/IntermediateThrowEvent.js +3 -3
- package/src/events/StartEvent.js +8 -10
- package/src/flows/Association.js +14 -26
- package/src/flows/MessageFlow.js +14 -15
- package/src/flows/SequenceFlow.js +16 -20
- package/src/gateways/EventBasedGateway.js +3 -4
- package/src/gateways/ExclusiveGateway.js +2 -2
- package/src/gateways/InclusiveGateway.js +2 -2
- package/src/gateways/ParallelGateway.js +2 -2
- package/src/index.js +106 -0
- package/src/io/InputOutputSpecification.js +8 -10
- package/src/io/Properties.js +7 -9
- package/src/process/Process.js +45 -41
- package/src/process/ProcessExecution.js +167 -79
- package/src/tasks/CallActivity.js +7 -9
- package/src/tasks/LoopCharacteristics.js +2 -2
- package/src/tasks/ReceiveTask.js +215 -217
- package/src/tasks/ScriptTask.js +4 -4
- package/src/tasks/ServiceImplementation.js +1 -1
- package/src/tasks/ServiceTask.js +6 -8
- package/src/tasks/SignalTask.js +7 -9
- package/src/tasks/StandardLoopCharacteristics.js +1 -1
- package/src/tasks/SubProcess.js +19 -20
- package/src/tasks/Task.js +2 -2
- package/src/tasks/Transaction.js +1 -1
- package/types/index.d.ts +520 -0
- package/dist/src/eventDefinitions/CancelEventDefinition.js +0 -184
- package/index.js +0 -106
- /package/dist/{src/ExtensionsMapper.js → ExtensionsMapper.js} +0 -0
- /package/dist/{src/Scripts.js → Scripts.js} +0 -0
- /package/dist/{src/Timers.js → Timers.js} +0 -0
- /package/dist/{src/activity → activity}/Escalation.js +0 -0
- /package/dist/{src/activity → activity}/Message.js +0 -0
- /package/dist/{src/activity → activity}/Signal.js +0 -0
- /package/dist/{src/error → error}/BpmnError.js +0 -0
- /package/dist/{src/getPropertyValue.js → getPropertyValue.js} +0 -0
- /package/dist/{src/io → io}/BpmnIO.js +0 -0
- /package/dist/{src/io → io}/EnvironmentDataObject.js +0 -0
- /package/dist/{src/io → io}/EnvironmentDataStore.js +0 -0
- /package/dist/{src/io → io}/EnvironmentDataStoreReference.js +0 -0
- /package/dist/{src/messageHelper.js → messageHelper.js} +0 -0
- /package/dist/{src/shared.js → shared.js} +0 -0
package/src/flows/Association.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {cloneParent} from '../messageHelper';
|
|
2
|
-
import {EventBroker} from '../EventBroker';
|
|
3
|
-
import {
|
|
4
|
-
import {getUniqueId} from '../shared';
|
|
1
|
+
import {cloneParent} from '../messageHelper.js';
|
|
2
|
+
import {EventBroker} from '../EventBroker.js';
|
|
3
|
+
import {Api} from '../Api.js';
|
|
4
|
+
import {getUniqueId} from '../shared.js';
|
|
5
5
|
|
|
6
6
|
const kCounters = Symbol.for('counters');
|
|
7
7
|
|
|
@@ -20,7 +20,6 @@ export default function Association(associationDef, {environment}) {
|
|
|
20
20
|
const logger = this.logger = environment.Logger(type.toLowerCase());
|
|
21
21
|
|
|
22
22
|
this[kCounters] = {
|
|
23
|
-
complete: 0,
|
|
24
23
|
take: 0,
|
|
25
24
|
discard: 0,
|
|
26
25
|
};
|
|
@@ -34,16 +33,14 @@ export default function Association(associationDef, {environment}) {
|
|
|
34
33
|
logger.debug(`<${id}> init, <${sourceId}> -> <${targetId}>`);
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Object.defineProperty(proto, 'counters', {
|
|
36
|
+
Object.defineProperty(Association.prototype, 'counters', {
|
|
40
37
|
enumerable: true,
|
|
41
38
|
get() {
|
|
42
39
|
return {...this[kCounters]};
|
|
43
40
|
},
|
|
44
41
|
});
|
|
45
42
|
|
|
46
|
-
|
|
43
|
+
Association.prototype.take = function take(content = {}) {
|
|
47
44
|
this.logger.debug(`<${this.id}> take target <${this.targetId}>`);
|
|
48
45
|
++this[kCounters].take;
|
|
49
46
|
|
|
@@ -52,7 +49,7 @@ proto.take = function take(content = {}) {
|
|
|
52
49
|
return true;
|
|
53
50
|
};
|
|
54
51
|
|
|
55
|
-
|
|
52
|
+
Association.prototype.discard = function discard(content = {}) {
|
|
56
53
|
this.logger.debug(`<${this.id}> discard target <${this.targetId}>`);
|
|
57
54
|
++this[kCounters].discard;
|
|
58
55
|
|
|
@@ -61,36 +58,27 @@ proto.discard = function discard(content = {}) {
|
|
|
61
58
|
return true;
|
|
62
59
|
};
|
|
63
60
|
|
|
64
|
-
|
|
65
|
-
this.logger.debug(`<${this.id}> completed target <${this.targetId}>`);
|
|
66
|
-
++this[kCounters].complete;
|
|
67
|
-
|
|
68
|
-
this._publishEvent('complete', content);
|
|
69
|
-
|
|
70
|
-
return true;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
proto.getState = function getState() {
|
|
61
|
+
Association.prototype.getState = function getState() {
|
|
74
62
|
return this._createMessageContent({
|
|
75
63
|
counters: this.counters,
|
|
76
64
|
broker: this.broker.getState(true),
|
|
77
65
|
});
|
|
78
66
|
};
|
|
79
67
|
|
|
80
|
-
|
|
68
|
+
Association.prototype.recover = function recover(state) {
|
|
81
69
|
Object.assign(this[kCounters], state.counters);
|
|
82
70
|
this.broker.recover(state.broker);
|
|
83
71
|
};
|
|
84
72
|
|
|
85
|
-
|
|
86
|
-
return
|
|
73
|
+
Association.prototype.getApi = function getApi(message) {
|
|
74
|
+
return new Api('association', this.broker, message || {content: this._createMessageContent()});
|
|
87
75
|
};
|
|
88
76
|
|
|
89
|
-
|
|
77
|
+
Association.prototype.stop = function stop() {
|
|
90
78
|
this.broker.stop();
|
|
91
79
|
};
|
|
92
80
|
|
|
93
|
-
|
|
81
|
+
Association.prototype._publishEvent = function publishEvent(action, content) {
|
|
94
82
|
const eventContent = this._createMessageContent({
|
|
95
83
|
action,
|
|
96
84
|
message: content,
|
|
@@ -100,7 +88,7 @@ proto._publishEvent = function publishEvent(action, content) {
|
|
|
100
88
|
this.broker.publish('event', `association.${action}`, eventContent, {type: action});
|
|
101
89
|
};
|
|
102
90
|
|
|
103
|
-
|
|
91
|
+
Association.prototype._createMessageContent = function createMessageContent(override) {
|
|
104
92
|
return {
|
|
105
93
|
...override,
|
|
106
94
|
id: this.id,
|
package/src/flows/MessageFlow.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {brokerSafeId} from '../shared';
|
|
2
|
-
import {cloneParent} from '../messageHelper';
|
|
3
|
-
import {MessageFlowBroker} from '../EventBroker';
|
|
1
|
+
import {brokerSafeId} from '../shared.js';
|
|
2
|
+
import {cloneParent} from '../messageHelper.js';
|
|
3
|
+
import {MessageFlowBroker} from '../EventBroker.js';
|
|
4
|
+
import {Api} from '../Api.js';
|
|
4
5
|
|
|
5
6
|
const kCounters = Symbol.for('counters');
|
|
6
7
|
const kSourceElement = Symbol.for('sourceElement');
|
|
@@ -33,16 +34,14 @@ export default function MessageFlow(flowDef, context) {
|
|
|
33
34
|
this.logger = context.environment.Logger(type.toLowerCase());
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Object.defineProperty(proto, 'counters', {
|
|
37
|
+
Object.defineProperty(MessageFlow.prototype, 'counters', {
|
|
39
38
|
enumerable: true,
|
|
40
39
|
get() {
|
|
41
40
|
return {...this[kCounters]};
|
|
42
41
|
},
|
|
43
42
|
});
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
MessageFlow.prototype.getState = function getState() {
|
|
46
45
|
return {
|
|
47
46
|
id: this.id,
|
|
48
47
|
type: this.type,
|
|
@@ -50,37 +49,37 @@ proto.getState = function getState() {
|
|
|
50
49
|
};
|
|
51
50
|
};
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
MessageFlow.prototype.recover = function recover(state) {
|
|
54
53
|
Object.assign(this[kCounters], state.counters);
|
|
55
54
|
};
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
return this;
|
|
56
|
+
MessageFlow.prototype.getApi = function getApi(message) {
|
|
57
|
+
return new Api('message', this.broker, message || {content: this._createMessageContent()});
|
|
59
58
|
};
|
|
60
59
|
|
|
61
|
-
|
|
60
|
+
MessageFlow.prototype.activate = function activate() {
|
|
62
61
|
const sourceElement = this[kSourceElement];
|
|
63
62
|
const safeId = brokerSafeId(this.id);
|
|
64
63
|
sourceElement.on('message', this.deactivate.bind(this), {consumerTag: `_message-on-message-${safeId}`});
|
|
65
64
|
sourceElement.on('end', this._onSourceEnd.bind(this), {consumerTag: `_message-on-end-${safeId}`});
|
|
66
65
|
};
|
|
67
66
|
|
|
68
|
-
|
|
67
|
+
MessageFlow.prototype.deactivate = function deactivate() {
|
|
69
68
|
const sourceElement = this[kSourceElement];
|
|
70
69
|
const safeId = brokerSafeId(this.id);
|
|
71
70
|
sourceElement.broker.cancel(`_message-on-end-${safeId}`);
|
|
72
71
|
sourceElement.broker.cancel(`_message-on-message-${safeId}`);
|
|
73
72
|
};
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
MessageFlow.prototype._onSourceEnd = function onSourceEnd({content}) {
|
|
76
75
|
++this[kCounters].messages;
|
|
77
76
|
const source = this.source;
|
|
78
77
|
const target = this.target;
|
|
79
78
|
this.logger.debug(`<${this.id}> sending message from <${source.processId}.${source.id}> to <${target.id ? `${target.processId}.${target.id}` : target.processId}>`);
|
|
80
|
-
this.broker.publish('event', 'message.outbound', this.
|
|
79
|
+
this.broker.publish('event', 'message.outbound', this._createMessageContent(content.message));
|
|
81
80
|
};
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
MessageFlow.prototype._createMessageContent = function createMessage(message) {
|
|
84
83
|
return {
|
|
85
84
|
id: this.id,
|
|
86
85
|
type: this.type,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ExecutionScope from '../activity/ExecutionScope';
|
|
2
|
-
import {cloneParent, cloneContent} from '../messageHelper';
|
|
3
|
-
import {getUniqueId} from '../shared';
|
|
4
|
-
import {EventBroker} from '../EventBroker';
|
|
5
|
-
import {FlowApi} from '../Api';
|
|
1
|
+
import ExecutionScope from '../activity/ExecutionScope.js';
|
|
2
|
+
import {cloneParent, cloneContent} from '../messageHelper.js';
|
|
3
|
+
import {getUniqueId} from '../shared.js';
|
|
4
|
+
import {EventBroker} from '../EventBroker.js';
|
|
5
|
+
import {FlowApi} from '../Api.js';
|
|
6
6
|
|
|
7
7
|
const kCounters = Symbol.for('counters');
|
|
8
8
|
|
|
@@ -40,18 +40,14 @@ function SequenceFlow(flowDef, {environment}) {
|
|
|
40
40
|
logger.debug(`<${id}> init, <${sourceId}> -> <${targetId}>`);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Object.defineProperty(proto, 'counters', {
|
|
43
|
+
Object.defineProperty(SequenceFlow.prototype, 'counters', {
|
|
46
44
|
enumerable: true,
|
|
47
45
|
get() {
|
|
48
46
|
return {...this[kCounters]};
|
|
49
47
|
},
|
|
50
48
|
});
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
this.looped = undefined;
|
|
54
|
-
|
|
50
|
+
SequenceFlow.prototype.take = function take(content = {}) {
|
|
55
51
|
const {sequenceId} = content;
|
|
56
52
|
|
|
57
53
|
this.logger.debug(`<${sequenceId} (${this.id})> take, target <${this.targetId}>`);
|
|
@@ -62,7 +58,7 @@ proto.take = function take(content = {}) {
|
|
|
62
58
|
return true;
|
|
63
59
|
};
|
|
64
60
|
|
|
65
|
-
|
|
61
|
+
SequenceFlow.prototype.discard = function discard(content = {}) {
|
|
66
62
|
const {sequenceId = getUniqueId(this.id)} = content;
|
|
67
63
|
const discardSequence = content.discardSequence = (content.discardSequence || []).slice();
|
|
68
64
|
if (discardSequence.indexOf(this.targetId) > -1) {
|
|
@@ -78,27 +74,27 @@ proto.discard = function discard(content = {}) {
|
|
|
78
74
|
this._publishEvent('discard', content);
|
|
79
75
|
};
|
|
80
76
|
|
|
81
|
-
|
|
77
|
+
SequenceFlow.prototype.getState = function getState() {
|
|
82
78
|
return this.createMessage({
|
|
83
79
|
counters: this.counters,
|
|
84
80
|
broker: this.broker.getState(true),
|
|
85
81
|
});
|
|
86
82
|
};
|
|
87
83
|
|
|
88
|
-
|
|
84
|
+
SequenceFlow.prototype.recover = function recover(state) {
|
|
89
85
|
Object.assign(this[kCounters], state.counters);
|
|
90
86
|
this.broker.recover(state.broker);
|
|
91
87
|
};
|
|
92
88
|
|
|
93
|
-
|
|
89
|
+
SequenceFlow.prototype.getApi = function getApi(message) {
|
|
94
90
|
return FlowApi(this.broker, message || {content: this.createMessage()});
|
|
95
91
|
};
|
|
96
92
|
|
|
97
|
-
|
|
93
|
+
SequenceFlow.prototype.stop = function stop() {
|
|
98
94
|
this.broker.stop();
|
|
99
95
|
};
|
|
100
96
|
|
|
101
|
-
|
|
97
|
+
SequenceFlow.prototype.shake = function shake(message) {
|
|
102
98
|
const content = cloneContent(message.content);
|
|
103
99
|
content.sequence = content.sequence || [];
|
|
104
100
|
content.sequence.push({id: this.id, type: this.type, isSequenceFlow: true, targetId: this.targetId});
|
|
@@ -112,7 +108,7 @@ proto.shake = function shake(message) {
|
|
|
112
108
|
this.broker.publish('event', 'flow.shake', content, {persistent: false, type: 'shake'});
|
|
113
109
|
};
|
|
114
110
|
|
|
115
|
-
|
|
111
|
+
SequenceFlow.prototype.getCondition = function getCondition() {
|
|
116
112
|
const conditionExpression = this.behaviour.conditionExpression;
|
|
117
113
|
if (!conditionExpression) return null;
|
|
118
114
|
|
|
@@ -130,7 +126,7 @@ proto.getCondition = function getCondition() {
|
|
|
130
126
|
return new ExpressionCondition(this, conditionExpression.body);
|
|
131
127
|
};
|
|
132
128
|
|
|
133
|
-
|
|
129
|
+
SequenceFlow.prototype.createMessage = function createMessage(override) {
|
|
134
130
|
return {
|
|
135
131
|
...override,
|
|
136
132
|
id: this.id,
|
|
@@ -144,7 +140,7 @@ proto.createMessage = function createMessage(override) {
|
|
|
144
140
|
};
|
|
145
141
|
};
|
|
146
142
|
|
|
147
|
-
|
|
143
|
+
SequenceFlow.prototype._publishEvent = function publishEvent(action, content) {
|
|
148
144
|
const eventContent = this.createMessage({
|
|
149
145
|
action,
|
|
150
146
|
...content,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Activity from '../activity/Activity';
|
|
2
|
-
import {cloneContent} from '../messageHelper';
|
|
1
|
+
import Activity from '../activity/Activity.js';
|
|
2
|
+
import {cloneContent} from '../messageHelper.js';
|
|
3
3
|
|
|
4
4
|
const kCompleted = Symbol.for('completed');
|
|
5
5
|
const kTargets = Symbol.for('targets');
|
|
@@ -40,7 +40,6 @@ EventBasedGatewayBehaviour.prototype.execute = function execute(executeMessage)
|
|
|
40
40
|
|
|
41
41
|
const broker = this.activity.broker;
|
|
42
42
|
broker.subscribeOnce('api', `activity.stop.${executionId}`, () => this._stop(), {
|
|
43
|
-
noAck: true,
|
|
44
43
|
consumerTag: '_api-stop-execution',
|
|
45
44
|
});
|
|
46
45
|
|
|
@@ -49,7 +48,7 @@ EventBasedGatewayBehaviour.prototype.execute = function execute(executeMessage)
|
|
|
49
48
|
};
|
|
50
49
|
|
|
51
50
|
EventBasedGatewayBehaviour.prototype._onTargetCompleted = function onTargetCompleted(executeMessage, _, message, owner) {
|
|
52
|
-
const {id: targetId,
|
|
51
|
+
const {id: targetId, executionId: targetExecutionId} = message.content;
|
|
53
52
|
const executeContent = executeMessage.content;
|
|
54
53
|
const executionId = executeContent.executionId;
|
|
55
54
|
this.activity.logger.debug(`<${executionId} (${this.id})> <${targetExecutionId}> completed run, discarding the rest`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Activity from '../activity/Activity';
|
|
2
|
-
import {cloneContent} from '../messageHelper';
|
|
1
|
+
import Activity from '../activity/Activity.js';
|
|
2
|
+
import {cloneContent} from '../messageHelper.js';
|
|
3
3
|
|
|
4
4
|
export default function ExclusiveGateway(activityDef, context) {
|
|
5
5
|
return new Activity(ExclusiveGatewayBehaviour, activityDef, context);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Activity from '../activity/Activity';
|
|
2
|
-
import {cloneContent} from '../messageHelper';
|
|
1
|
+
import Activity from '../activity/Activity.js';
|
|
2
|
+
import {cloneContent} from '../messageHelper.js';
|
|
3
3
|
|
|
4
4
|
export default function InclusiveGateway(activityDef, context) {
|
|
5
5
|
return new Activity(InclusiveGatewayBehaviour, activityDef, context);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Activity from '../activity/Activity';
|
|
2
|
-
import {cloneContent} from '../messageHelper';
|
|
1
|
+
import Activity from '../activity/Activity.js';
|
|
2
|
+
import {cloneContent} from '../messageHelper.js';
|
|
3
3
|
|
|
4
4
|
export default function ParallelGateway(activityDef, context) {
|
|
5
5
|
return new Activity(ParallelGatewayBehaviour, {...activityDef, isParallelGateway: true}, context);
|
package/src/index.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import Activity from './activity/Activity.js';
|
|
2
|
+
import Association from './flows/Association.js';
|
|
3
|
+
import BoundaryEvent from './events/BoundaryEvent.js';
|
|
4
|
+
import BpmnError from './error/BpmnError.js';
|
|
5
|
+
import CallActivity from './tasks/CallActivity.js';
|
|
6
|
+
import CancelEventDefinition from './eventDefinitions/CancelEventDefinition.js';
|
|
7
|
+
import CompensateEventDefinition from './eventDefinitions/CompensateEventDefinition.js';
|
|
8
|
+
import ConditionalEventDefinition from './eventDefinitions/ConditionalEventDefinition.js';
|
|
9
|
+
import Context from './Context.js';
|
|
10
|
+
import DataObject from './io/EnvironmentDataObject.js';
|
|
11
|
+
import DataStore from './io/EnvironmentDataStore.js';
|
|
12
|
+
import DataStoreReference from './io/EnvironmentDataStoreReference.js';
|
|
13
|
+
import Definition from './definition/Definition.js';
|
|
14
|
+
import Dummy from './activity/Dummy.js';
|
|
15
|
+
import EndEvent from './events/EndEvent.js';
|
|
16
|
+
import Environment from './Environment.js';
|
|
17
|
+
import ErrorEventDefinition from './eventDefinitions/ErrorEventDefinition.js';
|
|
18
|
+
import Escalation from './activity/Escalation.js';
|
|
19
|
+
import EscalationEventDefinition from './eventDefinitions/EscalationEventDefinition.js';
|
|
20
|
+
import EventBasedGateway from './gateways/EventBasedGateway.js';
|
|
21
|
+
import ExclusiveGateway from './gateways/ExclusiveGateway.js';
|
|
22
|
+
import InclusiveGateway from './gateways/InclusiveGateway.js';
|
|
23
|
+
import InputOutputSpecification from './io/InputOutputSpecification.js';
|
|
24
|
+
import IntermediateCatchEvent from './events/IntermediateCatchEvent.js';
|
|
25
|
+
import IntermediateThrowEvent from './events/IntermediateThrowEvent.js';
|
|
26
|
+
import LinkEventDefinition from './eventDefinitions/LinkEventDefinition.js';
|
|
27
|
+
import LoopCharacteristics from './tasks/LoopCharacteristics.js';
|
|
28
|
+
import Message from './activity/Message.js';
|
|
29
|
+
import MessageEventDefinition from './eventDefinitions/MessageEventDefinition.js';
|
|
30
|
+
import MessageFlow from './flows/MessageFlow.js';
|
|
31
|
+
import ParallelGateway from './gateways/ParallelGateway.js';
|
|
32
|
+
import Process from './process/Process.js';
|
|
33
|
+
import Properties from './io/Properties.js';
|
|
34
|
+
import ReceiveTask from './tasks/ReceiveTask.js';
|
|
35
|
+
import ScriptTask from './tasks/ScriptTask.js';
|
|
36
|
+
import SequenceFlow from './flows/SequenceFlow.js';
|
|
37
|
+
import ServiceImplementation from './tasks/ServiceImplementation.js';
|
|
38
|
+
import ServiceTask from './tasks/ServiceTask.js';
|
|
39
|
+
import Signal from './activity/Signal.js';
|
|
40
|
+
import SignalEventDefinition from './eventDefinitions/SignalEventDefinition.js';
|
|
41
|
+
import SignalTask from './tasks/SignalTask.js';
|
|
42
|
+
import StandardLoopCharacteristics from './tasks/StandardLoopCharacteristics.js';
|
|
43
|
+
import StartEvent from './events/StartEvent.js';
|
|
44
|
+
import SubProcess from './tasks/SubProcess.js';
|
|
45
|
+
import Task from './tasks/Task.js';
|
|
46
|
+
import TerminateEventDefinition from './eventDefinitions/TerminateEventDefinition.js';
|
|
47
|
+
import TimerEventDefinition from './eventDefinitions/TimerEventDefinition.js';
|
|
48
|
+
import Transaction from './tasks/Transaction.js';
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
Association,
|
|
52
|
+
Activity,
|
|
53
|
+
BoundaryEvent,
|
|
54
|
+
BpmnError,
|
|
55
|
+
CallActivity,
|
|
56
|
+
CancelEventDefinition,
|
|
57
|
+
CompensateEventDefinition,
|
|
58
|
+
ConditionalEventDefinition,
|
|
59
|
+
Context,
|
|
60
|
+
DataObject,
|
|
61
|
+
DataStore,
|
|
62
|
+
DataStoreReference,
|
|
63
|
+
Definition,
|
|
64
|
+
Dummy,
|
|
65
|
+
Dummy as TextAnnotation,
|
|
66
|
+
Dummy as Group,
|
|
67
|
+
Dummy as Category,
|
|
68
|
+
EndEvent,
|
|
69
|
+
Environment,
|
|
70
|
+
ErrorEventDefinition,
|
|
71
|
+
Escalation,
|
|
72
|
+
EscalationEventDefinition,
|
|
73
|
+
EventBasedGateway,
|
|
74
|
+
ExclusiveGateway,
|
|
75
|
+
InclusiveGateway,
|
|
76
|
+
InputOutputSpecification,
|
|
77
|
+
IntermediateCatchEvent,
|
|
78
|
+
IntermediateThrowEvent,
|
|
79
|
+
LinkEventDefinition,
|
|
80
|
+
Message,
|
|
81
|
+
MessageEventDefinition,
|
|
82
|
+
MessageFlow,
|
|
83
|
+
LoopCharacteristics as MultiInstanceLoopCharacteristics,
|
|
84
|
+
ParallelGateway,
|
|
85
|
+
Process,
|
|
86
|
+
Properties,
|
|
87
|
+
ReceiveTask,
|
|
88
|
+
ScriptTask,
|
|
89
|
+
SequenceFlow,
|
|
90
|
+
ServiceImplementation,
|
|
91
|
+
ServiceTask as SendTask,
|
|
92
|
+
ServiceTask as BusinessRuleTask,
|
|
93
|
+
ServiceTask,
|
|
94
|
+
Signal,
|
|
95
|
+
SignalEventDefinition,
|
|
96
|
+
SignalTask as ManualTask,
|
|
97
|
+
SignalTask as UserTask,
|
|
98
|
+
SignalTask,
|
|
99
|
+
StandardLoopCharacteristics,
|
|
100
|
+
StartEvent,
|
|
101
|
+
SubProcess,
|
|
102
|
+
Task,
|
|
103
|
+
TerminateEventDefinition,
|
|
104
|
+
TimerEventDefinition,
|
|
105
|
+
Transaction,
|
|
106
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import getPropertyValue from '../getPropertyValue';
|
|
2
|
-
import {brokerSafeId} from '../shared';
|
|
1
|
+
import getPropertyValue from '../getPropertyValue.js';
|
|
2
|
+
import {brokerSafeId} from '../shared.js';
|
|
3
3
|
|
|
4
4
|
const kConsuming = Symbol.for('consuming');
|
|
5
5
|
|
|
@@ -13,9 +13,7 @@ export default function IoSpecification(activity, ioSpecificationDef, context) {
|
|
|
13
13
|
this.context = context;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
proto.activate = function activate(message) {
|
|
16
|
+
IoSpecification.prototype.activate = function activate(message) {
|
|
19
17
|
if (this[kConsuming]) return;
|
|
20
18
|
if (message && message.fields.redelivered && message.fields.routingKey === 'run.start') {
|
|
21
19
|
this._onFormatEnter();
|
|
@@ -26,11 +24,11 @@ proto.activate = function activate(message) {
|
|
|
26
24
|
this[kConsuming] = this.broker.subscribeTmp('event', 'activity.#', this._onActivityEvent.bind(this), {noAck: true});
|
|
27
25
|
};
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
IoSpecification.prototype.deactivate = function deactivate() {
|
|
30
28
|
if (this[kConsuming]) this[kConsuming] = this[kConsuming].cancel();
|
|
31
29
|
};
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
IoSpecification.prototype._onActivityEvent = function onActivityEvent(routingKey, message) {
|
|
34
32
|
const {dataInputs, dataOutputs} = this.behaviour;
|
|
35
33
|
if ((dataInputs || dataOutputs) && routingKey === 'activity.enter') {
|
|
36
34
|
return this._onFormatEnter();
|
|
@@ -41,7 +39,7 @@ proto._onActivityEvent = function onActivityEvent(routingKey, message) {
|
|
|
41
39
|
}
|
|
42
40
|
};
|
|
43
41
|
|
|
44
|
-
|
|
42
|
+
IoSpecification.prototype._onFormatEnter = function onFormatOnEnter() {
|
|
45
43
|
const safeType = brokerSafeId(this.type).toLowerCase();
|
|
46
44
|
const startRoutingKey = `run.onstart.${safeType}`;
|
|
47
45
|
const {dataInputs, dataOutputs} = this.behaviour;
|
|
@@ -105,7 +103,7 @@ proto._onFormatEnter = function onFormatOnEnter() {
|
|
|
105
103
|
});
|
|
106
104
|
};
|
|
107
105
|
|
|
108
|
-
|
|
106
|
+
IoSpecification.prototype._onFormatComplete = function formatOnComplete(message) {
|
|
109
107
|
const safeType = brokerSafeId(this.type).toLowerCase();
|
|
110
108
|
const messageInputs = getPropertyValue(message, 'content.ioSpecification.dataInputs');
|
|
111
109
|
const messageOutputs = getPropertyValue(message, 'content.output.ioSpecification.dataOutputs') || [];
|
|
@@ -173,7 +171,7 @@ proto._onFormatComplete = function formatOnComplete(message) {
|
|
|
173
171
|
});
|
|
174
172
|
};
|
|
175
173
|
|
|
176
|
-
|
|
174
|
+
IoSpecification.prototype._getDataOutputs = function getDataOutputs(dataOutputs) {
|
|
177
175
|
if (!dataOutputs) return;
|
|
178
176
|
return dataOutputs.map((dataOutput) => {
|
|
179
177
|
return {
|
package/src/io/Properties.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import getPropertyValue from '../getPropertyValue';
|
|
1
|
+
import getPropertyValue from '../getPropertyValue.js';
|
|
2
2
|
|
|
3
3
|
const kProperties = Symbol.for('properties');
|
|
4
4
|
const kConsuming = Symbol.for('consuming');
|
|
@@ -57,9 +57,7 @@ export default function Properties(activity, propertiesDef, context) {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
proto.activate = function activate(message) {
|
|
60
|
+
Properties.prototype.activate = function activate(message) {
|
|
63
61
|
if (this[kConsuming]) return;
|
|
64
62
|
if (message.fields.redelivered && message.fields.routingKey === 'run.start') {
|
|
65
63
|
this._onActivityEvent('activity.enter', message);
|
|
@@ -72,11 +70,11 @@ proto.activate = function activate(message) {
|
|
|
72
70
|
this[kConsuming] = this.broker.subscribeTmp('event', 'activity.#', this._onActivityEvent.bind(this), {noAck: true});
|
|
73
71
|
};
|
|
74
72
|
|
|
75
|
-
|
|
73
|
+
Properties.prototype.deactivate = function deactivate() {
|
|
76
74
|
if (this[kConsuming]) this[kConsuming] = this[kConsuming].cancel();
|
|
77
75
|
};
|
|
78
76
|
|
|
79
|
-
|
|
77
|
+
Properties.prototype._onActivityEvent = function onActivityEvent(routingKey, message) {
|
|
80
78
|
switch (routingKey) {
|
|
81
79
|
case 'activity.enter':
|
|
82
80
|
case 'activity.extension.resume':
|
|
@@ -86,7 +84,7 @@ proto._onActivityEvent = function onActivityEvent(routingKey, message) {
|
|
|
86
84
|
}
|
|
87
85
|
};
|
|
88
86
|
|
|
89
|
-
|
|
87
|
+
Properties.prototype._formatOnEnter = function formatOnEnter(message) {
|
|
90
88
|
const startRoutingKey = 'run.enter.bpmn-properties';
|
|
91
89
|
|
|
92
90
|
const dataInputObjects = this[kProperties].dataInputObjects;
|
|
@@ -110,7 +108,7 @@ proto._formatOnEnter = function formatOnEnter(message) {
|
|
|
110
108
|
});
|
|
111
109
|
};
|
|
112
110
|
|
|
113
|
-
|
|
111
|
+
Properties.prototype._formatOnComplete = function formatOnComplete(message) {
|
|
114
112
|
const startRoutingKey = 'run.end.bpmn-properties';
|
|
115
113
|
|
|
116
114
|
const messageOutput = getPropertyValue(message, 'content.output.properties') || {};
|
|
@@ -137,7 +135,7 @@ proto._formatOnComplete = function formatOnComplete(message) {
|
|
|
137
135
|
});
|
|
138
136
|
};
|
|
139
137
|
|
|
140
|
-
|
|
138
|
+
Properties.prototype._getProperties = function getProperties(message, values) {
|
|
141
139
|
let response = {};
|
|
142
140
|
|
|
143
141
|
if (message.content.properties) {
|