bpmn-elements 6.0.1 → 8.0.1
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 +341 -0
- package/README.md +3 -0
- package/dist/index.js +52 -44
- package/dist/src/Api.js +77 -76
- package/dist/src/Context.js +176 -172
- package/dist/src/Environment.js +110 -102
- package/dist/src/EventBroker.js +89 -88
- package/dist/src/ExtensionsMapper.js +2 -2
- package/dist/src/MessageFormatter.js +164 -95
- package/dist/src/Scripts.js +6 -2
- package/dist/src/activity/Activity.js +1105 -916
- package/dist/src/activity/ActivityExecution.js +342 -297
- package/dist/src/activity/Dummy.js +3 -3
- package/dist/src/definition/Definition.js +498 -444
- package/dist/src/definition/DefinitionExecution.js +710 -408
- package/dist/src/error/Errors.js +17 -7
- package/dist/src/eventDefinitions/CancelEventDefinition.js +190 -150
- package/dist/src/eventDefinitions/CompensateEventDefinition.js +194 -161
- package/dist/src/eventDefinitions/ConditionalEventDefinition.js +197 -135
- package/dist/src/eventDefinitions/ErrorEventDefinition.js +207 -165
- package/dist/src/eventDefinitions/EscalationEventDefinition.js +175 -141
- package/dist/src/eventDefinitions/EventDefinitionExecution.js +157 -129
- package/dist/src/eventDefinitions/LinkEventDefinition.js +174 -149
- package/dist/src/eventDefinitions/MessageEventDefinition.js +213 -176
- package/dist/src/eventDefinitions/SignalEventDefinition.js +203 -161
- package/dist/src/eventDefinitions/TerminateEventDefinition.js +21 -23
- package/dist/src/eventDefinitions/TimerEventDefinition.js +243 -228
- package/dist/src/events/BoundaryEvent.js +180 -144
- package/dist/src/events/EndEvent.js +18 -23
- package/dist/src/events/IntermediateCatchEvent.js +44 -58
- package/dist/src/events/IntermediateThrowEvent.js +18 -23
- package/dist/src/events/StartEvent.js +109 -94
- package/dist/src/flows/Association.js +94 -100
- package/dist/src/flows/MessageFlow.js +86 -103
- package/dist/src/flows/SequenceFlow.js +173 -182
- package/dist/src/gateways/EventBasedGateway.js +88 -84
- package/dist/src/gateways/ExclusiveGateway.js +13 -16
- package/dist/src/gateways/InclusiveGateway.js +11 -14
- package/dist/src/gateways/ParallelGateway.js +11 -14
- package/dist/src/getPropertyValue.js +34 -34
- package/dist/src/io/BpmnIO.js +17 -14
- package/dist/src/io/EnvironmentDataObject.js +33 -29
- package/dist/src/io/EnvironmentDataStore.js +33 -29
- package/dist/src/io/EnvironmentDataStoreReference.js +35 -31
- package/dist/src/io/InputOutputSpecification.js +177 -168
- package/dist/src/io/Properties.js +117 -124
- package/dist/src/messageHelper.js +1 -1
- package/dist/src/process/Process.js +439 -362
- package/dist/src/process/ProcessExecution.js +748 -646
- package/dist/src/shared.js +2 -2
- package/dist/src/tasks/CallActivity.js +160 -0
- package/dist/src/tasks/LoopCharacteristics.js +309 -330
- package/dist/src/tasks/ReceiveTask.js +233 -182
- package/dist/src/tasks/ScriptTask.js +35 -41
- package/dist/src/tasks/ServiceImplementation.js +13 -20
- package/dist/src/tasks/ServiceTask.js +82 -75
- package/dist/src/tasks/SignalTask.js +97 -93
- package/dist/src/tasks/StandardLoopCharacteristics.js +1 -1
- package/dist/src/tasks/SubProcess.js +193 -175
- package/dist/src/tasks/Task.js +17 -19
- package/index.js +2 -0
- package/package.json +16 -16
- package/src/Api.js +65 -59
- package/src/Context.js +145 -140
- package/src/Environment.js +116 -100
- package/src/EventBroker.js +67 -68
- package/src/ExtensionsMapper.js +2 -2
- package/src/MessageFormatter.js +132 -74
- package/src/activity/Activity.js +914 -776
- package/src/activity/ActivityExecution.js +293 -247
- package/src/activity/Dummy.js +2 -2
- package/src/definition/Definition.js +437 -401
- package/src/definition/DefinitionExecution.js +598 -340
- package/src/error/Errors.js +11 -6
- package/src/eventDefinitions/CancelEventDefinition.js +164 -121
- package/src/eventDefinitions/CompensateEventDefinition.js +159 -124
- package/src/eventDefinitions/ConditionalEventDefinition.js +147 -104
- package/src/eventDefinitions/ErrorEventDefinition.js +190 -131
- package/src/eventDefinitions/EscalationEventDefinition.js +139 -101
- package/src/eventDefinitions/EventDefinitionExecution.js +127 -95
- package/src/eventDefinitions/LinkEventDefinition.js +160 -129
- package/src/eventDefinitions/MessageEventDefinition.js +178 -121
- package/src/eventDefinitions/SignalEventDefinition.js +162 -106
- package/src/eventDefinitions/TerminateEventDefinition.js +19 -19
- package/src/eventDefinitions/TimerEventDefinition.js +202 -167
- package/src/events/BoundaryEvent.js +156 -115
- package/src/events/EndEvent.js +15 -18
- package/src/events/IntermediateCatchEvent.js +40 -44
- package/src/events/IntermediateThrowEvent.js +15 -18
- package/src/events/StartEvent.js +84 -50
- package/src/flows/Association.js +98 -112
- package/src/flows/MessageFlow.js +81 -97
- package/src/flows/SequenceFlow.js +146 -160
- package/src/gateways/EventBasedGateway.js +75 -68
- package/src/gateways/ExclusiveGateway.js +8 -13
- package/src/gateways/InclusiveGateway.js +8 -13
- package/src/gateways/ParallelGateway.js +8 -13
- package/src/getPropertyValue.js +34 -33
- package/src/io/BpmnIO.js +20 -15
- package/src/io/EnvironmentDataObject.js +29 -18
- package/src/io/EnvironmentDataStore.js +29 -18
- package/src/io/EnvironmentDataStoreReference.js +31 -20
- package/src/io/InputOutputSpecification.js +154 -157
- package/src/io/Properties.js +95 -97
- package/src/process/Process.js +378 -333
- package/src/process/ProcessExecution.js +603 -553
- package/src/tasks/CallActivity.js +130 -0
- package/src/tasks/LoopCharacteristics.js +290 -289
- package/src/tasks/ReceiveTask.js +174 -107
- package/src/tasks/ScriptTask.js +27 -30
- package/src/tasks/ServiceImplementation.js +13 -18
- package/src/tasks/ServiceTask.js +67 -60
- package/src/tasks/SignalTask.js +77 -52
- package/src/tasks/StandardLoopCharacteristics.js +1 -1
- package/src/tasks/SubProcess.js +184 -157
- package/src/tasks/Task.js +15 -19
|
@@ -9,28 +9,28 @@ var _getPropertyValue = _interopRequireDefault(require("../getPropertyValue"));
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
+
const kProperties = Symbol.for('properties');
|
|
13
|
+
const kConsuming = Symbol.for('consuming');
|
|
14
|
+
|
|
12
15
|
function Properties(activity, propertiesDef, context) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
dataInputObjects,
|
|
23
|
-
dataOutputObjects
|
|
24
|
-
} = propertiesDef.values.reduce((result, {
|
|
16
|
+
this.activity = activity;
|
|
17
|
+
this.broker = activity.broker;
|
|
18
|
+
const props = this[kProperties] = {
|
|
19
|
+
properties: [],
|
|
20
|
+
dataInputObjects: [],
|
|
21
|
+
dataOutputObjects: []
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
for (const {
|
|
25
25
|
id,
|
|
26
26
|
...def
|
|
27
|
-
})
|
|
27
|
+
} of propertiesDef.values) {
|
|
28
28
|
const source = {
|
|
29
29
|
id,
|
|
30
30
|
type: def.type,
|
|
31
|
-
name: def.name
|
|
31
|
+
name: def.behaviour && def.behaviour.name
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
props.properties.push(source);
|
|
34
34
|
const inputDataObjectId = (0, _getPropertyValue.default)(def, 'behaviour.dataInput.association.source.dataObject.id');
|
|
35
35
|
const outputDataObjectId = (0, _getPropertyValue.default)(def, 'behaviour.dataOutput.association.target.dataObject.id');
|
|
36
36
|
const inputDataStoreId = (0, _getPropertyValue.default)(def, 'behaviour.dataInput.association.source.dataStore.id');
|
|
@@ -38,7 +38,7 @@ function Properties(activity, propertiesDef, context) {
|
|
|
38
38
|
|
|
39
39
|
if (inputDataObjectId) {
|
|
40
40
|
const reference = context.getDataObjectById(inputDataObjectId);
|
|
41
|
-
|
|
41
|
+
props.dataInputObjects.push({
|
|
42
42
|
id,
|
|
43
43
|
reference
|
|
44
44
|
});
|
|
@@ -49,7 +49,7 @@ function Properties(activity, propertiesDef, context) {
|
|
|
49
49
|
|
|
50
50
|
if (outputDataObjectId) {
|
|
51
51
|
const reference = context.getDataObjectById(outputDataObjectId);
|
|
52
|
-
|
|
52
|
+
props.dataOutputObjects.push({
|
|
53
53
|
id,
|
|
54
54
|
reference: reference
|
|
55
55
|
});
|
|
@@ -60,7 +60,7 @@ function Properties(activity, propertiesDef, context) {
|
|
|
60
60
|
|
|
61
61
|
if (inputDataStoreId) {
|
|
62
62
|
const reference = context.getDataStoreById(inputDataStoreId);
|
|
63
|
-
|
|
63
|
+
props.dataInputObjects.push({
|
|
64
64
|
id,
|
|
65
65
|
reference
|
|
66
66
|
});
|
|
@@ -71,7 +71,7 @@ function Properties(activity, propertiesDef, context) {
|
|
|
71
71
|
|
|
72
72
|
if (outputDataStoreId) {
|
|
73
73
|
const reference = context.getDataStoreById(outputDataStoreId);
|
|
74
|
-
|
|
74
|
+
props.dataOutputObjects.push({
|
|
75
75
|
id,
|
|
76
76
|
reference
|
|
77
77
|
});
|
|
@@ -79,131 +79,126 @@ function Properties(activity, propertiesDef, context) {
|
|
|
79
79
|
reference
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
82
84
|
|
|
83
|
-
|
|
84
|
-
}, {
|
|
85
|
-
properties: [],
|
|
86
|
-
dataInputObjects: [],
|
|
87
|
-
dataOutputObjects: []
|
|
88
|
-
});
|
|
89
|
-
const propertiesApi = {
|
|
90
|
-
type: 'properties',
|
|
91
|
-
activate,
|
|
92
|
-
deactivate
|
|
93
|
-
};
|
|
94
|
-
return propertiesApi;
|
|
95
|
-
|
|
96
|
-
function activate(message) {
|
|
97
|
-
if (activityConsumer) return;
|
|
85
|
+
const proto = Properties.prototype;
|
|
98
86
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
87
|
+
proto.activate = function activate(message) {
|
|
88
|
+
if (this[kConsuming]) return;
|
|
102
89
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
});
|
|
90
|
+
if (message.fields.redelivered && message.content.properties) {
|
|
91
|
+
this._onActivityEvent('activity.extension.resume', message);
|
|
106
92
|
}
|
|
107
93
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
94
|
+
this[kConsuming] = this.broker.subscribeTmp('event', 'activity.#', this._onActivityEvent.bind(this), {
|
|
95
|
+
noAck: true
|
|
96
|
+
});
|
|
97
|
+
};
|
|
111
98
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
99
|
+
proto.deactivate = function deactivate() {
|
|
100
|
+
if (this[kConsuming]) this[kConsuming] = this[kConsuming].cancel();
|
|
101
|
+
};
|
|
116
102
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
103
|
+
proto._onActivityEvent = function onActivityEvent(routingKey, message) {
|
|
104
|
+
if (routingKey === 'activity.enter') {
|
|
105
|
+
return this._formatOnEnter(message);
|
|
106
|
+
}
|
|
120
107
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
108
|
+
if (routingKey === 'activity.extension.resume') {
|
|
109
|
+
return this._formatOnEnter(message);
|
|
124
110
|
}
|
|
125
111
|
|
|
126
|
-
|
|
127
|
-
|
|
112
|
+
if (routingKey === 'activity.execution.completed') {
|
|
113
|
+
return this._formatOnComplete(message);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
128
116
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
properties: getProperties(message)
|
|
134
|
-
});
|
|
135
|
-
}
|
|
117
|
+
proto._formatOnEnter = function formatOnEnter(message) {
|
|
118
|
+
const startRoutingKey = 'run.enter.bpmn-properties';
|
|
119
|
+
const dataInputObjects = this[kProperties].dataInputObjects;
|
|
120
|
+
const broker = this.broker;
|
|
136
121
|
|
|
137
|
-
|
|
138
|
-
|
|
122
|
+
if (!dataInputObjects.length) {
|
|
123
|
+
return broker.getQueue('format-run-q').queueMessage({
|
|
139
124
|
routingKey: startRoutingKey
|
|
140
125
|
}, {
|
|
141
|
-
|
|
142
|
-
properties: getProperties(message)
|
|
143
|
-
});
|
|
144
|
-
return read(broker, dataInputObjects, (_, responses) => {
|
|
145
|
-
broker.publish('format', endRoutingKey, {
|
|
146
|
-
properties: getProperties(message, responses)
|
|
147
|
-
});
|
|
126
|
+
properties: this._getProperties(message)
|
|
148
127
|
});
|
|
149
128
|
}
|
|
150
129
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
130
|
+
const endRoutingKey = 'run.enter.bpmn-properties.end';
|
|
131
|
+
broker.getQueue('format-run-q').queueMessage({
|
|
132
|
+
routingKey: startRoutingKey
|
|
133
|
+
}, {
|
|
134
|
+
endRoutingKey,
|
|
135
|
+
properties: this._getProperties(message)
|
|
136
|
+
});
|
|
137
|
+
return read(broker, dataInputObjects, (_, responses) => {
|
|
138
|
+
broker.publish('format', endRoutingKey, {
|
|
139
|
+
properties: this._getProperties(message, responses)
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
};
|
|
155
143
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
});
|
|
162
|
-
}
|
|
144
|
+
proto._formatOnComplete = function formatOnComplete(message) {
|
|
145
|
+
const startRoutingKey = 'run.end.bpmn-properties';
|
|
146
|
+
const messageOutput = (0, _getPropertyValue.default)(message, 'content.output.properties') || {};
|
|
147
|
+
|
|
148
|
+
const outputProperties = this._getProperties(message, messageOutput);
|
|
163
149
|
|
|
164
|
-
|
|
165
|
-
|
|
150
|
+
const dataOutputObjects = this[kProperties].dataOutputObjects;
|
|
151
|
+
const broker = this.broker;
|
|
152
|
+
|
|
153
|
+
if (!dataOutputObjects.length) {
|
|
154
|
+
return broker.getQueue('format-run-q').queueMessage({
|
|
166
155
|
routingKey: startRoutingKey
|
|
167
156
|
}, {
|
|
168
|
-
endRoutingKey,
|
|
169
157
|
properties: outputProperties
|
|
170
158
|
});
|
|
171
|
-
return write(broker, dataOutputObjects, outputProperties, (_, responses) => {
|
|
172
|
-
broker.publish('format', endRoutingKey, {
|
|
173
|
-
properties: getProperties(message, responses)
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
159
|
}
|
|
177
160
|
|
|
178
|
-
|
|
179
|
-
|
|
161
|
+
const endRoutingKey = 'run.end.bpmn-properties.end';
|
|
162
|
+
broker.getQueue('format-run-q').queueMessage({
|
|
163
|
+
routingKey: startRoutingKey
|
|
164
|
+
}, {
|
|
165
|
+
endRoutingKey,
|
|
166
|
+
properties: outputProperties
|
|
167
|
+
});
|
|
168
|
+
return write(broker, dataOutputObjects, outputProperties, (_, responses) => {
|
|
169
|
+
broker.publish('format', endRoutingKey, {
|
|
170
|
+
properties: this._getProperties(message, responses)
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
};
|
|
180
174
|
|
|
181
|
-
|
|
182
|
-
|
|
175
|
+
proto._getProperties = function getProperties(message, values) {
|
|
176
|
+
let response = {};
|
|
177
|
+
|
|
178
|
+
if (message.content.properties) {
|
|
179
|
+
response = { ...message.content.properties
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
for (const {
|
|
184
|
+
id,
|
|
185
|
+
type,
|
|
186
|
+
name
|
|
187
|
+
} of this[kProperties].properties) {
|
|
188
|
+
if (!(id in response)) {
|
|
189
|
+
response[id] = {
|
|
190
|
+
id,
|
|
191
|
+
type,
|
|
192
|
+
name
|
|
183
193
|
};
|
|
184
194
|
}
|
|
185
195
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
type,
|
|
189
|
-
name,
|
|
190
|
-
value
|
|
191
|
-
}) => {
|
|
192
|
-
if (!(id in result)) {
|
|
193
|
-
result[id] = {
|
|
194
|
-
id,
|
|
195
|
-
type,
|
|
196
|
-
name
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if (value !== undefined) result[id].value = environment.resolveExpression(value, message);
|
|
201
|
-
if (!values || !(id in values)) return result;
|
|
202
|
-
result[id].value = values[id].value;
|
|
203
|
-
return result;
|
|
204
|
-
}, response);
|
|
196
|
+
if (!values || !(id in values)) continue;
|
|
197
|
+
response[id].value = values[id].value;
|
|
205
198
|
}
|
|
206
|
-
|
|
199
|
+
|
|
200
|
+
return response;
|
|
201
|
+
};
|
|
207
202
|
|
|
208
203
|
function read(broker, dataReferences, callback) {
|
|
209
204
|
const responses = {};
|
|
@@ -212,11 +207,10 @@ function read(broker, dataReferences, callback) {
|
|
|
212
207
|
noAck: true
|
|
213
208
|
});
|
|
214
209
|
|
|
215
|
-
for (
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
} = dataReferences[i];
|
|
210
|
+
for (const {
|
|
211
|
+
id: propertyId,
|
|
212
|
+
reference
|
|
213
|
+
} of dataReferences) {
|
|
220
214
|
reference.read(broker, 'data', 'data.read.', {
|
|
221
215
|
correlationId: propertyId
|
|
222
216
|
});
|
|
@@ -238,11 +232,10 @@ function write(broker, dataReferences, properties, callback) {
|
|
|
238
232
|
noAck: true
|
|
239
233
|
});
|
|
240
234
|
|
|
241
|
-
for (
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
} = dataReferences[i];
|
|
235
|
+
for (const {
|
|
236
|
+
id: propertyId,
|
|
237
|
+
reference
|
|
238
|
+
} of dataReferences) {
|
|
246
239
|
const value = propertyId in properties ? properties[propertyId].value : undefined;
|
|
247
240
|
reference.write(broker, 'data', 'data.write.', value, {
|
|
248
241
|
correlationId: propertyId
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.cloneContent = cloneContent;
|
|
7
7
|
exports.cloneMessage = cloneMessage;
|
|
8
8
|
exports.cloneParent = cloneParent;
|
|
9
|
+
exports.pushParent = pushParent;
|
|
9
10
|
exports.shiftParent = shiftParent;
|
|
10
11
|
exports.unshiftParent = unshiftParent;
|
|
11
|
-
exports.pushParent = pushParent;
|
|
12
12
|
|
|
13
13
|
function cloneContent(content, extend) {
|
|
14
14
|
const {
|