bpmn-elements 7.0.0 → 8.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/CHANGELOG.md +13 -0
- package/dist/src/Context.js +50 -40
- package/dist/src/Environment.js +39 -19
- package/dist/src/MessageFormatter.js +11 -11
- package/dist/src/activity/Activity.js +91 -91
- package/dist/src/activity/ActivityExecution.js +35 -35
- package/dist/src/definition/Definition.js +50 -50
- package/dist/src/definition/DefinitionExecution.js +114 -125
- package/dist/src/eventDefinitions/CancelEventDefinition.js +16 -16
- package/dist/src/eventDefinitions/CompensateEventDefinition.js +24 -24
- package/dist/src/eventDefinitions/ConditionalEventDefinition.js +8 -8
- package/dist/src/eventDefinitions/ErrorEventDefinition.js +26 -26
- package/dist/src/eventDefinitions/EscalationEventDefinition.js +20 -20
- package/dist/src/eventDefinitions/EventDefinitionExecution.js +14 -14
- package/dist/src/eventDefinitions/LinkEventDefinition.js +15 -15
- package/dist/src/eventDefinitions/MessageEventDefinition.js +23 -23
- package/dist/src/eventDefinitions/SignalEventDefinition.js +24 -24
- package/dist/src/eventDefinitions/TimerEventDefinition.js +21 -21
- package/dist/src/events/BoundaryEvent.js +20 -20
- package/dist/src/events/EndEvent.js +3 -3
- package/dist/src/events/IntermediateCatchEvent.js +3 -3
- package/dist/src/events/IntermediateThrowEvent.js +3 -3
- package/dist/src/events/StartEvent.js +9 -9
- package/dist/src/flows/Association.js +7 -7
- package/dist/src/flows/MessageFlow.js +9 -9
- package/dist/src/flows/SequenceFlow.js +7 -7
- package/dist/src/gateways/EventBasedGateway.js +11 -11
- package/dist/src/io/InputOutputSpecification.js +4 -4
- package/dist/src/io/Properties.js +9 -9
- package/dist/src/process/Process.js +64 -61
- package/dist/src/process/ProcessExecution.js +93 -90
- package/dist/src/tasks/ReceiveTask.js +16 -16
- package/dist/src/tasks/SubProcess.js +16 -18
- package/package.json +9 -9
- package/src/Context.js +48 -40
- package/src/Environment.js +48 -20
- package/src/EventBroker.js +1 -1
- package/src/MessageFormatter.js +11 -11
- package/src/activity/Activity.js +91 -91
- package/src/activity/ActivityExecution.js +34 -34
- package/src/definition/Definition.js +51 -50
- package/src/definition/DefinitionExecution.js +111 -113
- package/src/eventDefinitions/CancelEventDefinition.js +16 -16
- package/src/eventDefinitions/CompensateEventDefinition.js +25 -24
- package/src/eventDefinitions/ConditionalEventDefinition.js +8 -8
- package/src/eventDefinitions/ErrorEventDefinition.js +26 -26
- package/src/eventDefinitions/EscalationEventDefinition.js +20 -20
- package/src/eventDefinitions/EventDefinitionExecution.js +14 -14
- package/src/eventDefinitions/LinkEventDefinition.js +15 -15
- package/src/eventDefinitions/MessageEventDefinition.js +23 -23
- package/src/eventDefinitions/SignalEventDefinition.js +24 -24
- package/src/eventDefinitions/TimerEventDefinition.js +21 -21
- package/src/events/BoundaryEvent.js +20 -20
- 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 +9 -9
- package/src/flows/Association.js +7 -7
- package/src/flows/MessageFlow.js +9 -9
- package/src/flows/SequenceFlow.js +7 -7
- package/src/gateways/EventBasedGateway.js +11 -11
- package/src/io/BpmnIO.js +5 -1
- package/src/io/InputOutputSpecification.js +4 -4
- package/src/io/Properties.js +9 -9
- package/src/process/Process.js +62 -58
- package/src/process/ProcessExecution.js +86 -88
- package/src/tasks/ReceiveTask.js +16 -16
- package/src/tasks/SubProcess.js +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
# 8.0.0
|
|
5
|
+
|
|
6
|
+
## Breaking
|
|
7
|
+
|
|
8
|
+
- all processes will invoked with a cloned context and environment
|
|
9
|
+
- a cloned environment will no longer forward output
|
|
10
|
+
- remove output prop from process state. Not sure why it was there in the first place?
|
|
11
|
+
- remove mysterious options symbol from Environment
|
|
12
|
+
|
|
13
|
+
## Fix
|
|
14
|
+
|
|
15
|
+
- fix double completion if resumed on error
|
|
16
|
+
|
|
4
17
|
# 7.0.0
|
|
5
18
|
|
|
6
19
|
Support Call activity
|
package/dist/src/Context.js
CHANGED
|
@@ -45,7 +45,9 @@ function ContextInstance(definitionContext, environment) {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
ContextInstance.prototype
|
|
48
|
+
const proto = ContextInstance.prototype;
|
|
49
|
+
|
|
50
|
+
proto.getActivityById = function getActivityById(activityId) {
|
|
49
51
|
const activityInstance = this.refs.activityRefs[activityId];
|
|
50
52
|
if (activityInstance) return activityInstance;
|
|
51
53
|
const activity = this.definitionContext.getActivityById(activityId);
|
|
@@ -53,14 +55,14 @@ ContextInstance.prototype.getActivityById = function getActivityById(activityId)
|
|
|
53
55
|
return this.upsertActivity(activity);
|
|
54
56
|
};
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
proto.upsertActivity = function upsertActivity(activityDef) {
|
|
57
59
|
let activityInstance = this.refs.activityRefs[activityDef.id];
|
|
58
60
|
if (activityInstance) return activityInstance;
|
|
59
61
|
activityInstance = this.refs.activityRefs[activityDef.id] = new activityDef.Behaviour(activityDef, this);
|
|
60
62
|
return activityInstance;
|
|
61
63
|
};
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
proto.getSequenceFlowById = function getSequenceFlowById(sequenceFlowId) {
|
|
64
66
|
const flowInstance = this.refs.sequenceFlowRefs[sequenceFlowId];
|
|
65
67
|
if (flowInstance) return flowInstance;
|
|
66
68
|
const flowDef = this.definitionContext.getSequenceFlowById(sequenceFlowId);
|
|
@@ -68,31 +70,31 @@ ContextInstance.prototype.getSequenceFlowById = function getSequenceFlowById(seq
|
|
|
68
70
|
return this.upsertSequenceFlow(flowDef);
|
|
69
71
|
};
|
|
70
72
|
|
|
71
|
-
|
|
73
|
+
proto.getInboundSequenceFlows = function getInboundSequenceFlows(activityId) {
|
|
72
74
|
return (this.definitionContext.getInboundSequenceFlows(activityId) || []).map(flow => this.upsertSequenceFlow(flow));
|
|
73
75
|
};
|
|
74
76
|
|
|
75
|
-
|
|
77
|
+
proto.getOutboundSequenceFlows = function getOutboundSequenceFlows(activityId) {
|
|
76
78
|
return (this.definitionContext.getOutboundSequenceFlows(activityId) || []).map(flow => this.upsertSequenceFlow(flow));
|
|
77
79
|
};
|
|
78
80
|
|
|
79
|
-
|
|
81
|
+
proto.getInboundAssociations = function getInboundAssociations(activityId) {
|
|
80
82
|
return (this.definitionContext.getInboundAssociations(activityId) || []).map(association => this.upsertAssociation(association));
|
|
81
83
|
};
|
|
82
84
|
|
|
83
|
-
|
|
85
|
+
proto.getOutboundAssociations = function getOutboundAssociations(activityId) {
|
|
84
86
|
return (this.definitionContext.getOutboundAssociations(activityId) || []).map(association => this.upsertAssociation(association));
|
|
85
87
|
};
|
|
86
88
|
|
|
87
|
-
|
|
89
|
+
proto.getActivities = function getActivities(scopeId) {
|
|
88
90
|
return (this.definitionContext.getActivities(scopeId) || []).map(activityDef => this.upsertActivity(activityDef));
|
|
89
91
|
};
|
|
90
92
|
|
|
91
|
-
|
|
93
|
+
proto.getSequenceFlows = function getSequenceFlows(scopeId) {
|
|
92
94
|
return (this.definitionContext.getSequenceFlows(scopeId) || []).map(flow => this.upsertSequenceFlow(flow));
|
|
93
95
|
};
|
|
94
96
|
|
|
95
|
-
|
|
97
|
+
proto.upsertSequenceFlow = function upsertSequenceFlow(flowDefinition) {
|
|
96
98
|
const refs = this.refs.sequenceFlowRefs;
|
|
97
99
|
let flowInstance = refs[flowDefinition.id];
|
|
98
100
|
if (flowInstance) return flowInstance;
|
|
@@ -101,11 +103,11 @@ ContextInstance.prototype.upsertSequenceFlow = function upsertSequenceFlow(flowD
|
|
|
101
103
|
return flowInstance;
|
|
102
104
|
};
|
|
103
105
|
|
|
104
|
-
|
|
106
|
+
proto.getAssociations = function getAssociations(scopeId) {
|
|
105
107
|
return (this.definitionContext.getAssociations(scopeId) || []).map(association => this.upsertAssociation(association));
|
|
106
108
|
};
|
|
107
109
|
|
|
108
|
-
|
|
110
|
+
proto.upsertAssociation = function upsertAssociation(associationDefinition) {
|
|
109
111
|
const refs = this.refs.associationRefs;
|
|
110
112
|
let instance = refs[associationDefinition.id];
|
|
111
113
|
if (instance) return instance;
|
|
@@ -113,44 +115,42 @@ ContextInstance.prototype.upsertAssociation = function upsertAssociation(associa
|
|
|
113
115
|
return instance;
|
|
114
116
|
};
|
|
115
117
|
|
|
116
|
-
|
|
118
|
+
proto.clone = function clone(newEnvironment) {
|
|
117
119
|
return new ContextInstance(this.definitionContext, newEnvironment || this.environment);
|
|
118
120
|
};
|
|
119
121
|
|
|
120
|
-
|
|
122
|
+
proto.getProcessById = function getProcessById(processId) {
|
|
121
123
|
const refs = this.refs.processRefs;
|
|
122
|
-
let
|
|
123
|
-
if (
|
|
124
|
+
let bp = this.refs.processRefs[processId];
|
|
125
|
+
if (bp) return bp;
|
|
124
126
|
const processDefinition = this.definitionContext.getProcessById(processId);
|
|
125
127
|
if (!processDefinition) return null;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
const bpContext = this.clone(this.environment.clone());
|
|
129
|
+
bp = refs[processId] = new processDefinition.Behaviour(processDefinition, bpContext);
|
|
130
|
+
this.refs.processes.push(bp);
|
|
131
|
+
return bp;
|
|
129
132
|
};
|
|
130
133
|
|
|
131
|
-
|
|
134
|
+
proto.getNewProcessById = function getNewProcessById(processId) {
|
|
132
135
|
if (!this.getProcessById(processId)) return null;
|
|
133
|
-
const
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
...processOptions
|
|
137
|
-
})));
|
|
138
|
-
return processInstance;
|
|
136
|
+
const bpDef = this.definitionContext.getProcessById(processId);
|
|
137
|
+
const bp = new bpDef.Behaviour(bpDef, this.clone(this.environment.clone()));
|
|
138
|
+
return bp;
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
proto.getProcesses = function getProcesses() {
|
|
142
142
|
return this.definitionContext.getProcesses().map(({
|
|
143
143
|
id: processId
|
|
144
144
|
}) => this.getProcessById(processId));
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
proto.getExecutableProcesses = function getExecutableProcesses() {
|
|
148
148
|
return this.definitionContext.getExecutableProcesses().map(({
|
|
149
149
|
id: processId
|
|
150
150
|
}) => this.getProcessById(processId));
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
proto.getMessageFlows = function getMessageFlows(sourceId) {
|
|
154
154
|
if (!this.refs.messageFlows.length) {
|
|
155
155
|
const flows = this.definitionContext.getMessageFlows() || [];
|
|
156
156
|
this.refs.messageFlows.push(...flows.map(flow => new flow.Behaviour(flow, this)));
|
|
@@ -159,7 +159,7 @@ ContextInstance.prototype.getMessageFlows = function getMessageFlows(sourceId) {
|
|
|
159
159
|
return this.refs.messageFlows.filter(flow => flow.source.processId === sourceId);
|
|
160
160
|
};
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
proto.getDataObjectById = function getDataObjectById(referenceId) {
|
|
163
163
|
let dataObject;
|
|
164
164
|
if (dataObject = this.refs.dataObjectRefs[referenceId]) return dataObject;
|
|
165
165
|
const dataObjectDef = this.definitionContext.getDataObjectById(referenceId);
|
|
@@ -168,7 +168,7 @@ ContextInstance.prototype.getDataObjectById = function getDataObjectById(referen
|
|
|
168
168
|
return dataObject;
|
|
169
169
|
};
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
proto.getDataStoreById = function getDataStoreById(referenceId) {
|
|
172
172
|
let dataStore;
|
|
173
173
|
if (dataStore = this.refs.dataStoreRefs[referenceId]) return dataStore;
|
|
174
174
|
const dataStoreDef = this.definitionContext.getDataStoreById(referenceId) || this.definitionContext.getDataStoreReferenceById(referenceId);
|
|
@@ -177,22 +177,32 @@ ContextInstance.prototype.getDataStoreById = function getDataStoreById(reference
|
|
|
177
177
|
return dataStore;
|
|
178
178
|
};
|
|
179
179
|
|
|
180
|
-
|
|
180
|
+
proto.getStartActivities = function getStartActivities(filterOptions, scopeId) {
|
|
181
181
|
const {
|
|
182
182
|
referenceId,
|
|
183
183
|
referenceType = 'unknown'
|
|
184
184
|
} = filterOptions || {};
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
if (!
|
|
189
|
-
if (
|
|
190
|
-
|
|
185
|
+
const result = [];
|
|
186
|
+
|
|
187
|
+
for (const activity of this.getActivities()) {
|
|
188
|
+
if (!activity.isStart) continue;
|
|
189
|
+
if (scopeId && activity.parent.id !== scopeId) continue;
|
|
190
|
+
|
|
191
|
+
if (!filterOptions) {
|
|
192
|
+
result.push(activity);
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (!activity.behaviour.eventDefinitions && !activity.behaviour.eventDefinitions) continue;
|
|
197
|
+
const ref = activity.eventDefinitions.some(ed => {
|
|
191
198
|
return ed.reference && ed.reference.id === referenceId && ed.reference.referenceType === referenceType;
|
|
192
199
|
});
|
|
193
|
-
|
|
200
|
+
if (ref) result.push(activity);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return result;
|
|
194
204
|
};
|
|
195
205
|
|
|
196
|
-
|
|
206
|
+
proto.loadExtensions = function loadExtensions(activity) {
|
|
197
207
|
return this.extensionsMapper.get(activity);
|
|
198
208
|
};
|
package/dist/src/Environment.js
CHANGED
|
@@ -13,23 +13,22 @@ var _Timers = require("./Timers");
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const defaultOptions = ['extensions', '
|
|
16
|
+
const kServices = Symbol.for('services');
|
|
17
|
+
const kVariables = Symbol.for('variables');
|
|
18
|
+
const defaultOptions = ['expressions', 'extensions', 'Logger', 'output', 'scripts', 'services', 'settings', 'timers', 'variables'];
|
|
19
19
|
|
|
20
20
|
function Environment(options = {}) {
|
|
21
|
-
this[optionsSymbol] = options;
|
|
22
21
|
this.options = validateOptions(options);
|
|
23
22
|
this.expressions = options.expressions || (0, _Expressions.default)();
|
|
24
23
|
this.extensions = options.extensions;
|
|
25
24
|
this.output = options.output || {};
|
|
26
25
|
this.scripts = options.scripts || (0, _Scripts.Scripts)();
|
|
27
|
-
this.
|
|
26
|
+
this.timers = options.timers || (0, _Timers.Timers)();
|
|
28
27
|
this.settings = { ...options.settings
|
|
29
28
|
};
|
|
30
|
-
this.timers = options.timers || (0, _Timers.Timers)();
|
|
31
29
|
this.Logger = options.Logger || DummyLogger;
|
|
32
|
-
this[
|
|
30
|
+
this[kServices] = options.services || {};
|
|
31
|
+
this[kVariables] = options.variables || {};
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
const proto = Environment.prototype;
|
|
@@ -37,7 +36,25 @@ Object.defineProperty(proto, 'variables', {
|
|
|
37
36
|
enumerable: true,
|
|
38
37
|
|
|
39
38
|
get() {
|
|
40
|
-
return this[
|
|
39
|
+
return this[kVariables];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(proto, 'services', {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
|
|
46
|
+
get() {
|
|
47
|
+
return this[kServices];
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
set(value) {
|
|
51
|
+
const services = this[kServices];
|
|
52
|
+
|
|
53
|
+
for (const name in services) {
|
|
54
|
+
if (!(name in value)) delete services[name];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
Object.assign(services, value);
|
|
41
58
|
}
|
|
42
59
|
|
|
43
60
|
});
|
|
@@ -46,7 +63,7 @@ proto.getState = function getState() {
|
|
|
46
63
|
return {
|
|
47
64
|
settings: { ...this.settings
|
|
48
65
|
},
|
|
49
|
-
variables: { ...this
|
|
66
|
+
variables: { ...this[kVariables]
|
|
50
67
|
},
|
|
51
68
|
output: { ...this.output
|
|
52
69
|
}
|
|
@@ -55,22 +72,18 @@ proto.getState = function getState() {
|
|
|
55
72
|
|
|
56
73
|
proto.recover = function recover(state) {
|
|
57
74
|
if (!state) return this;
|
|
58
|
-
const recoverOptions = validateOptions(state);
|
|
59
|
-
Object.assign(this[optionsSymbol], recoverOptions);
|
|
60
75
|
if (state.settings) Object.assign(this.settings, state.settings);
|
|
61
|
-
if (state.variables) Object.assign(this[
|
|
76
|
+
if (state.variables) Object.assign(this[kVariables], state.variables);
|
|
62
77
|
if (state.output) Object.assign(this.output, state.output);
|
|
63
78
|
return this;
|
|
64
79
|
};
|
|
65
80
|
|
|
66
81
|
proto.clone = function clone(overrideOptions = {}) {
|
|
67
|
-
const services = this
|
|
82
|
+
const services = this[kServices];
|
|
68
83
|
const newOptions = {
|
|
69
84
|
settings: { ...this.settings
|
|
70
85
|
},
|
|
71
|
-
variables: { ...this
|
|
72
|
-
},
|
|
73
|
-
output: { ...this.output
|
|
86
|
+
variables: { ...this[kVariables]
|
|
74
87
|
},
|
|
75
88
|
Logger: this.Logger,
|
|
76
89
|
extensions: this.extensions,
|
|
@@ -89,11 +102,18 @@ proto.clone = function clone(overrideOptions = {}) {
|
|
|
89
102
|
|
|
90
103
|
proto.assignVariables = function assignVariables(newVars) {
|
|
91
104
|
if (!newVars || typeof newVars !== 'object') return;
|
|
92
|
-
this[
|
|
105
|
+
this[kVariables] = { ...this.variables,
|
|
93
106
|
...newVars
|
|
94
107
|
};
|
|
95
108
|
};
|
|
96
109
|
|
|
110
|
+
proto.assignSettings = function assignVariables(newSettings) {
|
|
111
|
+
if (!newSettings || typeof newSettings !== 'object') return;
|
|
112
|
+
this.settings = { ...this.settings,
|
|
113
|
+
...newSettings
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
|
|
97
117
|
proto.getScript = function getScript(...args) {
|
|
98
118
|
return this.scripts.getScript(...args);
|
|
99
119
|
};
|
|
@@ -103,7 +123,7 @@ proto.registerScript = function registerScript(...args) {
|
|
|
103
123
|
};
|
|
104
124
|
|
|
105
125
|
proto.getServiceByName = function getServiceByName(serviceName) {
|
|
106
|
-
return this
|
|
126
|
+
return this[kServices][serviceName];
|
|
107
127
|
};
|
|
108
128
|
|
|
109
129
|
proto.resolveExpression = function resolveExpression(expression, message = {}, expressionFnContext) {
|
|
@@ -115,7 +135,7 @@ proto.resolveExpression = function resolveExpression(expression, message = {}, e
|
|
|
115
135
|
};
|
|
116
136
|
|
|
117
137
|
proto.addService = function addService(name, fn) {
|
|
118
|
-
this
|
|
138
|
+
this[kServices][name] = fn;
|
|
119
139
|
};
|
|
120
140
|
|
|
121
141
|
function validateOptions(input) {
|
|
@@ -13,8 +13,8 @@ var _Errors = require("./error/Errors");
|
|
|
13
13
|
|
|
14
14
|
var _smqp = require("smqp");
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const kOnMessage = Symbol.for('onMessage');
|
|
17
|
+
const kExecution = Symbol.for('execution');
|
|
18
18
|
|
|
19
19
|
function Formatter(element, formatQ) {
|
|
20
20
|
const {
|
|
@@ -27,7 +27,7 @@ function Formatter(element, formatQ) {
|
|
|
27
27
|
this.logger = logger;
|
|
28
28
|
this.formatQ = formatQ;
|
|
29
29
|
this.pendingFormats = [];
|
|
30
|
-
this[
|
|
30
|
+
this[kOnMessage] = this._onMessage.bind(this);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
Formatter.prototype.format = function format(message, callback) {
|
|
@@ -40,7 +40,7 @@ Formatter.prototype.format = function format(message, callback) {
|
|
|
40
40
|
correlationId,
|
|
41
41
|
persistent: false
|
|
42
42
|
});
|
|
43
|
-
this[
|
|
43
|
+
this[kExecution] = {
|
|
44
44
|
correlationId,
|
|
45
45
|
formatKey: message.fields.routingKey,
|
|
46
46
|
runMessage: (0, _messageHelper.cloneMessage)(message),
|
|
@@ -49,7 +49,7 @@ Formatter.prototype.format = function format(message, callback) {
|
|
|
49
49
|
formatted: false,
|
|
50
50
|
executeMessage: null
|
|
51
51
|
};
|
|
52
|
-
formatQ.consume(this[
|
|
52
|
+
formatQ.consume(this[kOnMessage], {
|
|
53
53
|
consumerTag,
|
|
54
54
|
prefetch: 100
|
|
55
55
|
});
|
|
@@ -61,7 +61,7 @@ Formatter.prototype._onMessage = function onMessage(routingKey, message) {
|
|
|
61
61
|
correlationId,
|
|
62
62
|
pending,
|
|
63
63
|
executeMessage
|
|
64
|
-
} = this[
|
|
64
|
+
} = this[kExecution];
|
|
65
65
|
const asyncFormatting = pending.length;
|
|
66
66
|
|
|
67
67
|
switch (routingKey) {
|
|
@@ -73,7 +73,7 @@ Formatter.prototype._onMessage = function onMessage(routingKey, message) {
|
|
|
73
73
|
return this._complete(message);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
this[
|
|
76
|
+
this[kExecution].executeMessage = message;
|
|
77
77
|
break;
|
|
78
78
|
|
|
79
79
|
default:
|
|
@@ -119,8 +119,8 @@ Formatter.prototype._complete = function complete(message, isError) {
|
|
|
119
119
|
callback,
|
|
120
120
|
formatted,
|
|
121
121
|
executeMessage
|
|
122
|
-
} = this[
|
|
123
|
-
this[
|
|
122
|
+
} = this[kExecution];
|
|
123
|
+
this[kExecution] = null;
|
|
124
124
|
if (executeMessage) executeMessage.ack();
|
|
125
125
|
this.broker.cancel(message.fields.consumerTag);
|
|
126
126
|
|
|
@@ -137,7 +137,7 @@ Formatter.prototype._complete = function complete(message, isError) {
|
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
Formatter.prototype._decorate = function decorate(withContent) {
|
|
140
|
-
const content = this[
|
|
140
|
+
const content = this[kExecution].runMessage.content;
|
|
141
141
|
|
|
142
142
|
for (const key in withContent) {
|
|
143
143
|
switch (key) {
|
|
@@ -157,7 +157,7 @@ Formatter.prototype._decorate = function decorate(withContent) {
|
|
|
157
157
|
default:
|
|
158
158
|
{
|
|
159
159
|
content[key] = withContent[key];
|
|
160
|
-
this[
|
|
160
|
+
this[kExecution].formatted = true;
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
}
|