bpmn-elements 14.0.1 → 15.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 +0 -4
- package/dist/Context.js +41 -35
- package/dist/Environment.js +1 -1
- package/dist/Expressions.js +1 -1
- package/dist/MessageFormatter.js +0 -1
- package/dist/Timers.js +5 -9
- package/dist/Tracker.js +15 -19
- package/dist/activity/Activity.js +17 -11
- package/dist/activity/ActivityExecution.js +43 -29
- package/dist/definition/Definition.js +1 -1
- package/dist/definition/DefinitionExecution.js +64 -55
- package/dist/eventDefinitions/EscalationEventDefinition.js +1 -1
- package/dist/eventDefinitions/LinkEventDefinition.js +1 -1
- package/dist/eventDefinitions/MessageEventDefinition.js +1 -1
- package/dist/eventDefinitions/SignalEventDefinition.js +3 -2
- package/dist/events/BoundaryEvent.js +11 -9
- package/dist/events/EndEvent.js +1 -1
- package/dist/events/IntermediateCatchEvent.js +1 -1
- package/dist/events/IntermediateThrowEvent.js +1 -1
- package/dist/events/StartEvent.js +1 -1
- package/dist/flows/SequenceFlow.js +1 -1
- package/dist/gateways/EventBasedGateway.js +1 -1
- package/dist/gateways/ExclusiveGateway.js +1 -1
- package/dist/gateways/InclusiveGateway.js +1 -1
- package/dist/gateways/ParallelGateway.js +1 -1
- package/dist/index.js +1 -1
- package/dist/io/InputOutputSpecification.js +1 -1
- package/dist/io/Properties.js +1 -1
- package/dist/process/Process.js +1 -1
- package/dist/process/ProcessExecution.js +67 -40
- package/dist/tasks/CallActivity.js +1 -1
- package/dist/tasks/LoopCharacteristics.js +2 -2
- package/dist/tasks/ReceiveTask.js +1 -1
- package/dist/tasks/ScriptTask.js +1 -1
- package/dist/tasks/ServiceImplementation.js +1 -1
- package/dist/tasks/ServiceTask.js +1 -1
- package/dist/tasks/SignalTask.js +1 -1
- package/dist/tasks/StandardLoopCharacteristics.js +1 -1
- package/dist/tasks/SubProcess.js +27 -28
- package/dist/tasks/Task.js +1 -1
- package/dist/tasks/Transaction.js +1 -1
- package/package.json +5 -3
- package/src/Context.js +51 -35
- package/src/MessageFormatter.js +0 -3
- package/src/Timers.js +5 -9
- package/src/Tracker.js +13 -17
- package/src/activity/Activity.js +5 -3
- package/src/activity/ActivityExecution.js +43 -26
- package/src/definition/DefinitionExecution.js +64 -54
- package/src/eventDefinitions/SignalEventDefinition.js +1 -1
- package/src/events/BoundaryEvent.js +10 -8
- package/src/process/ProcessExecution.js +70 -40
- package/src/tasks/LoopCharacteristics.js +2 -2
- package/src/tasks/SubProcess.js +27 -27
- package/types/types.d.ts +1 -1
package/src/tasks/SubProcess.js
CHANGED
|
@@ -38,7 +38,7 @@ export function SubProcessBehaviour(activity, context) {
|
|
|
38
38
|
this.broker = activity.broker;
|
|
39
39
|
this.executionId = undefined;
|
|
40
40
|
|
|
41
|
-
this[kExecutions] =
|
|
41
|
+
this[kExecutions] = new Set();
|
|
42
42
|
this[kMessageHandlers] = {
|
|
43
43
|
onExecutionCompleted: this._onExecutionCompleted.bind(this),
|
|
44
44
|
};
|
|
@@ -47,12 +47,12 @@ export function SubProcessBehaviour(activity, context) {
|
|
|
47
47
|
Object.defineProperties(SubProcessBehaviour.prototype, {
|
|
48
48
|
execution: {
|
|
49
49
|
get() {
|
|
50
|
-
return this[kExecutions][0];
|
|
50
|
+
return [...this[kExecutions]][0];
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
53
|
executions: {
|
|
54
54
|
get() {
|
|
55
|
-
return this[kExecutions]
|
|
55
|
+
return [...this[kExecutions]];
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
});
|
|
@@ -74,22 +74,20 @@ SubProcessBehaviour.prototype.execute = function execute(executeMessage) {
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
SubProcessBehaviour.prototype.getState = function getState() {
|
|
77
|
+
const states = [];
|
|
78
|
+
for (const pe of this[kExecutions]) {
|
|
79
|
+
const state = pe.getState();
|
|
80
|
+
state.environment = pe.environment.getState();
|
|
81
|
+
states.push(state);
|
|
82
|
+
}
|
|
83
|
+
|
|
77
84
|
if (this.loopCharacteristics) {
|
|
78
85
|
return {
|
|
79
|
-
executions:
|
|
80
|
-
const state = pe.getState();
|
|
81
|
-
state.environment = pe.environment.getState();
|
|
82
|
-
return state;
|
|
83
|
-
}),
|
|
86
|
+
executions: states,
|
|
84
87
|
};
|
|
85
88
|
}
|
|
86
89
|
|
|
87
|
-
|
|
88
|
-
if (execution) {
|
|
89
|
-
const state = execution.getState();
|
|
90
|
-
state.environment = execution.environment.getState();
|
|
91
|
-
return state;
|
|
92
|
-
}
|
|
90
|
+
return states[0];
|
|
93
91
|
};
|
|
94
92
|
|
|
95
93
|
SubProcessBehaviour.prototype.recover = function recover(state) {
|
|
@@ -99,7 +97,7 @@ SubProcessBehaviour.prototype.recover = function recover(state) {
|
|
|
99
97
|
|
|
100
98
|
const loopCharacteristics = this.loopCharacteristics;
|
|
101
99
|
if (loopCharacteristics && state.executions) {
|
|
102
|
-
executions.
|
|
100
|
+
executions.clear();
|
|
103
101
|
for (const se of state.executions) {
|
|
104
102
|
this.recover(se);
|
|
105
103
|
}
|
|
@@ -107,7 +105,7 @@ SubProcessBehaviour.prototype.recover = function recover(state) {
|
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
if (!loopCharacteristics) {
|
|
110
|
-
executions.
|
|
108
|
+
executions.clear();
|
|
111
109
|
}
|
|
112
110
|
|
|
113
111
|
const subEnvironment = this.environment.clone().recover(state.environment);
|
|
@@ -115,15 +113,16 @@ SubProcessBehaviour.prototype.recover = function recover(state) {
|
|
|
115
113
|
|
|
116
114
|
const execution = new ProcessExecution(this.activity, subContext).recover(state);
|
|
117
115
|
|
|
118
|
-
executions.
|
|
116
|
+
executions.add(execution);
|
|
119
117
|
return execution;
|
|
120
118
|
};
|
|
121
119
|
|
|
122
120
|
SubProcessBehaviour.prototype.getPostponed = function getPostponed() {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
121
|
+
let postponed = [];
|
|
122
|
+
for (const pe of this[kExecutions]) {
|
|
123
|
+
postponed = postponed.concat(pe.getPostponed());
|
|
124
|
+
}
|
|
125
|
+
return postponed;
|
|
127
126
|
};
|
|
128
127
|
|
|
129
128
|
SubProcessBehaviour.prototype._upsertExecution = function upsertExecution(executeMessage) {
|
|
@@ -140,7 +139,7 @@ SubProcessBehaviour.prototype._upsertExecution = function upsertExecution(execut
|
|
|
140
139
|
const subContext = this.context.clone(subEnvironment, this.activity);
|
|
141
140
|
|
|
142
141
|
execution = new ProcessExecution(this.activity, subContext);
|
|
143
|
-
this[kExecutions].
|
|
142
|
+
this[kExecutions].add(execution);
|
|
144
143
|
|
|
145
144
|
this._addListeners(executionId);
|
|
146
145
|
|
|
@@ -184,10 +183,9 @@ SubProcessBehaviour.prototype._onExecutionCompleted = function onExecutionComple
|
|
|
184
183
|
|
|
185
184
|
SubProcessBehaviour.prototype._completeExecution = function completeExecution(completeRoutingKey, content) {
|
|
186
185
|
if (this.loopCharacteristics) {
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
executions.splice(executionIdx, 1);
|
|
186
|
+
const execution = this._getExecutionById(content.executionId);
|
|
187
|
+
if (!execution) return;
|
|
188
|
+
this[kExecutions].delete(execution);
|
|
191
189
|
}
|
|
192
190
|
|
|
193
191
|
this.broker.publish('execution', completeRoutingKey, cloneContent(content));
|
|
@@ -209,5 +207,7 @@ SubProcessBehaviour.prototype.getApi = function getApi(apiMessage) {
|
|
|
209
207
|
};
|
|
210
208
|
|
|
211
209
|
SubProcessBehaviour.prototype._getExecutionById = function getExecutionById(executionId) {
|
|
212
|
-
|
|
210
|
+
for (const pe of this[kExecutions]) {
|
|
211
|
+
if (pe.executionId === executionId) return pe;
|
|
212
|
+
}
|
|
213
213
|
};
|
package/types/types.d.ts
CHANGED
|
@@ -220,7 +220,7 @@ declare interface DefinitionExecution {
|
|
|
220
220
|
getProcessByExecutionId(processExecutionId: string): Process;
|
|
221
221
|
getRunningProcesses(): Process[];
|
|
222
222
|
getExecutableProcesses(): Process[];
|
|
223
|
-
getPostponed(filterFn
|
|
223
|
+
getPostponed(filterFn?: filterPostponed): Api<ElementBase>[];
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
declare interface ActivityExecution {
|