bpmn-elements 17.2.2 → 18.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.
- package/README.md +3 -1
- package/dist/Api.js +83 -0
- package/dist/Context.js +228 -22
- package/dist/Environment.js +111 -31
- package/dist/EventBroker.js +57 -1
- package/dist/Expressions.js +3 -4
- package/dist/MessageFormatter.js +29 -16
- package/dist/Timers.js +13 -9
- package/dist/Tracker.js +1 -0
- package/dist/activity/Activity.js +458 -254
- package/dist/activity/ActivityExecution.js +113 -40
- package/dist/activity/Dummy.js +6 -1
- package/dist/activity/Escalation.js +36 -24
- package/dist/activity/ExecutionScope.js +1 -1
- package/dist/activity/Message.js +36 -24
- package/dist/activity/Signal.js +36 -24
- package/dist/activity/outbound-evaluator.js +1 -1
- package/dist/condition.js +12 -6
- package/dist/constants.js +21 -0
- package/dist/definition/Definition.js +182 -64
- package/dist/definition/DefinitionExecution.js +195 -82
- package/dist/error/BpmnError.js +12 -1
- package/dist/error/Errors.js +50 -9
- package/dist/eventDefinitions/CancelEventDefinition.js +29 -11
- package/dist/eventDefinitions/CompensateEventDefinition.js +51 -31
- package/dist/eventDefinitions/ConditionalEventDefinition.js +21 -9
- package/dist/eventDefinitions/ErrorEventDefinition.js +46 -30
- package/dist/eventDefinitions/EscalationEventDefinition.js +44 -27
- package/dist/eventDefinitions/EventDefinitionExecution.js +30 -23
- package/dist/eventDefinitions/LinkEventDefinition.js +45 -120
- package/dist/eventDefinitions/MessageEventDefinition.js +44 -29
- package/dist/eventDefinitions/SignalEventDefinition.js +46 -31
- package/dist/eventDefinitions/TerminateEventDefinition.js +10 -1
- package/dist/eventDefinitions/TimerEventDefinition.js +57 -37
- package/dist/eventDefinitions/index.js +20 -21
- package/dist/events/BoundaryEvent.js +52 -40
- package/dist/events/EndEvent.js +22 -8
- package/dist/events/IntermediateCatchEvent.js +26 -8
- package/dist/events/IntermediateThrowEvent.js +24 -9
- package/dist/events/StartEvent.js +30 -14
- package/dist/events/index.js +10 -11
- package/dist/flows/Association.js +50 -7
- package/dist/flows/MessageFlow.js +49 -10
- package/dist/flows/SequenceFlow.js +93 -22
- package/dist/flows/index.js +6 -7
- package/dist/gateways/EventBasedGateway.js +29 -15
- package/dist/gateways/ExclusiveGateway.js +20 -5
- package/dist/gateways/InclusiveGateway.js +21 -5
- package/dist/gateways/ParallelGateway.js +253 -15
- package/dist/gateways/index.js +8 -9
- package/dist/getPropertyValue.js +2 -2
- package/dist/index.js +42 -43
- package/dist/io/BpmnIO.js +15 -1
- package/dist/io/EnvironmentDataObject.js +29 -1
- package/dist/io/EnvironmentDataStore.js +24 -1
- package/dist/io/EnvironmentDataStoreReference.js +24 -1
- package/dist/io/InputOutputSpecification.js +21 -11
- package/dist/io/Properties.js +28 -17
- package/dist/messageHelper.js +41 -4
- package/dist/process/Lane.js +15 -4
- package/dist/process/Process.js +174 -76
- package/dist/process/ProcessExecution.js +362 -177
- package/dist/shared.js +2 -0
- package/dist/tasks/CallActivity.js +19 -4
- package/dist/tasks/LoopCharacteristics.js +94 -9
- package/dist/tasks/ReceiveTask.js +36 -21
- package/dist/tasks/ScriptTask.js +22 -6
- package/dist/tasks/ServiceImplementation.js +7 -4
- package/dist/tasks/ServiceTask.js +19 -4
- package/dist/tasks/SignalTask.js +19 -4
- package/dist/tasks/StandardLoopCharacteristics.js +8 -4
- package/dist/tasks/SubProcess.js +44 -29
- package/dist/tasks/Task.js +19 -4
- package/dist/tasks/Transaction.js +8 -4
- package/dist/tasks/index.js +16 -18
- package/package.json +31 -13
- package/src/Api.js +70 -0
- package/src/Context.js +200 -19
- package/src/Environment.js +99 -30
- package/src/EventBroker.js +46 -1
- package/src/Expressions.js +2 -3
- package/src/MessageFormatter.js +24 -16
- package/src/Timers.js +12 -9
- package/src/Tracker.js +1 -0
- package/src/activity/Activity.js +388 -231
- package/src/activity/ActivityExecution.js +93 -42
- package/src/activity/Dummy.js +6 -1
- package/src/activity/Escalation.js +25 -18
- package/src/activity/ExecutionScope.js +1 -1
- package/src/activity/Message.js +25 -18
- package/src/activity/Signal.js +25 -18
- package/src/activity/outbound-evaluator.js +1 -1
- package/src/condition.js +11 -5
- package/src/constants.js +15 -0
- package/src/definition/Definition.js +157 -62
- package/src/definition/DefinitionExecution.js +161 -83
- package/src/error/BpmnError.js +11 -1
- package/src/error/Errors.js +44 -5
- package/src/eventDefinitions/CancelEventDefinition.js +27 -13
- package/src/eventDefinitions/CompensateEventDefinition.js +48 -32
- package/src/eventDefinitions/ConditionalEventDefinition.js +20 -10
- package/src/eventDefinitions/ErrorEventDefinition.js +44 -33
- package/src/eventDefinitions/EscalationEventDefinition.js +39 -26
- package/src/eventDefinitions/EventDefinitionExecution.js +30 -24
- package/src/eventDefinitions/LinkEventDefinition.js +34 -120
- package/src/eventDefinitions/MessageEventDefinition.js +42 -31
- package/src/eventDefinitions/SignalEventDefinition.js +43 -32
- package/src/eventDefinitions/TerminateEventDefinition.js +9 -1
- package/src/eventDefinitions/TimerEventDefinition.js +53 -35
- package/src/eventDefinitions/index.js +10 -23
- package/src/events/BoundaryEvent.js +50 -39
- package/src/events/EndEvent.js +19 -7
- package/src/events/IntermediateCatchEvent.js +24 -8
- package/src/events/IntermediateThrowEvent.js +24 -8
- package/src/events/StartEvent.js +25 -14
- package/src/events/index.js +5 -18
- package/src/flows/Association.js +43 -9
- package/src/flows/MessageFlow.js +41 -10
- package/src/flows/SequenceFlow.js +82 -19
- package/src/flows/index.js +3 -4
- package/src/gateways/EventBasedGateway.js +27 -15
- package/src/gateways/ExclusiveGateway.js +16 -3
- package/src/gateways/InclusiveGateway.js +16 -3
- package/src/gateways/ParallelGateway.js +301 -10
- package/src/gateways/index.js +4 -4
- package/src/getPropertyValue.js +2 -2
- package/src/index.js +19 -19
- package/src/io/BpmnIO.js +13 -1
- package/src/io/EnvironmentDataObject.js +26 -1
- package/src/io/EnvironmentDataStore.js +22 -1
- package/src/io/EnvironmentDataStoreReference.js +22 -1
- package/src/io/InputOutputSpecification.js +17 -8
- package/src/io/Properties.js +23 -13
- package/src/messageHelper.js +36 -4
- package/src/process/Lane.js +14 -4
- package/src/process/Process.js +154 -72
- package/src/process/ProcessExecution.js +326 -175
- package/src/shared.js +1 -0
- package/src/tasks/CallActivity.js +16 -2
- package/src/tasks/LoopCharacteristics.js +77 -11
- package/src/tasks/ReceiveTask.js +33 -22
- package/src/tasks/ScriptTask.js +17 -3
- package/src/tasks/ServiceImplementation.js +6 -3
- package/src/tasks/ServiceTask.js +16 -2
- package/src/tasks/SignalTask.js +16 -2
- package/src/tasks/StandardLoopCharacteristics.js +7 -3
- package/src/tasks/SubProcess.js +37 -23
- package/src/tasks/Task.js +16 -2
- package/src/tasks/Transaction.js +7 -3
- package/src/tasks/index.js +8 -9
- package/types/bundle-errors.d.ts +1 -0
- package/types/bundle.d.ts +97 -0
- package/types/index.d.ts +2614 -84
- package/types/interfaces.d.ts +636 -0
- package/types/types.d.ts +0 -765
|
@@ -3,29 +3,267 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.ParallelGateway = ParallelGateway;
|
|
6
7
|
exports.ParallelGatewayBehaviour = ParallelGatewayBehaviour;
|
|
7
|
-
|
|
8
|
-
var _Activity = _interopRequireDefault(require("../activity/Activity.js"));
|
|
8
|
+
var _Activity = require("../activity/Activity.js");
|
|
9
9
|
var _messageHelper = require("../messageHelper.js");
|
|
10
|
-
|
|
10
|
+
var _constants = require("../constants.js");
|
|
11
|
+
const STATE_MONTITORING = 'monitoring';
|
|
12
|
+
const STATE_SETUP = 'setup';
|
|
13
|
+
const K_PEERS = Symbol.for('peers');
|
|
14
|
+
const K_PEERS_DISCOVERED = Symbol.for('peers discovered');
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Parallel gateway
|
|
18
|
+
* @param {import('moddle-context-serializer').Activity} activityDef
|
|
19
|
+
* @param {import('#types').ContextInstance} context
|
|
20
|
+
*/
|
|
11
21
|
function ParallelGateway(activityDef, context) {
|
|
12
|
-
|
|
22
|
+
const activity = new _Activity.Activity(ParallelGatewayBehaviour, {
|
|
13
23
|
...activityDef,
|
|
14
24
|
isParallelGateway: true
|
|
15
25
|
}, context);
|
|
26
|
+
const id = this.id = activity.id;
|
|
27
|
+
activity.broker.cancel('_api-shake');
|
|
28
|
+
activity.broker.subscribeTmp('api', 'activity.shake.continue', onApiShake, {
|
|
29
|
+
noAck: true,
|
|
30
|
+
consumerTag: '_api-shake',
|
|
31
|
+
priority: 1000
|
|
32
|
+
});
|
|
33
|
+
const peers = activity[K_PEERS] = new Map(activity.inbound.map(({
|
|
34
|
+
id: flowId,
|
|
35
|
+
sourceId
|
|
36
|
+
}) => [flowId, new Set([sourceId])]));
|
|
37
|
+
const cachedPeers = context.getShakenPeers(id);
|
|
38
|
+
if (cachedPeers) {
|
|
39
|
+
for (const [flowId, sourceIds] of cachedPeers) {
|
|
40
|
+
let peer = peers.get(flowId);
|
|
41
|
+
if (!peer) peers.set(flowId, peer = new Set());
|
|
42
|
+
for (const sourceId of sourceIds) peer.add(sourceId);
|
|
43
|
+
}
|
|
44
|
+
activity[K_PEERS_DISCOVERED] = true;
|
|
45
|
+
}
|
|
46
|
+
return activity;
|
|
47
|
+
function onApiShake(_, message) {
|
|
48
|
+
const collect = new Set();
|
|
49
|
+
let sequenceFlow;
|
|
50
|
+
for (const s of message.content.sequence) {
|
|
51
|
+
if (s.isSequenceFlow) {
|
|
52
|
+
sequenceFlow = s;
|
|
53
|
+
} else if (s.id === id) {
|
|
54
|
+
const peer = peers.get(sequenceFlow.id);
|
|
55
|
+
for (const c of collect) {
|
|
56
|
+
peer.add(c);
|
|
57
|
+
}
|
|
58
|
+
collect.clear();
|
|
59
|
+
} else {
|
|
60
|
+
collect.add(s.id);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
activity.logger.debug(`<${activity.id}> collected parallel gateway peers`);
|
|
64
|
+
activity[K_PEERS_DISCOVERED] = true;
|
|
65
|
+
context.setShakenPeers(id, [...peers].map(([flowId, sourceIds]) => [flowId, [...sourceIds]]));
|
|
66
|
+
activity.shake(message);
|
|
67
|
+
}
|
|
16
68
|
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Parallel gateway behaviour
|
|
72
|
+
* @param {import('#types').Activity} activity
|
|
73
|
+
*/
|
|
17
74
|
function ParallelGatewayBehaviour(activity) {
|
|
75
|
+
this.id = activity.id;
|
|
76
|
+
this.type = activity.type;
|
|
77
|
+
this.activity = activity;
|
|
78
|
+
this.broker = activity.broker;
|
|
79
|
+
this.inbound = new Set();
|
|
80
|
+
this.isConverging = true;
|
|
81
|
+
this[_constants.K_EXECUTE_MESSAGE] = undefined;
|
|
82
|
+
}
|
|
83
|
+
Object.defineProperty(ParallelGatewayBehaviour.prototype, 'executionId', {
|
|
84
|
+
get() {
|
|
85
|
+
return this[_constants.K_EXECUTE_MESSAGE]?.content.executionId;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @param {import('#types').ElementBrokerMessage} executeMessage
|
|
91
|
+
* @returns {void}
|
|
92
|
+
*/
|
|
93
|
+
ParallelGatewayBehaviour.prototype.execute = function execute(executeMessage) {
|
|
94
|
+
const routingKey = executeMessage.fields.routingKey;
|
|
95
|
+
const isRedelivered = executeMessage.fields.redelivered;
|
|
96
|
+
const executeContent = executeMessage.content;
|
|
97
|
+
if (executeContent.isRootScope) {
|
|
98
|
+
this[_constants.K_EXECUTE_MESSAGE] = executeMessage;
|
|
99
|
+
switch (routingKey) {
|
|
100
|
+
case 'execute.start':
|
|
101
|
+
{
|
|
102
|
+
if (!isRedelivered && executeContent.state === STATE_SETUP && !this.peerMonitor.isRunning) {
|
|
103
|
+
return this._complete();
|
|
104
|
+
}
|
|
105
|
+
if (executeContent.state !== 'start' && !isRedelivered) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
return this.setup(executeMessage);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
ParallelGatewayBehaviour.prototype.setup = function setup(executeMessage) {
|
|
114
|
+
const peerIds = new Set([...this.activity[K_PEERS].values()].map(v => [...v]).flat());
|
|
115
|
+
this[_constants.K_TARGETS] = new Map([...peerIds].map(pid => [pid, this.activity.getActivityById(pid)]));
|
|
116
|
+
this.peerMonitor = new PeerMonitor(this.activity, this[_constants.K_TARGETS]);
|
|
117
|
+
const message = this[_constants.K_EXECUTE_MESSAGE] = (0, _messageHelper.cloneMessage)(executeMessage);
|
|
118
|
+
const executeContent = message.content;
|
|
18
119
|
const {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.broker
|
|
120
|
+
executionId
|
|
121
|
+
} = executeContent;
|
|
122
|
+
this.inbound.add((0, _messageHelper.cloneContent)(executeMessage.content.inbound[0]));
|
|
123
|
+
this.broker.subscribeOnce('api', `activity.stop.${executionId}`, () => this._stop(), {
|
|
124
|
+
consumerTag: '_api-stop-execution'
|
|
125
|
+
});
|
|
126
|
+
this.broker.subscribeTmp('execution', 'execute.completed', this._onExecuteMessage.bind(this), {
|
|
127
|
+
noAck: true,
|
|
128
|
+
consumerTag: '_parallel-execution-execute-tag'
|
|
129
|
+
});
|
|
130
|
+
this.broker.subscribeTmp('execution', 'execute.start', this._onPeerEnterMessage.bind(this), {
|
|
131
|
+
noAck: true,
|
|
132
|
+
consumerTag: '_parallel-execution-peer-enter-tag'
|
|
133
|
+
});
|
|
134
|
+
this.peerMonitor.execute(message);
|
|
135
|
+
const inboundQ = this.broker.getQueue('inbound-q');
|
|
136
|
+
inboundQ.consume((_, inboundMessage) => {
|
|
137
|
+
this.inbound.add(inboundMessage);
|
|
138
|
+
message.content.inbound.push((0, _messageHelper.cloneContent)(inboundMessage.content));
|
|
139
|
+
this.peerMonitor.execute(message);
|
|
140
|
+
}, {
|
|
141
|
+
consumerTag: '_converging-inbound',
|
|
142
|
+
exclusive: true,
|
|
143
|
+
prefetch: 10000
|
|
144
|
+
});
|
|
145
|
+
if (this.isConverging) {
|
|
146
|
+
this.broker.publish('event', 'activity.converge', (0, _messageHelper.cloneContent)(executeContent));
|
|
147
|
+
}
|
|
148
|
+
return this.broker.publish('execution', 'execute.start', (0, _messageHelper.cloneContent)(executeMessage.content, {
|
|
149
|
+
preventComplete: true,
|
|
150
|
+
state: STATE_SETUP
|
|
151
|
+
}));
|
|
152
|
+
};
|
|
153
|
+
ParallelGatewayBehaviour.prototype._onExecuteMessage = function onExecuteMessage(routingKey, message) {
|
|
154
|
+
this.activity.logger.debug(`<${this.executionId} (${this.id})> received completed from <${message.content.id}>`);
|
|
155
|
+
if (this.peerMonitor._onCompleteMessage(routingKey, message)) {
|
|
156
|
+
return this._complete();
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
ParallelGatewayBehaviour.prototype._onPeerEnterMessage = function onPeerEnterMessage(_, message) {
|
|
160
|
+
if (!message.properties.monitor) return;
|
|
161
|
+
const peer = this.peerMonitor.watching.get(message.content.id);
|
|
162
|
+
if (peer) this.peerMonitor.running.set(message.content.id, peer);
|
|
163
|
+
};
|
|
164
|
+
ParallelGatewayBehaviour.prototype._complete = function complete() {
|
|
165
|
+
this.broker.cancel('_converging-inbound', false);
|
|
166
|
+
this._stop();
|
|
167
|
+
this.activity.logger.debug(`<${this.executionId} (${this.id})> completed monitoring`);
|
|
168
|
+
const content = (0, _messageHelper.cloneContent)(this[_constants.K_EXECUTE_MESSAGE].content, {
|
|
169
|
+
isRootScope: true,
|
|
170
|
+
state: 'completed'
|
|
171
|
+
});
|
|
172
|
+
content.inbound = this.peerMonitor.inbound;
|
|
173
|
+
return this.broker.publish('execution', 'execute.completed', content);
|
|
174
|
+
};
|
|
175
|
+
ParallelGatewayBehaviour.prototype._stop = function stop() {
|
|
176
|
+
this.broker.cancel('_converging-inbound');
|
|
177
|
+
this.broker.cancel('_api-stop-execution');
|
|
178
|
+
this.broker.cancel('_parallel-execution-execute-tag');
|
|
179
|
+
this.broker.cancel('_parallel-execution-peer-enter-tag');
|
|
180
|
+
this.peerMonitor.stop();
|
|
181
|
+
};
|
|
182
|
+
function PeerMonitor(activity, targets) {
|
|
183
|
+
this.activity = activity;
|
|
184
|
+
this.id = activity.id;
|
|
185
|
+
this.broker = activity.broker;
|
|
186
|
+
this.running = 0;
|
|
187
|
+
this.index = 0;
|
|
188
|
+
this.discarded = 0;
|
|
189
|
+
this.running = new Map();
|
|
190
|
+
this.watching = new Map();
|
|
191
|
+
this.targets = targets;
|
|
192
|
+
this.touched = new Set();
|
|
193
|
+
this.inbound = [];
|
|
26
194
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
195
|
+
Object.defineProperty(PeerMonitor.prototype, 'isRunning', {
|
|
196
|
+
get() {
|
|
197
|
+
return this.running.size > 0;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
PeerMonitor.prototype.execute = function execute(executeMessage) {
|
|
201
|
+
const message = (0, _messageHelper.cloneMessage)(executeMessage);
|
|
202
|
+
const inbound = message.content.inbound.pop();
|
|
203
|
+
this.inbound.push((0, _messageHelper.cloneContent)(inbound));
|
|
204
|
+
this.activity.logger.debug(`<${executeMessage.content.executionId} (${this.id})> start monitoring inbound <${inbound.id}> peers`);
|
|
205
|
+
this.activity.broker.publish('execution', 'execute.start', {
|
|
206
|
+
...(0, _messageHelper.cloneContent)(executeMessage.content),
|
|
207
|
+
inbound: this.inbound.slice(),
|
|
208
|
+
state: STATE_MONTITORING,
|
|
209
|
+
preventComplete: true
|
|
210
|
+
});
|
|
211
|
+
this.touched.add(inbound.sourceId);
|
|
212
|
+
for (const target of this.targets.values()) {
|
|
213
|
+
this.monitor(target);
|
|
214
|
+
}
|
|
215
|
+
return this.running.size;
|
|
216
|
+
};
|
|
217
|
+
PeerMonitor.prototype.monitor = function monitor(peerActivity) {
|
|
218
|
+
if (this.watching.has(peerActivity.id)) return;
|
|
219
|
+
this.activity.logger.debug(`<${this.id}> monitor <${peerActivity.id}> with status: ${peerActivity.status}`);
|
|
220
|
+
this.watching.set(peerActivity.id, peerActivity);
|
|
221
|
+
if (peerActivity.status || peerActivity.initialized) {
|
|
222
|
+
this.running.set(peerActivity.id, peerActivity);
|
|
223
|
+
}
|
|
224
|
+
peerActivity.broker.createShovel(`_on-enter-${this.id}`, {
|
|
225
|
+
exchange: 'event',
|
|
226
|
+
pattern: 'activity.enter'
|
|
227
|
+
}, {
|
|
228
|
+
broker: this.broker,
|
|
229
|
+
exchange: 'execution',
|
|
230
|
+
exchangeKey: 'execute.start',
|
|
231
|
+
publishProperties: {
|
|
232
|
+
monitor: true
|
|
233
|
+
}
|
|
234
|
+
}, {
|
|
235
|
+
cloneMessage(sourceMessage) {
|
|
236
|
+
return (0, _messageHelper.cloneMessage)(sourceMessage, {
|
|
237
|
+
isRootScope: false
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
peerActivity.broker.createShovel(`_on-leave-${this.id}`, {
|
|
242
|
+
exchange: 'event',
|
|
243
|
+
pattern: 'activity.leave'
|
|
244
|
+
}, {
|
|
245
|
+
broker: this.broker,
|
|
246
|
+
exchange: 'execution',
|
|
247
|
+
exchangeKey: 'execute.completed',
|
|
248
|
+
publishProperties: {
|
|
249
|
+
monitor: true
|
|
250
|
+
}
|
|
251
|
+
}, {
|
|
252
|
+
cloneMessage(sourceMessage) {
|
|
253
|
+
return (0, _messageHelper.cloneMessage)(sourceMessage, {
|
|
254
|
+
isRootScope: false,
|
|
255
|
+
preventComplete: true
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
PeerMonitor.prototype._onCompleteMessage = function onCompleteMessage(_routingKey, message) {
|
|
261
|
+
this.running.delete(message.content.id);
|
|
262
|
+
return !this.running.size;
|
|
263
|
+
};
|
|
264
|
+
PeerMonitor.prototype.stop = function stop() {
|
|
265
|
+
for (const peerActivity of this.watching.values()) {
|
|
266
|
+
peerActivity.broker.closeShovel(`_on-leave-${this.id}`);
|
|
267
|
+
peerActivity.broker.closeShovel(`_on-enter-${this.id}`);
|
|
268
|
+
}
|
|
31
269
|
};
|
package/dist/gateways/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "EventBasedGateway", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return _EventBasedGateway.
|
|
9
|
+
return _EventBasedGateway.EventBasedGateway;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "EventBasedGatewayBehaviour", {
|
|
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "EventBasedGatewayBehaviour", {
|
|
|
18
18
|
Object.defineProperty(exports, "ExclusiveGateway", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
|
-
return _ExclusiveGateway.
|
|
21
|
+
return _ExclusiveGateway.ExclusiveGateway;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "ExclusiveGatewayBehaviour", {
|
|
@@ -30,7 +30,7 @@ Object.defineProperty(exports, "ExclusiveGatewayBehaviour", {
|
|
|
30
30
|
Object.defineProperty(exports, "InclusiveGateway", {
|
|
31
31
|
enumerable: true,
|
|
32
32
|
get: function () {
|
|
33
|
-
return _InclusiveGateway.
|
|
33
|
+
return _InclusiveGateway.InclusiveGateway;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "InclusiveGatewayBehaviour", {
|
|
@@ -42,7 +42,7 @@ Object.defineProperty(exports, "InclusiveGatewayBehaviour", {
|
|
|
42
42
|
Object.defineProperty(exports, "ParallelGateway", {
|
|
43
43
|
enumerable: true,
|
|
44
44
|
get: function () {
|
|
45
|
-
return _ParallelGateway.
|
|
45
|
+
return _ParallelGateway.ParallelGateway;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "ParallelGatewayBehaviour", {
|
|
@@ -51,8 +51,7 @@ Object.defineProperty(exports, "ParallelGatewayBehaviour", {
|
|
|
51
51
|
return _ParallelGateway.ParallelGatewayBehaviour;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
var _EventBasedGateway =
|
|
55
|
-
var _ExclusiveGateway =
|
|
56
|
-
var _InclusiveGateway =
|
|
57
|
-
var _ParallelGateway =
|
|
58
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
54
|
+
var _EventBasedGateway = require("./EventBasedGateway.js");
|
|
55
|
+
var _ExclusiveGateway = require("./ExclusiveGateway.js");
|
|
56
|
+
var _InclusiveGateway = require("./InclusiveGateway.js");
|
|
57
|
+
var _ParallelGateway = require("./ParallelGateway.js");
|
package/dist/getPropertyValue.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getPropertyValue = getPropertyValue;
|
|
7
7
|
const propertyPattern = /(\w+)\((.*?)(?:\))|(\.|\[|^)(.+?)(?:\]|\[|\.|$)/;
|
|
8
8
|
const stringConstantPattern = /^(['"])(.*)\1$/;
|
|
9
9
|
const numberConstantPattern = /^\W*-?\d+(.\d+)?\W*$/;
|
|
@@ -76,7 +76,7 @@ function splitArguments(args, base, fnScope) {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
if (argCompleted) {
|
|
79
|
-
if (arg.length
|
|
79
|
+
if (arg.length) {
|
|
80
80
|
callArguments.push(getFunctionArgument(base, arg.trim(), fnScope));
|
|
81
81
|
}
|
|
82
82
|
arg = '';
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "Activity", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return _Activity.
|
|
9
|
+
return _Activity.Activity;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "ActivityError", {
|
|
@@ -36,7 +36,7 @@ Object.defineProperty(exports, "BoundaryEvent", {
|
|
|
36
36
|
Object.defineProperty(exports, "BpmnError", {
|
|
37
37
|
enumerable: true,
|
|
38
38
|
get: function () {
|
|
39
|
-
return _BpmnError.
|
|
39
|
+
return _BpmnError.BpmnErrorActivity;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "BusinessRuleTask", {
|
|
@@ -60,7 +60,7 @@ Object.defineProperty(exports, "CancelEventDefinition", {
|
|
|
60
60
|
Object.defineProperty(exports, "Category", {
|
|
61
61
|
enumerable: true,
|
|
62
62
|
get: function () {
|
|
63
|
-
return _Dummy.
|
|
63
|
+
return _Dummy.DummyActivity;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
Object.defineProperty(exports, "CompensateEventDefinition", {
|
|
@@ -78,37 +78,37 @@ Object.defineProperty(exports, "ConditionalEventDefinition", {
|
|
|
78
78
|
Object.defineProperty(exports, "Context", {
|
|
79
79
|
enumerable: true,
|
|
80
80
|
get: function () {
|
|
81
|
-
return _Context.
|
|
81
|
+
return _Context.Context;
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "DataObject", {
|
|
85
85
|
enumerable: true,
|
|
86
86
|
get: function () {
|
|
87
|
-
return _EnvironmentDataObject.
|
|
87
|
+
return _EnvironmentDataObject.EnvironmentDataObject;
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
Object.defineProperty(exports, "DataStore", {
|
|
91
91
|
enumerable: true,
|
|
92
92
|
get: function () {
|
|
93
|
-
return _EnvironmentDataStore.
|
|
93
|
+
return _EnvironmentDataStore.EnvironmentDataStore;
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
Object.defineProperty(exports, "DataStoreReference", {
|
|
97
97
|
enumerable: true,
|
|
98
98
|
get: function () {
|
|
99
|
-
return _EnvironmentDataStoreReference.
|
|
99
|
+
return _EnvironmentDataStoreReference.EnvironmentDataStoreReference;
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
Object.defineProperty(exports, "Definition", {
|
|
103
103
|
enumerable: true,
|
|
104
104
|
get: function () {
|
|
105
|
-
return _Definition.
|
|
105
|
+
return _Definition.Definition;
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
Object.defineProperty(exports, "Dummy", {
|
|
109
109
|
enumerable: true,
|
|
110
110
|
get: function () {
|
|
111
|
-
return _Dummy.
|
|
111
|
+
return _Dummy.DummyActivity;
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
114
|
Object.defineProperty(exports, "EndEvent", {
|
|
@@ -120,7 +120,7 @@ Object.defineProperty(exports, "EndEvent", {
|
|
|
120
120
|
Object.defineProperty(exports, "Environment", {
|
|
121
121
|
enumerable: true,
|
|
122
122
|
get: function () {
|
|
123
|
-
return _Environment.
|
|
123
|
+
return _Environment.Environment;
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
126
|
Object.defineProperty(exports, "ErrorEventDefinition", {
|
|
@@ -132,7 +132,7 @@ Object.defineProperty(exports, "ErrorEventDefinition", {
|
|
|
132
132
|
Object.defineProperty(exports, "Escalation", {
|
|
133
133
|
enumerable: true,
|
|
134
134
|
get: function () {
|
|
135
|
-
return _Escalation.
|
|
135
|
+
return _Escalation.Escalation;
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
Object.defineProperty(exports, "EscalationEventDefinition", {
|
|
@@ -156,7 +156,7 @@ Object.defineProperty(exports, "ExclusiveGateway", {
|
|
|
156
156
|
Object.defineProperty(exports, "Group", {
|
|
157
157
|
enumerable: true,
|
|
158
158
|
get: function () {
|
|
159
|
-
return _Dummy.
|
|
159
|
+
return _Dummy.DummyActivity;
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
Object.defineProperty(exports, "InclusiveGateway", {
|
|
@@ -168,7 +168,7 @@ Object.defineProperty(exports, "InclusiveGateway", {
|
|
|
168
168
|
Object.defineProperty(exports, "InputOutputSpecification", {
|
|
169
169
|
enumerable: true,
|
|
170
170
|
get: function () {
|
|
171
|
-
return _InputOutputSpecification.
|
|
171
|
+
return _InputOutputSpecification.IoSpecification;
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
174
|
Object.defineProperty(exports, "IntermediateCatchEvent", {
|
|
@@ -186,7 +186,7 @@ Object.defineProperty(exports, "IntermediateThrowEvent", {
|
|
|
186
186
|
Object.defineProperty(exports, "Lane", {
|
|
187
187
|
enumerable: true,
|
|
188
188
|
get: function () {
|
|
189
|
-
return _Lane.
|
|
189
|
+
return _Lane.Lane;
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
192
|
Object.defineProperty(exports, "LinkEventDefinition", {
|
|
@@ -204,7 +204,7 @@ Object.defineProperty(exports, "ManualTask", {
|
|
|
204
204
|
Object.defineProperty(exports, "Message", {
|
|
205
205
|
enumerable: true,
|
|
206
206
|
get: function () {
|
|
207
|
-
return _Message.
|
|
207
|
+
return _Message.Message;
|
|
208
208
|
}
|
|
209
209
|
});
|
|
210
210
|
Object.defineProperty(exports, "MessageEventDefinition", {
|
|
@@ -222,7 +222,7 @@ Object.defineProperty(exports, "MessageFlow", {
|
|
|
222
222
|
Object.defineProperty(exports, "MultiInstanceLoopCharacteristics", {
|
|
223
223
|
enumerable: true,
|
|
224
224
|
get: function () {
|
|
225
|
-
return _LoopCharacteristics.
|
|
225
|
+
return _LoopCharacteristics.LoopCharacteristics;
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
228
|
Object.defineProperty(exports, "ParallelGateway", {
|
|
@@ -234,13 +234,13 @@ Object.defineProperty(exports, "ParallelGateway", {
|
|
|
234
234
|
Object.defineProperty(exports, "Process", {
|
|
235
235
|
enumerable: true,
|
|
236
236
|
get: function () {
|
|
237
|
-
return _Process.
|
|
237
|
+
return _Process.Process;
|
|
238
238
|
}
|
|
239
239
|
});
|
|
240
240
|
Object.defineProperty(exports, "Properties", {
|
|
241
241
|
enumerable: true,
|
|
242
242
|
get: function () {
|
|
243
|
-
return _Properties.
|
|
243
|
+
return _Properties.Properties;
|
|
244
244
|
}
|
|
245
245
|
});
|
|
246
246
|
Object.defineProperty(exports, "ReceiveTask", {
|
|
@@ -276,7 +276,7 @@ Object.defineProperty(exports, "SequenceFlow", {
|
|
|
276
276
|
Object.defineProperty(exports, "ServiceImplementation", {
|
|
277
277
|
enumerable: true,
|
|
278
278
|
get: function () {
|
|
279
|
-
return _ServiceImplementation.
|
|
279
|
+
return _ServiceImplementation.ServiceImplementation;
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
282
|
Object.defineProperty(exports, "ServiceTask", {
|
|
@@ -288,7 +288,7 @@ Object.defineProperty(exports, "ServiceTask", {
|
|
|
288
288
|
Object.defineProperty(exports, "Signal", {
|
|
289
289
|
enumerable: true,
|
|
290
290
|
get: function () {
|
|
291
|
-
return _Signal.
|
|
291
|
+
return _Signal.Signal;
|
|
292
292
|
}
|
|
293
293
|
});
|
|
294
294
|
Object.defineProperty(exports, "SignalEventDefinition", {
|
|
@@ -306,7 +306,7 @@ Object.defineProperty(exports, "SignalTask", {
|
|
|
306
306
|
Object.defineProperty(exports, "StandardLoopCharacteristics", {
|
|
307
307
|
enumerable: true,
|
|
308
308
|
get: function () {
|
|
309
|
-
return _StandardLoopCharacteristics.
|
|
309
|
+
return _StandardLoopCharacteristics.StandardLoopCharacteristics;
|
|
310
310
|
}
|
|
311
311
|
});
|
|
312
312
|
Object.defineProperty(exports, "StartEvent", {
|
|
@@ -336,7 +336,7 @@ Object.defineProperty(exports, "TerminateEventDefinition", {
|
|
|
336
336
|
Object.defineProperty(exports, "TextAnnotation", {
|
|
337
337
|
enumerable: true,
|
|
338
338
|
get: function () {
|
|
339
|
-
return _Dummy.
|
|
339
|
+
return _Dummy.DummyActivity;
|
|
340
340
|
}
|
|
341
341
|
});
|
|
342
342
|
Object.defineProperty(exports, "TimerEventDefinition", {
|
|
@@ -363,30 +363,29 @@ Object.defineProperty(exports, "UserTask", {
|
|
|
363
363
|
return _index4.SignalTask;
|
|
364
364
|
}
|
|
365
365
|
});
|
|
366
|
-
var _Activity =
|
|
367
|
-
var _BpmnError =
|
|
368
|
-
var _Context =
|
|
369
|
-
var _EnvironmentDataObject =
|
|
370
|
-
var _EnvironmentDataStore =
|
|
371
|
-
var _EnvironmentDataStoreReference =
|
|
372
|
-
var _Definition =
|
|
373
|
-
var _Dummy =
|
|
374
|
-
var _Environment =
|
|
375
|
-
var _Escalation =
|
|
376
|
-
var _InputOutputSpecification =
|
|
377
|
-
var _Lane =
|
|
378
|
-
var _LoopCharacteristics =
|
|
379
|
-
var _Message =
|
|
380
|
-
var _Process =
|
|
381
|
-
var _Properties =
|
|
382
|
-
var _ServiceImplementation =
|
|
383
|
-
var _Signal =
|
|
384
|
-
var _StandardLoopCharacteristics =
|
|
366
|
+
var _Activity = require("./activity/Activity.js");
|
|
367
|
+
var _BpmnError = require("./error/BpmnError.js");
|
|
368
|
+
var _Context = require("./Context.js");
|
|
369
|
+
var _EnvironmentDataObject = require("./io/EnvironmentDataObject.js");
|
|
370
|
+
var _EnvironmentDataStore = require("./io/EnvironmentDataStore.js");
|
|
371
|
+
var _EnvironmentDataStoreReference = require("./io/EnvironmentDataStoreReference.js");
|
|
372
|
+
var _Definition = require("./definition/Definition.js");
|
|
373
|
+
var _Dummy = require("./activity/Dummy.js");
|
|
374
|
+
var _Environment = require("./Environment.js");
|
|
375
|
+
var _Escalation = require("./activity/Escalation.js");
|
|
376
|
+
var _InputOutputSpecification = require("./io/InputOutputSpecification.js");
|
|
377
|
+
var _Lane = require("./process/Lane.js");
|
|
378
|
+
var _LoopCharacteristics = require("./tasks/LoopCharacteristics.js");
|
|
379
|
+
var _Message = require("./activity/Message.js");
|
|
380
|
+
var _Process = require("./process/Process.js");
|
|
381
|
+
var _Properties = require("./io/Properties.js");
|
|
382
|
+
var _ServiceImplementation = require("./tasks/ServiceImplementation.js");
|
|
383
|
+
var _Signal = require("./activity/Signal.js");
|
|
384
|
+
var _StandardLoopCharacteristics = require("./tasks/StandardLoopCharacteristics.js");
|
|
385
385
|
var _index = require("./flows/index.js");
|
|
386
386
|
var _index2 = require("./events/index.js");
|
|
387
387
|
var _index3 = require("./gateways/index.js");
|
|
388
388
|
var _index4 = require("./tasks/index.js");
|
|
389
389
|
var _index5 = require("./eventDefinitions/index.js");
|
|
390
390
|
var _Timers = require("./Timers.js");
|
|
391
|
-
var _Errors = require("./error/Errors.js");
|
|
392
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
391
|
+
var _Errors = require("./error/Errors.js");
|
package/dist/io/BpmnIO.js
CHANGED
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.BpmnIO = BpmnIO;
|
|
7
|
+
/**
|
|
8
|
+
* Built-in IO extension. Composes the activity's ioSpecification and properties behaviours.
|
|
9
|
+
* @param {import('#types').Activity} activity
|
|
10
|
+
* @param {import('#types').ContextInstance} context
|
|
11
|
+
* @satisfies {import('#types').IExtension}
|
|
12
|
+
*/
|
|
7
13
|
function BpmnIO(activity, context) {
|
|
8
14
|
this.activity = activity;
|
|
9
15
|
this.context = context;
|
|
@@ -20,12 +26,20 @@ Object.defineProperty(BpmnIO.prototype, 'hasIo', {
|
|
|
20
26
|
return this.specification || this.properties;
|
|
21
27
|
}
|
|
22
28
|
});
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @param {import('#types').ElementBrokerMessage} message
|
|
32
|
+
*/
|
|
23
33
|
BpmnIO.prototype.activate = function activate(message) {
|
|
24
34
|
const properties = this.properties,
|
|
25
35
|
specification = this.specification;
|
|
26
36
|
if (properties) properties.activate(message);
|
|
27
37
|
if (specification) specification.activate(message);
|
|
28
38
|
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @param {import('#types').ElementBrokerMessage} message
|
|
42
|
+
*/
|
|
29
43
|
BpmnIO.prototype.deactivate = function deactivate(message) {
|
|
30
44
|
const properties = this.properties,
|
|
31
45
|
specification = this.specification;
|
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.EnvironmentDataObject = EnvironmentDataObject;
|
|
7
|
+
/**
|
|
8
|
+
* Builtin data object. Reads from / writes to `environment.variables._data`.
|
|
9
|
+
* @param {import('moddle-context-serializer').DataObject} dataObjectDef
|
|
10
|
+
* @param {import('#types').ContextInstance} context
|
|
11
|
+
* @satisfies {import('#types').IIOData}
|
|
12
|
+
*/
|
|
7
13
|
function EnvironmentDataObject(dataObjectDef, {
|
|
8
14
|
environment
|
|
9
15
|
}) {
|
|
@@ -17,16 +23,33 @@ function EnvironmentDataObject(dataObjectDef, {
|
|
|
17
23
|
this.id = id;
|
|
18
24
|
this.type = type;
|
|
19
25
|
this.name = name;
|
|
26
|
+
/** @type {Record<string, any>} */
|
|
20
27
|
this.behaviour = behaviour;
|
|
28
|
+
/** @type {import('moddle-context-serializer').Parent | undefined} */
|
|
21
29
|
this.parent = parent;
|
|
22
30
|
this.environment = environment;
|
|
23
31
|
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @param {import('smqp').Broker} broker
|
|
35
|
+
* @param {string} exchange
|
|
36
|
+
* @param {string} routingKeyPrefix
|
|
37
|
+
* @param {Record<string, any>} [messageProperties]
|
|
38
|
+
*/
|
|
24
39
|
EnvironmentDataObject.prototype.read = function read(broker, exchange, routingKeyPrefix, messageProperties) {
|
|
25
40
|
const environment = this.environment;
|
|
26
41
|
const value = environment.variables._data?.[this.id];
|
|
27
42
|
const content = this._createContent(value);
|
|
28
43
|
return broker.publish(exchange, `${routingKeyPrefix}response`, content, messageProperties);
|
|
29
44
|
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @param {import('smqp').Broker} broker
|
|
48
|
+
* @param {string} exchange
|
|
49
|
+
* @param {string} routingKeyPrefix
|
|
50
|
+
* @param {any} value
|
|
51
|
+
* @param {Record<string, any>} [messageProperties]
|
|
52
|
+
*/
|
|
30
53
|
EnvironmentDataObject.prototype.write = function write(broker, exchange, routingKeyPrefix, value, messageProperties) {
|
|
31
54
|
const environment = this.environment;
|
|
32
55
|
environment.variables._data = environment.variables._data || {};
|
|
@@ -34,6 +57,11 @@ EnvironmentDataObject.prototype.write = function write(broker, exchange, routing
|
|
|
34
57
|
const content = this._createContent(value);
|
|
35
58
|
return broker.publish(exchange, `${routingKeyPrefix}response`, content, messageProperties);
|
|
36
59
|
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @private
|
|
63
|
+
* Create content
|
|
64
|
+
*/
|
|
37
65
|
EnvironmentDataObject.prototype._createContent = function createContent(value) {
|
|
38
66
|
return {
|
|
39
67
|
id: this.id,
|