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
|
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Process = Process;
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _ProcessExecution = _interopRequireDefault(require("./ProcessExecution"));
|
|
9
|
-
var _shared = require("../shared");
|
|
10
|
-
var _Api = require("../Api");
|
|
11
|
-
var _EventBroker = require("../EventBroker");
|
|
12
|
-
var _messageHelper = require("../messageHelper");
|
|
13
|
-
var _Errors = require("../error/Errors");
|
|
8
|
+
var _ProcessExecution = _interopRequireDefault(require("./ProcessExecution.js"));
|
|
9
|
+
var _shared = require("../shared.js");
|
|
10
|
+
var _Api = require("../Api.js");
|
|
11
|
+
var _EventBroker = require("../EventBroker.js");
|
|
12
|
+
var _messageHelper = require("../messageHelper.js");
|
|
13
|
+
var _Errors = require("../error/Errors.js");
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
const kConsuming = Symbol.for('consuming');
|
|
16
16
|
const kCounters = Symbol.for('counters');
|
|
@@ -68,8 +68,7 @@ function Process(processDef, context) {
|
|
|
68
68
|
this.logger = environment.Logger(type.toLowerCase());
|
|
69
69
|
this[kExtensions] = context.loadExtensions(this);
|
|
70
70
|
}
|
|
71
|
-
|
|
72
|
-
Object.defineProperty(proto, 'counters', {
|
|
71
|
+
Object.defineProperty(Process.prototype, 'counters', {
|
|
73
72
|
enumerable: true,
|
|
74
73
|
get() {
|
|
75
74
|
return {
|
|
@@ -77,26 +76,26 @@ Object.defineProperty(proto, 'counters', {
|
|
|
77
76
|
};
|
|
78
77
|
}
|
|
79
78
|
});
|
|
80
|
-
Object.defineProperty(
|
|
79
|
+
Object.defineProperty(Process.prototype, 'extensions', {
|
|
81
80
|
enumerable: true,
|
|
82
81
|
get() {
|
|
83
82
|
return this[kExtensions];
|
|
84
83
|
}
|
|
85
84
|
});
|
|
86
|
-
Object.defineProperty(
|
|
85
|
+
Object.defineProperty(Process.prototype, 'stopped', {
|
|
87
86
|
enumerable: true,
|
|
88
87
|
get() {
|
|
89
88
|
return this[kStopped];
|
|
90
89
|
}
|
|
91
90
|
});
|
|
92
|
-
Object.defineProperty(
|
|
91
|
+
Object.defineProperty(Process.prototype, 'isRunning', {
|
|
93
92
|
enumerable: true,
|
|
94
93
|
get() {
|
|
95
94
|
if (!this[kConsuming]) return false;
|
|
96
95
|
return !!this.status;
|
|
97
96
|
}
|
|
98
97
|
});
|
|
99
|
-
Object.defineProperty(
|
|
98
|
+
Object.defineProperty(Process.prototype, 'executionId', {
|
|
100
99
|
enumerable: true,
|
|
101
100
|
get() {
|
|
102
101
|
const {
|
|
@@ -106,19 +105,24 @@ Object.defineProperty(proto, 'executionId', {
|
|
|
106
105
|
return executionId || initExecutionId;
|
|
107
106
|
}
|
|
108
107
|
});
|
|
109
|
-
Object.defineProperty(
|
|
108
|
+
Object.defineProperty(Process.prototype, 'execution', {
|
|
110
109
|
enumerable: true,
|
|
111
110
|
get() {
|
|
112
111
|
return this[kExec].execution;
|
|
113
112
|
}
|
|
114
113
|
});
|
|
115
|
-
Object.defineProperty(
|
|
114
|
+
Object.defineProperty(Process.prototype, 'status', {
|
|
116
115
|
enumerable: true,
|
|
117
116
|
get() {
|
|
118
117
|
return this[kStatus];
|
|
119
118
|
}
|
|
120
119
|
});
|
|
121
|
-
|
|
120
|
+
Object.defineProperty(Process.prototype, 'activityStatus', {
|
|
121
|
+
get() {
|
|
122
|
+
return this[kExec].execution && this[kExec].execution.activityStatus || 'idle';
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
Process.prototype.init = function init(useAsExecutionId) {
|
|
122
126
|
const exec = this[kExec];
|
|
123
127
|
const initExecutionId = exec.initExecutionId = useAsExecutionId || (0, _shared.getUniqueId)(this.id);
|
|
124
128
|
this._debug(`initialized with executionId <${initExecutionId}>`);
|
|
@@ -126,7 +130,7 @@ proto.init = function init(useAsExecutionId) {
|
|
|
126
130
|
executionId: initExecutionId
|
|
127
131
|
}));
|
|
128
132
|
};
|
|
129
|
-
|
|
133
|
+
Process.prototype.run = function run(runContent) {
|
|
130
134
|
if (this.isRunning) throw new Error(`process <${this.id}> is already running`);
|
|
131
135
|
const exec = this[kExec];
|
|
132
136
|
const executionId = exec.executionId = exec.initExecutionId || (0, _shared.getUniqueId)(this.id);
|
|
@@ -141,7 +145,7 @@ proto.run = function run(runContent) {
|
|
|
141
145
|
broker.publish('run', 'run.execute', (0, _messageHelper.cloneContent)(content));
|
|
142
146
|
this._activateRunConsumers();
|
|
143
147
|
};
|
|
144
|
-
|
|
148
|
+
Process.prototype.resume = function resume() {
|
|
145
149
|
if (this.isRunning) throw new Error(`cannot resume running process <${this.id}>`);
|
|
146
150
|
if (!this.status) return this;
|
|
147
151
|
this[kStopped] = false;
|
|
@@ -152,7 +156,7 @@ proto.resume = function resume() {
|
|
|
152
156
|
this._activateRunConsumers();
|
|
153
157
|
return this;
|
|
154
158
|
};
|
|
155
|
-
|
|
159
|
+
Process.prototype.recover = function recover(state) {
|
|
156
160
|
if (this.isRunning) throw new Error(`cannot recover running process <${this.id}>`);
|
|
157
161
|
if (!state) return this;
|
|
158
162
|
this[kStopped] = !!state.stopped;
|
|
@@ -170,25 +174,25 @@ proto.recover = function recover(state) {
|
|
|
170
174
|
this.broker.recover(state.broker);
|
|
171
175
|
return this;
|
|
172
176
|
};
|
|
173
|
-
|
|
177
|
+
Process.prototype.shake = function shake(startId) {
|
|
174
178
|
if (this.isRunning) return this.execution.shake(startId);
|
|
175
179
|
return new _ProcessExecution.default(this, this.context).shake(startId);
|
|
176
180
|
};
|
|
177
|
-
|
|
181
|
+
Process.prototype.stop = function stop() {
|
|
178
182
|
if (!this.isRunning) return;
|
|
179
183
|
this.getApi().stop();
|
|
180
184
|
};
|
|
181
|
-
|
|
185
|
+
Process.prototype.getApi = function getApi(message) {
|
|
182
186
|
const execution = this.execution;
|
|
183
187
|
if (execution) return execution.getApi(message);
|
|
184
188
|
return (0, _Api.ProcessApi)(this.broker, message || this[kStateMessage]);
|
|
185
189
|
};
|
|
186
|
-
|
|
190
|
+
Process.prototype.signal = function signal(message) {
|
|
187
191
|
return this.getApi().signal(message, {
|
|
188
192
|
delegate: true
|
|
189
193
|
});
|
|
190
194
|
};
|
|
191
|
-
|
|
195
|
+
Process.prototype.getState = function getState() {
|
|
192
196
|
return this._createMessage({
|
|
193
197
|
environment: this.environment.getState(),
|
|
194
198
|
status: this.status,
|
|
@@ -198,12 +202,12 @@ proto.getState = function getState() {
|
|
|
198
202
|
execution: this.execution && this.execution.getState()
|
|
199
203
|
});
|
|
200
204
|
};
|
|
201
|
-
|
|
205
|
+
Process.prototype.cancelActivity = function cancelActivity(message) {
|
|
202
206
|
return this.getApi().cancel(message, {
|
|
203
207
|
delegate: true
|
|
204
208
|
});
|
|
205
209
|
};
|
|
206
|
-
|
|
210
|
+
Process.prototype._activateRunConsumers = function activateRunConsumers() {
|
|
207
211
|
this[kConsuming] = true;
|
|
208
212
|
const broker = this.broker;
|
|
209
213
|
const {
|
|
@@ -220,14 +224,14 @@ proto._activateRunConsumers = function activateRunConsumers() {
|
|
|
220
224
|
consumerTag: '_process-run'
|
|
221
225
|
});
|
|
222
226
|
};
|
|
223
|
-
|
|
227
|
+
Process.prototype._deactivateRunConsumers = function deactivateRunConsumers() {
|
|
224
228
|
const broker = this.broker;
|
|
225
229
|
broker.cancel('_process-api');
|
|
226
230
|
broker.cancel('_process-run');
|
|
227
231
|
broker.cancel('_process-execution');
|
|
228
232
|
this[kConsuming] = false;
|
|
229
233
|
};
|
|
230
|
-
|
|
234
|
+
Process.prototype._onRunMessage = function onRunMessage(routingKey, message) {
|
|
231
235
|
const {
|
|
232
236
|
content,
|
|
233
237
|
fields
|
|
@@ -310,7 +314,7 @@ proto._onRunMessage = function onRunMessage(routingKey, message) {
|
|
|
310
314
|
}
|
|
311
315
|
message.ack();
|
|
312
316
|
};
|
|
313
|
-
|
|
317
|
+
Process.prototype._onResumeMessage = function onResumeMessage(message) {
|
|
314
318
|
message.ack();
|
|
315
319
|
const stateMessage = this[kStateMessage];
|
|
316
320
|
switch (stateMessage.fields.routingKey) {
|
|
@@ -327,7 +331,7 @@ proto._onResumeMessage = function onResumeMessage(message) {
|
|
|
327
331
|
this._debug(`resume from ${this.status}`);
|
|
328
332
|
return this.broker.publish('run', stateMessage.fields.routingKey, (0, _messageHelper.cloneContent)(stateMessage.content), stateMessage.properties);
|
|
329
333
|
};
|
|
330
|
-
|
|
334
|
+
Process.prototype._onExecutionMessage = function onExecutionMessage(routingKey, message) {
|
|
331
335
|
const content = message.content;
|
|
332
336
|
const messageType = message.properties.type;
|
|
333
337
|
message.ack();
|
|
@@ -354,7 +358,7 @@ proto._onExecutionMessage = function onExecutionMessage(routingKey, message) {
|
|
|
354
358
|
this[kExecuteMessage] = null;
|
|
355
359
|
executeMessage.ack();
|
|
356
360
|
};
|
|
357
|
-
|
|
361
|
+
Process.prototype._publishEvent = function publishEvent(state, content) {
|
|
358
362
|
const eventContent = this._createMessage({
|
|
359
363
|
...content,
|
|
360
364
|
state
|
|
@@ -364,7 +368,7 @@ proto._publishEvent = function publishEvent(state, content) {
|
|
|
364
368
|
mandatory: state === 'error'
|
|
365
369
|
});
|
|
366
370
|
};
|
|
367
|
-
|
|
371
|
+
Process.prototype.sendMessage = function sendMessage(message) {
|
|
368
372
|
const messageContent = message && message.content;
|
|
369
373
|
if (!messageContent) return;
|
|
370
374
|
let targetsFound = false;
|
|
@@ -382,30 +386,30 @@ proto.sendMessage = function sendMessage(message) {
|
|
|
382
386
|
delegate: true
|
|
383
387
|
});
|
|
384
388
|
};
|
|
385
|
-
|
|
389
|
+
Process.prototype.getActivityById = function getActivityById(childId) {
|
|
386
390
|
const execution = this.execution;
|
|
387
391
|
if (execution) return execution.getActivityById(childId);
|
|
388
392
|
return this.context.getActivityById(childId);
|
|
389
393
|
};
|
|
390
|
-
|
|
394
|
+
Process.prototype.getActivities = function getActivities() {
|
|
391
395
|
const execution = this.execution;
|
|
392
396
|
if (execution) return execution.getActivities();
|
|
393
397
|
return this.context.getActivities(this.id);
|
|
394
398
|
};
|
|
395
|
-
|
|
399
|
+
Process.prototype.getStartActivities = function getStartActivities(filterOptions) {
|
|
396
400
|
return this.context.getStartActivities(filterOptions, this.id);
|
|
397
401
|
};
|
|
398
|
-
|
|
402
|
+
Process.prototype.getSequenceFlows = function getSequenceFlows() {
|
|
399
403
|
const execution = this.execution;
|
|
400
404
|
if (execution) return execution.getSequenceFlows();
|
|
401
405
|
return this.context.getSequenceFlows();
|
|
402
406
|
};
|
|
403
|
-
|
|
407
|
+
Process.prototype.getPostponed = function getPostponed(...args) {
|
|
404
408
|
const execution = this.execution;
|
|
405
409
|
if (!execution) return [];
|
|
406
410
|
return execution.getPostponed(...args);
|
|
407
411
|
};
|
|
408
|
-
|
|
412
|
+
Process.prototype._onApiMessage = function onApiMessage(routingKey, message) {
|
|
409
413
|
const messageType = message.properties.type;
|
|
410
414
|
switch (messageType) {
|
|
411
415
|
case 'stop':
|
|
@@ -416,12 +420,12 @@ proto._onApiMessage = function onApiMessage(routingKey, message) {
|
|
|
416
420
|
}
|
|
417
421
|
}
|
|
418
422
|
};
|
|
419
|
-
|
|
423
|
+
Process.prototype._onStop = function onStop() {
|
|
420
424
|
this[kStopped] = true;
|
|
421
425
|
this._deactivateRunConsumers();
|
|
422
426
|
return this._publishEvent('stop');
|
|
423
427
|
};
|
|
424
|
-
|
|
428
|
+
Process.prototype._createMessage = function createMessage(override) {
|
|
425
429
|
return {
|
|
426
430
|
id: this.id,
|
|
427
431
|
type: this.type,
|
|
@@ -433,6 +437,6 @@ proto._createMessage = function createMessage(override) {
|
|
|
433
437
|
...override
|
|
434
438
|
};
|
|
435
439
|
};
|
|
436
|
-
|
|
440
|
+
Process.prototype._debug = function debug(msg) {
|
|
437
441
|
this.logger.debug(`<${this.id}> ${msg}`);
|
|
438
442
|
};
|