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
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = InclusiveGateway;
|
|
7
6
|
exports.InclusiveGatewayBehaviour = InclusiveGatewayBehaviour;
|
|
7
|
+
exports.default = InclusiveGateway;
|
|
8
8
|
|
|
9
9
|
var _Activity = _interopRequireDefault(require("../activity/Activity"));
|
|
10
10
|
|
|
@@ -13,7 +13,7 @@ var _messageHelper = require("../messageHelper");
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
|
|
15
15
|
function InclusiveGateway(activityDef, context) {
|
|
16
|
-
return
|
|
16
|
+
return new _Activity.default(InclusiveGatewayBehaviour, activityDef, context);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function InclusiveGatewayBehaviour(activity) {
|
|
@@ -22,16 +22,13 @@ function InclusiveGatewayBehaviour(activity) {
|
|
|
22
22
|
type,
|
|
23
23
|
broker
|
|
24
24
|
} = activity;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
return source;
|
|
25
|
+
this.id = id;
|
|
26
|
+
this.type = type;
|
|
27
|
+
this.broker = broker;
|
|
28
|
+
}
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
30
|
+
InclusiveGatewayBehaviour.prototype.execute = function execute({
|
|
31
|
+
content
|
|
32
|
+
}) {
|
|
33
|
+
this.broker.publish('execution', 'execute.completed', (0, _messageHelper.cloneContent)(content));
|
|
34
|
+
};
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = ParallelGateway;
|
|
7
6
|
exports.ParallelGatewayBehaviour = ParallelGatewayBehaviour;
|
|
7
|
+
exports.default = ParallelGateway;
|
|
8
8
|
|
|
9
9
|
var _Activity = _interopRequireDefault(require("../activity/Activity"));
|
|
10
10
|
|
|
@@ -13,7 +13,7 @@ var _messageHelper = require("../messageHelper");
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
|
|
15
15
|
function ParallelGateway(activityDef, context) {
|
|
16
|
-
return
|
|
16
|
+
return new _Activity.default(ParallelGatewayBehaviour, { ...activityDef,
|
|
17
17
|
isParallelGateway: true
|
|
18
18
|
}, context);
|
|
19
19
|
}
|
|
@@ -24,16 +24,13 @@ function ParallelGatewayBehaviour(activity) {
|
|
|
24
24
|
type,
|
|
25
25
|
broker
|
|
26
26
|
} = activity;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
return source;
|
|
27
|
+
this.id = id;
|
|
28
|
+
this.type = type;
|
|
29
|
+
this.broker = broker;
|
|
30
|
+
}
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
32
|
+
ParallelGatewayBehaviour.prototype.execute = function execute({
|
|
33
|
+
content
|
|
34
|
+
}) {
|
|
35
|
+
this.broker.publish('execution', 'execute.completed', (0, _messageHelper.cloneContent)(content));
|
|
36
|
+
};
|
|
@@ -14,7 +14,7 @@ exports.default = _default;
|
|
|
14
14
|
function getPropertyValue(inputContext, propertyPath, fnScope) {
|
|
15
15
|
if (!inputContext) return;
|
|
16
16
|
let resultValue;
|
|
17
|
-
let next = iterateProps(inputContext, inputContext, propertyPath.trim());
|
|
17
|
+
let next = iterateProps(inputContext, inputContext, propertyPath.trim(), fnScope);
|
|
18
18
|
|
|
19
19
|
while (next) {
|
|
20
20
|
resultValue = next.getResult();
|
|
@@ -22,47 +22,47 @@ function getPropertyValue(inputContext, propertyPath, fnScope) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
return resultValue;
|
|
25
|
+
}
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return '';
|
|
36
|
-
});
|
|
37
|
-
if (rest === iteratePropertyPath) return;
|
|
38
|
-
if (result === undefined || result === null) return;
|
|
27
|
+
function iterateProps(base, iterateContext, iteratePropertyPath, fnScope) {
|
|
28
|
+
let result;
|
|
29
|
+
const rest = iteratePropertyPath.replace(propertyPattern, (match, fnName, args, p, prop) => {
|
|
30
|
+
if (fnName) {
|
|
31
|
+
result = executeFn(getNamedValue(iterateContext, fnName), args, base, fnScope);
|
|
32
|
+
} else {
|
|
33
|
+
result = getNamedValue(iterateContext, prop);
|
|
34
|
+
}
|
|
39
35
|
|
|
40
|
-
|
|
36
|
+
return '';
|
|
37
|
+
});
|
|
38
|
+
if (rest === iteratePropertyPath) return;
|
|
39
|
+
if (result === undefined || result === null) return;
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
if (rest !== '') return;
|
|
44
|
-
return result;
|
|
45
|
-
};
|
|
41
|
+
const iterateNext = () => iterateProps(base, result, rest, fnScope);
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
iterateNext.getResult = () => {
|
|
44
|
+
if (rest !== '') return;
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
49
47
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
let callArguments = [];
|
|
48
|
+
return iterateNext;
|
|
49
|
+
}
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
callArguments.push(base);
|
|
58
|
-
}
|
|
51
|
+
function executeFn(fn, args, base, fnScope) {
|
|
52
|
+
if (!fn) return;
|
|
53
|
+
let callArguments = [];
|
|
59
54
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}.call(fnScope);
|
|
55
|
+
if (args) {
|
|
56
|
+
callArguments = splitArguments(args, base, fnScope);
|
|
57
|
+
} else {
|
|
58
|
+
callArguments.push(base);
|
|
65
59
|
}
|
|
60
|
+
|
|
61
|
+
if (!fnScope) return fn.apply(null, callArguments);
|
|
62
|
+
return function ScopedIIFE() {
|
|
63
|
+
// eslint-disable-line no-extra-parens
|
|
64
|
+
return fn.apply(this, callArguments);
|
|
65
|
+
}.call(fnScope);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
function splitArguments(args, base, fnScope) {
|
package/dist/src/io/BpmnIO.js
CHANGED
|
@@ -6,23 +6,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = BpmnIO;
|
|
7
7
|
|
|
8
8
|
function BpmnIO(activity, context) {
|
|
9
|
+
this.activity = activity;
|
|
10
|
+
this.context = context;
|
|
9
11
|
const {
|
|
10
12
|
ioSpecification: ioSpecificationDef,
|
|
11
13
|
properties: propertiesDef
|
|
12
14
|
} = activity.behaviour;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
activate(message) {
|
|
18
|
-
if (bpmnProperties) bpmnProperties.activate(message);
|
|
19
|
-
if (ioSpecification) ioSpecification.activate(message);
|
|
20
|
-
},
|
|
15
|
+
this.specification = ioSpecificationDef && new ioSpecificationDef.Behaviour(activity, ioSpecificationDef, context);
|
|
16
|
+
this.properties = propertiesDef && new propertiesDef.Behaviour(activity, propertiesDef, context);
|
|
17
|
+
}
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
BpmnIO.prototype.activate = function activate(message) {
|
|
20
|
+
const properties = this.properties,
|
|
21
|
+
specification = this.specification;
|
|
22
|
+
if (properties) properties.activate(message);
|
|
23
|
+
if (specification) specification.activate(message);
|
|
24
|
+
};
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
BpmnIO.prototype.deactivate = function deactivate(message) {
|
|
27
|
+
const properties = this.properties,
|
|
28
|
+
specification = this.specification;
|
|
29
|
+
if (properties) properties.deactivate(message);
|
|
30
|
+
if (specification) specification.deactivate(message);
|
|
31
|
+
};
|
|
@@ -15,34 +15,38 @@ function EnvironmentDataObject(dataObjectDef, {
|
|
|
15
15
|
behaviour,
|
|
16
16
|
parent
|
|
17
17
|
} = dataObjectDef;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
18
|
+
this.id = id;
|
|
19
|
+
this.type = type;
|
|
20
|
+
this.name = name;
|
|
21
|
+
this.behaviour = behaviour;
|
|
22
|
+
this.parent = parent;
|
|
23
|
+
this.environment = environment;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
EnvironmentDataObject.prototype.read = function read(broker, exchange, routingKeyPrefix, messageProperties) {
|
|
27
|
+
const environment = this.environment;
|
|
28
|
+
const value = environment.variables._data && environment.variables._data[this.id];
|
|
29
|
+
|
|
30
|
+
const content = this._createContent(value);
|
|
31
|
+
|
|
32
|
+
return broker.publish(exchange, `${routingKeyPrefix}response`, content, messageProperties);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
EnvironmentDataObject.prototype.write = function write(broker, exchange, routingKeyPrefix, value, messageProperties) {
|
|
36
|
+
const environment = this.environment;
|
|
37
|
+
environment.variables._data = environment.variables._data || {};
|
|
38
|
+
environment.variables._data[this.id] = value;
|
|
39
|
+
|
|
40
|
+
const content = this._createContent(value);
|
|
41
|
+
|
|
42
|
+
return broker.publish(exchange, `${routingKeyPrefix}response`, content, messageProperties);
|
|
43
|
+
};
|
|
45
44
|
|
|
45
|
+
EnvironmentDataObject.prototype._createContent = function createContent(value) {
|
|
46
|
+
return {
|
|
47
|
+
id: this.id,
|
|
48
|
+
type: this.type,
|
|
49
|
+
name: this.name,
|
|
50
|
+
value
|
|
46
51
|
};
|
|
47
|
-
|
|
48
|
-
}
|
|
52
|
+
};
|
|
@@ -15,34 +15,38 @@ function EnvironmentDataStore(dataStoreDef, {
|
|
|
15
15
|
behaviour,
|
|
16
16
|
parent
|
|
17
17
|
} = dataStoreDef;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
18
|
+
this.id = id;
|
|
19
|
+
this.type = type;
|
|
20
|
+
this.name = name;
|
|
21
|
+
this.behaviour = behaviour;
|
|
22
|
+
this.parent = parent;
|
|
23
|
+
this.environment = environment;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
EnvironmentDataStore.prototype.read = function read(broker, exchange, routingKeyPrefix, messageProperties) {
|
|
27
|
+
const environment = this.environment;
|
|
28
|
+
const value = environment.variables._data && environment.variables._data[this.id];
|
|
29
|
+
|
|
30
|
+
const content = this._createContent(value);
|
|
31
|
+
|
|
32
|
+
return broker.publish(exchange, `${routingKeyPrefix}response`, content, messageProperties);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
EnvironmentDataStore.prototype.write = function write(broker, exchange, routingKeyPrefix, value, messageProperties) {
|
|
36
|
+
const environment = this.environment;
|
|
37
|
+
environment.variables._data = environment.variables._data || {};
|
|
38
|
+
environment.variables._data[this.id] = value;
|
|
39
|
+
|
|
40
|
+
const content = this._createContent(value);
|
|
41
|
+
|
|
42
|
+
return broker.publish(exchange, `${routingKeyPrefix}response`, content, messageProperties);
|
|
43
|
+
};
|
|
45
44
|
|
|
45
|
+
EnvironmentDataStore.prototype._createContent = function createContent(value) {
|
|
46
|
+
return {
|
|
47
|
+
id: this.id,
|
|
48
|
+
type: this.type,
|
|
49
|
+
name: this.name,
|
|
50
|
+
value
|
|
46
51
|
};
|
|
47
|
-
|
|
48
|
-
}
|
|
52
|
+
};
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = EnvironmentDataStoreReference;
|
|
7
7
|
|
|
8
|
-
function EnvironmentDataStoreReference(
|
|
8
|
+
function EnvironmentDataStoreReference(dataObjectDef, {
|
|
9
9
|
environment
|
|
10
10
|
}) {
|
|
11
11
|
const {
|
|
@@ -14,35 +14,39 @@ function EnvironmentDataStoreReference(dataStoreRefDef, {
|
|
|
14
14
|
name,
|
|
15
15
|
behaviour,
|
|
16
16
|
parent
|
|
17
|
-
} =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
17
|
+
} = dataObjectDef;
|
|
18
|
+
this.id = id;
|
|
19
|
+
this.type = type;
|
|
20
|
+
this.name = name;
|
|
21
|
+
this.behaviour = behaviour;
|
|
22
|
+
this.parent = parent;
|
|
23
|
+
this.environment = environment;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
EnvironmentDataStoreReference.prototype.read = function read(broker, exchange, routingKeyPrefix, messageProperties) {
|
|
27
|
+
const environment = this.environment;
|
|
28
|
+
const value = environment.variables._data && environment.variables._data[this.id];
|
|
29
|
+
|
|
30
|
+
const content = this._createContent(value);
|
|
31
|
+
|
|
32
|
+
return broker.publish(exchange, `${routingKeyPrefix}response`, content, messageProperties);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
EnvironmentDataStoreReference.prototype.write = function write(broker, exchange, routingKeyPrefix, value, messageProperties) {
|
|
36
|
+
const environment = this.environment;
|
|
37
|
+
environment.variables._data = environment.variables._data || {};
|
|
38
|
+
environment.variables._data[this.id] = value;
|
|
39
|
+
|
|
40
|
+
const content = this._createContent(value);
|
|
41
|
+
|
|
42
|
+
return broker.publish(exchange, `${routingKeyPrefix}response`, content, messageProperties);
|
|
43
|
+
};
|
|
45
44
|
|
|
45
|
+
EnvironmentDataStoreReference.prototype._createContent = function createContent(value) {
|
|
46
|
+
return {
|
|
47
|
+
id: this.id,
|
|
48
|
+
type: this.type,
|
|
49
|
+
name: this.name,
|
|
50
|
+
value
|
|
46
51
|
};
|
|
47
|
-
|
|
48
|
-
}
|
|
52
|
+
};
|