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 = ServiceTask;
|
|
7
6
|
exports.ServiceTaskBehaviour = ServiceTaskBehaviour;
|
|
7
|
+
exports.default = ServiceTask;
|
|
8
8
|
|
|
9
9
|
var _Activity = _interopRequireDefault(require("../activity/Activity"));
|
|
10
10
|
|
|
@@ -15,101 +15,108 @@ var _messageHelper = require("../messageHelper");
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
|
|
17
17
|
function ServiceTask(activityDef, context) {
|
|
18
|
-
return
|
|
18
|
+
return new _Activity.default(ServiceTaskBehaviour, activityDef, context);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function ServiceTaskBehaviour(activity) {
|
|
22
22
|
const {
|
|
23
23
|
id,
|
|
24
24
|
type,
|
|
25
|
-
|
|
26
|
-
logger,
|
|
27
|
-
behaviour,
|
|
28
|
-
environment,
|
|
29
|
-
emitFatal
|
|
25
|
+
behaviour
|
|
30
26
|
} = activity;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
-
return source;
|
|
27
|
+
this.id = id;
|
|
28
|
+
this.type = type;
|
|
29
|
+
this.loopCharacteristics = behaviour.loopCharacteristics && new behaviour.loopCharacteristics.Behaviour(activity, behaviour.loopCharacteristics);
|
|
30
|
+
this.activity = activity;
|
|
31
|
+
this.environment = activity.environment;
|
|
32
|
+
this.broker = activity.broker;
|
|
33
|
+
}
|
|
40
34
|
|
|
41
|
-
|
|
42
|
-
const content = executeMessage.content;
|
|
35
|
+
const proto = ServiceTaskBehaviour.prototype;
|
|
43
36
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
proto.execute = function execute(executeMessage) {
|
|
38
|
+
const executeContent = executeMessage.content;
|
|
39
|
+
const loopCharacteristics = this.loopCharacteristics;
|
|
47
40
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const service = getService(executeMessage);
|
|
52
|
-
if (!service) return emitFatal(new _Errors.ActivityError(`<${id}> service not defined`, executeMessage), content);
|
|
53
|
-
broker.subscribeTmp('api', `activity.#.${content.executionId}`, onApiMessage, {
|
|
54
|
-
consumerTag: `_api-${executionId}`
|
|
55
|
-
});
|
|
56
|
-
return service.execute(executeMessage, (err, output) => {
|
|
57
|
-
broker.cancel(`_api-${executionId}`);
|
|
58
|
-
|
|
59
|
-
if (err) {
|
|
60
|
-
logger.error(`<${content.executionId} (${id})>`, err);
|
|
61
|
-
return broker.publish('execution', 'execute.error', (0, _messageHelper.cloneContent)(content, {
|
|
62
|
-
error: new _Errors.ActivityError(err.message, executeMessage, err)
|
|
63
|
-
}, {
|
|
64
|
-
mandatory: true
|
|
65
|
-
}));
|
|
66
|
-
}
|
|
41
|
+
if (loopCharacteristics && executeContent.isRootScope) {
|
|
42
|
+
return loopCharacteristics.execute(executeMessage);
|
|
43
|
+
}
|
|
67
44
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
45
|
+
const executionId = executeContent.executionId;
|
|
46
|
+
const service = this.service = this.getService(executeMessage);
|
|
47
|
+
if (!service) return this.activity.emitFatal(new _Errors.ActivityError(`<${this.id}> service not defined`, executeMessage), executeContent);
|
|
48
|
+
const broker = this.broker;
|
|
49
|
+
broker.subscribeTmp('api', `activity.#.${executionId}`, (...args) => this._onApiMessage(executeMessage, ...args), {
|
|
50
|
+
consumerTag: `_api-${executionId}`
|
|
51
|
+
});
|
|
52
|
+
return service.execute(executeMessage, (err, output) => {
|
|
53
|
+
broker.cancel(`_api-${executionId}`);
|
|
54
|
+
|
|
55
|
+
if (err) {
|
|
56
|
+
this.activity.logger.error(`<${executionId} (${this.id})>`, err);
|
|
57
|
+
return broker.publish('execution', 'execute.error', (0, _messageHelper.cloneContent)(executeContent, {
|
|
58
|
+
error: new _Errors.ActivityError(err.message, executeMessage, err)
|
|
59
|
+
}, {
|
|
60
|
+
mandatory: true
|
|
71
61
|
}));
|
|
72
|
-
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return broker.publish('execution', 'execute.completed', (0, _messageHelper.cloneContent)(executeContent, {
|
|
65
|
+
output,
|
|
66
|
+
state: 'complete'
|
|
67
|
+
}));
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
proto.getService = function getService(message) {
|
|
72
|
+
let Service = this.activity.behaviour.Service;
|
|
73
|
+
|
|
74
|
+
if (!Service) {
|
|
75
|
+
Service = this.environment.settings.enableDummyService ? DummyService : null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return Service && new Service(this.activity, (0, _messageHelper.cloneMessage)(message));
|
|
79
|
+
};
|
|
73
80
|
|
|
74
|
-
|
|
75
|
-
|
|
81
|
+
proto._onApiMessage = function onApiMessage(executeMessage, _, message) {
|
|
82
|
+
const broker = this.broker;
|
|
83
|
+
|
|
84
|
+
switch (message.properties.type) {
|
|
85
|
+
case 'discard':
|
|
86
|
+
{
|
|
87
|
+
const executionId = executeMessage.content.executionId;
|
|
76
88
|
broker.cancel(`_api-${executionId}`);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
89
|
+
const service = this.service;
|
|
90
|
+
|
|
91
|
+
if (service) {
|
|
92
|
+
if (service.discard) service.discard(message);else if (service.stop) service.stop(message);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
this.activity.logger.debug(`<${executionId} (${this.id})> discarded`);
|
|
96
|
+
return broker.publish('execution', 'execute.discard', (0, _messageHelper.cloneContent)(executeMessage.content, {
|
|
80
97
|
state: 'discard'
|
|
81
98
|
}));
|
|
82
99
|
}
|
|
83
100
|
|
|
84
|
-
|
|
101
|
+
case 'stop':
|
|
102
|
+
{
|
|
103
|
+
const executionId = executeMessage.content.executionId;
|
|
85
104
|
broker.cancel(`_api-${executionId}`);
|
|
105
|
+
const service = this.service;
|
|
86
106
|
if (service && service.stop) service.stop(message);
|
|
87
|
-
return logger.debug(`<${
|
|
107
|
+
return this.activity.logger.debug(`<${executionId} (${this.id})> stopped`);
|
|
88
108
|
}
|
|
89
|
-
}
|
|
90
109
|
}
|
|
110
|
+
};
|
|
91
111
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return environment.settings.enableDummyService ? DummyService(activity) : null;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return Service(activity, (0, _messageHelper.cloneMessage)(message));
|
|
100
|
-
}
|
|
112
|
+
function DummyService(activity) {
|
|
113
|
+
this.type = 'dummyservice';
|
|
114
|
+
this.activity = activity;
|
|
115
|
+
}
|
|
101
116
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
function executeDummyService(...args) {
|
|
110
|
-
logger.debug(`<${id}> executing dummy service`);
|
|
111
|
-
const next = args.pop();
|
|
112
|
-
next();
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
117
|
+
DummyService.prototype.execute = function executeDummyService(...args) {
|
|
118
|
+
const activity = this.activity;
|
|
119
|
+
activity.logger.debug(`<${activity.id}> executing dummy service`);
|
|
120
|
+
const next = args.pop();
|
|
121
|
+
next();
|
|
122
|
+
};
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = SignalTask;
|
|
7
6
|
exports.SignalTaskBehaviour = SignalTaskBehaviour;
|
|
7
|
+
exports.default = SignalTask;
|
|
8
8
|
|
|
9
9
|
var _Activity = _interopRequireDefault(require("../activity/Activity"));
|
|
10
10
|
|
|
@@ -15,112 +15,116 @@ var _messageHelper = require("../messageHelper");
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
|
|
17
17
|
function SignalTask(activityDef, context) {
|
|
18
|
-
return
|
|
18
|
+
return new _Activity.default(SignalTaskBehaviour, activityDef, context);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function SignalTaskBehaviour(activity) {
|
|
22
22
|
const {
|
|
23
23
|
id,
|
|
24
24
|
type,
|
|
25
|
-
behaviour
|
|
26
|
-
broker
|
|
25
|
+
behaviour
|
|
27
26
|
} = activity;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
this.id = id;
|
|
28
|
+
this.type = type;
|
|
29
|
+
this.loopCharacteristics = behaviour.loopCharacteristics && new behaviour.loopCharacteristics.Behaviour(activity, behaviour.loopCharacteristics);
|
|
30
|
+
this.activity = activity;
|
|
31
|
+
this.broker = activity.broker;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const proto = SignalTaskBehaviour.prototype;
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
proto.execute = function execute(executeMessage) {
|
|
37
|
+
const executeContent = executeMessage.content;
|
|
38
|
+
const loopCharacteristics = this.loopCharacteristics;
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
if (loopCharacteristics && executeContent.isRootScope) {
|
|
41
|
+
return loopCharacteristics.execute(executeMessage);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const executionId = executeContent.executionId;
|
|
45
|
+
const broker = this.broker;
|
|
46
|
+
broker.subscribeTmp('api', `activity.#.${executionId}`, (...args) => this._onApiMessage(executeMessage, ...args), {
|
|
47
|
+
noAck: true,
|
|
48
|
+
consumerTag: `_api-${executionId}`
|
|
49
|
+
});
|
|
50
|
+
broker.subscribeTmp('api', '#.signal.*', (...args) => this._onDelegatedApiMessage(executeMessage, ...args), {
|
|
51
|
+
noAck: true,
|
|
52
|
+
consumerTag: `_api-delegated-${executionId}`
|
|
53
|
+
});
|
|
54
|
+
broker.publish('event', 'activity.wait', (0, _messageHelper.cloneContent)(executeContent, {
|
|
55
|
+
state: 'wait'
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
proto._onDelegatedApiMessage = function onDelegatedApiMessage(executeMessage, routingKey, message) {
|
|
60
|
+
if (!message.properties.delegate) return;
|
|
61
|
+
const {
|
|
62
|
+
content: delegateContent
|
|
63
|
+
} = message;
|
|
64
|
+
if (!delegateContent || !delegateContent.message) return;
|
|
65
|
+
const executeContent = executeMessage.content;
|
|
66
|
+
const {
|
|
67
|
+
id: signalId,
|
|
68
|
+
executionId: signalExecutionId
|
|
69
|
+
} = delegateContent.message;
|
|
70
|
+
if (this.loopCharacteristics && signalExecutionId !== executeContent.executionId) return;
|
|
71
|
+
if (signalId !== this.id && signalExecutionId !== executeContent.executionId) return;
|
|
72
|
+
const {
|
|
73
|
+
type: messageType,
|
|
74
|
+
correlationId
|
|
75
|
+
} = message.properties;
|
|
76
|
+
this.broker.publish('event', 'activity.consumed', (0, _messageHelper.cloneContent)(executeContent, {
|
|
77
|
+
message: { ...delegateContent.message
|
|
42
78
|
}
|
|
79
|
+
}), {
|
|
80
|
+
correlationId,
|
|
81
|
+
type: messageType
|
|
82
|
+
});
|
|
83
|
+
return this._onApiMessage(executeMessage, routingKey, message);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
proto._onApiMessage = function onApiMessage(executeMessage, routingKey, message) {
|
|
87
|
+
const {
|
|
88
|
+
type: messageType,
|
|
89
|
+
correlationId
|
|
90
|
+
} = message.properties;
|
|
91
|
+
const executeContent = executeMessage.content;
|
|
43
92
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
});
|
|
55
|
-
broker.publish('event', 'activity.wait', (0, _messageHelper.cloneContent)(content, {
|
|
56
|
-
state: 'wait'
|
|
57
|
-
}));
|
|
58
|
-
|
|
59
|
-
function onDelegatedApiMessage(routingKey, message) {
|
|
60
|
-
if (!message.properties.delegate) return;
|
|
61
|
-
const {
|
|
62
|
-
content: delegateContent
|
|
63
|
-
} = message;
|
|
64
|
-
if (!delegateContent || !delegateContent.message) return;
|
|
65
|
-
const {
|
|
66
|
-
id: signalId,
|
|
67
|
-
executionId: signalExecutionId
|
|
68
|
-
} = delegateContent.message;
|
|
69
|
-
if (loopCharacteristics && signalExecutionId !== executionId) return;
|
|
70
|
-
if (signalId !== id && signalExecutionId !== executionId) return;
|
|
71
|
-
const {
|
|
72
|
-
type: messageType,
|
|
73
|
-
correlationId
|
|
74
|
-
} = message.properties;
|
|
75
|
-
broker.publish('event', 'activity.consumed', (0, _messageHelper.cloneContent)(content, {
|
|
76
|
-
message: { ...delegateContent.message
|
|
77
|
-
}
|
|
93
|
+
switch (messageType) {
|
|
94
|
+
case 'stop':
|
|
95
|
+
return this._stop(executeContent.executionId);
|
|
96
|
+
|
|
97
|
+
case 'signal':
|
|
98
|
+
this._stop(executeContent.executionId);
|
|
99
|
+
|
|
100
|
+
return this.broker.publish('execution', 'execute.completed', (0, _messageHelper.cloneContent)(executeContent, {
|
|
101
|
+
output: message.content.message,
|
|
102
|
+
state: 'signal'
|
|
78
103
|
}), {
|
|
79
|
-
correlationId
|
|
80
|
-
type: messageType
|
|
104
|
+
correlationId
|
|
81
105
|
});
|
|
82
|
-
return onApiMessage(routingKey, message);
|
|
83
|
-
}
|
|
84
106
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
107
|
+
case 'error':
|
|
108
|
+
this._stop(executeContent.executionId);
|
|
109
|
+
|
|
110
|
+
return this.broker.publish('execution', 'execute.error', (0, _messageHelper.cloneContent)(executeContent, {
|
|
111
|
+
error: new _Errors.ActivityError(message.content.message, executeMessage, message.content)
|
|
112
|
+
}, {
|
|
113
|
+
mandatory: true,
|
|
88
114
|
correlationId
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
switch (messageType) {
|
|
92
|
-
case 'stop':
|
|
93
|
-
return stop();
|
|
94
|
-
|
|
95
|
-
case 'signal':
|
|
96
|
-
stop();
|
|
97
|
-
return broker.publish('execution', 'execute.completed', (0, _messageHelper.cloneContent)(content, {
|
|
98
|
-
output: message.content.message,
|
|
99
|
-
state: 'signal'
|
|
100
|
-
}), {
|
|
101
|
-
correlationId
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
case 'error':
|
|
105
|
-
stop();
|
|
106
|
-
return broker.publish('execution', 'execute.error', (0, _messageHelper.cloneContent)(content, {
|
|
107
|
-
error: new _Errors.ActivityError(message.content.message, executeMessage, message.content)
|
|
108
|
-
}, {
|
|
109
|
-
mandatory: true,
|
|
110
|
-
correlationId
|
|
111
|
-
}));
|
|
112
|
-
|
|
113
|
-
case 'discard':
|
|
114
|
-
stop();
|
|
115
|
-
return broker.publish('execution', 'execute.discard', (0, _messageHelper.cloneContent)(content), {
|
|
116
|
-
correlationId
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
115
|
+
}));
|
|
120
116
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
117
|
+
case 'discard':
|
|
118
|
+
this._stop(executeContent.executionId);
|
|
119
|
+
|
|
120
|
+
return this.broker.publish('execution', 'execute.discard', (0, _messageHelper.cloneContent)(executeContent), {
|
|
121
|
+
correlationId
|
|
122
|
+
});
|
|
125
123
|
}
|
|
126
|
-
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
proto._stop = function stop(executionId) {
|
|
127
|
+
const broker = this.broker;
|
|
128
|
+
broker.cancel(`_api-${executionId}`);
|
|
129
|
+
broker.cancel(`_api-delegated-${executionId}`);
|
|
130
|
+
};
|
|
@@ -16,7 +16,7 @@ function StandardLoopCharacteristics(activity, loopCharacteristics) {
|
|
|
16
16
|
behaviour = { ...behaviour,
|
|
17
17
|
isSequential: true
|
|
18
18
|
};
|
|
19
|
-
return
|
|
19
|
+
return new _LoopCharacteristics.default(activity, { ...loopCharacteristics,
|
|
20
20
|
behaviour
|
|
21
21
|
});
|
|
22
22
|
}
|