bpmn-elements 6.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 +335 -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 +1106 -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 +15 -15
- 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 +915 -775
- 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
|
@@ -1,206 +1,241 @@
|
|
|
1
|
-
import {cloneContent
|
|
1
|
+
import {cloneContent} from '../messageHelper';
|
|
2
2
|
import {toSeconds, parse} from 'iso8601-duration';
|
|
3
3
|
|
|
4
|
+
const kStopped = Symbol.for('stopped');
|
|
5
|
+
const kTimerContent = Symbol.for('timerContent');
|
|
6
|
+
const kTimer = Symbol.for('timer');
|
|
7
|
+
|
|
4
8
|
export default function TimerEventDefinition(activity, eventDefinition) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const {timeDuration, timeCycle, timeDate} = behaviour;
|
|
10
|
-
const foundTimers = {
|
|
11
|
-
...(timeDuration ? {timeDuration} : undefined),
|
|
12
|
-
...(timeCycle ? {timeCycle} : undefined),
|
|
13
|
-
...(timeDate ? {timeDate} : undefined),
|
|
14
|
-
};
|
|
9
|
+
const type = this.type = eventDefinition.type || 'TimerEventDefinition';
|
|
10
|
+
this.activity = activity;
|
|
11
|
+
const environment = this.environment = activity.environment;
|
|
12
|
+
this.eventDefinition = eventDefinition;
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const {timeDuration, timeCycle, timeDate} = eventDefinition.behaviour || {};
|
|
15
|
+
if (timeDuration) this.timeDuration = timeDuration;
|
|
16
|
+
if (timeCycle) this.timeCycle = timeCycle;
|
|
17
|
+
if (timeDate) this.timeDate = timeDate;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
...foundTimers,
|
|
22
|
-
execute,
|
|
23
|
-
stop() {
|
|
24
|
-
if (timerRef) timerRef = environment.timers.clearTimeout(timerRef);
|
|
25
|
-
},
|
|
26
|
-
};
|
|
19
|
+
this.broker = activity.broker;
|
|
20
|
+
this.logger = environment.Logger(type.toLowerCase());
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
});
|
|
22
|
+
this[kStopped] = false;
|
|
23
|
+
this[kTimer] = null;
|
|
24
|
+
}
|
|
33
25
|
|
|
34
|
-
|
|
26
|
+
const proto = TimerEventDefinition.prototype;
|
|
27
|
+
|
|
28
|
+
Object.defineProperty(proto, 'executionId', {
|
|
29
|
+
get() {
|
|
30
|
+
const content = this[kTimerContent];
|
|
31
|
+
return content && content.executionId;
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
Object.defineProperty(proto, 'stopped', {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get() {
|
|
38
|
+
return this[kStopped];
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
Object.defineProperty(proto, 'timer', {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get() {
|
|
45
|
+
return this[kTimer];
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
proto.execute = function execute(executeMessage) {
|
|
50
|
+
const {routingKey: executeKey, redelivered: isResumed} = executeMessage.fields;
|
|
51
|
+
const timer = this[kTimer];
|
|
52
|
+
if (timer && executeKey === 'execute.timer') {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
35
55
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const running = !!timerRef;
|
|
39
|
-
if (running && executeKey === 'execute.timer') {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
56
|
+
if (timer) this[kTimer] = this.environment.timers.clearTimeout(timer);
|
|
57
|
+
this[kStopped] = false;
|
|
42
58
|
|
|
43
|
-
|
|
44
|
-
|
|
59
|
+
const content = executeMessage.content;
|
|
60
|
+
const executionId = content.executionId;
|
|
61
|
+
const startedAt = this.startedAt = 'startedAt' in content ? new Date(content.startedAt) : new Date();
|
|
45
62
|
|
|
46
|
-
|
|
63
|
+
const resolvedTimer = this._getTimers(executeMessage);
|
|
64
|
+
const timerContent = this[kTimerContent] = cloneContent(content, {
|
|
65
|
+
...resolvedTimer,
|
|
66
|
+
...(isResumed ? {isResumed} : undefined),
|
|
67
|
+
startedAt,
|
|
68
|
+
state: 'timer',
|
|
69
|
+
});
|
|
47
70
|
|
|
48
|
-
|
|
49
|
-
|
|
71
|
+
const broker = this.broker;
|
|
72
|
+
broker.subscribeTmp('api', `activity.#.${executionId}`, this._onApiMessage.bind(this), {
|
|
73
|
+
noAck: true, consumerTag: `_api-${executionId}`,
|
|
74
|
+
priority: 400,
|
|
75
|
+
});
|
|
76
|
+
broker.subscribeTmp('api', '#.cancel.*', this._onDelegatedApiMessage.bind(this), {
|
|
77
|
+
noAck: true, consumerTag: `_api-delegated-${executionId}`,
|
|
78
|
+
});
|
|
50
79
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
...resolvedTimer,
|
|
54
|
-
...(isResumed ? {isResumed} : undefined),
|
|
55
|
-
startedAt,
|
|
56
|
-
state: 'timer',
|
|
57
|
-
});
|
|
80
|
+
broker.publish('execution', 'execute.timer', cloneContent(timerContent));
|
|
81
|
+
broker.publish('event', 'activity.timer', cloneContent(timerContent));
|
|
58
82
|
|
|
59
|
-
|
|
60
|
-
broker.subscribeTmp('api', '#.cancel.*', onDelegatedApiMessage, {noAck: true, consumerTag: `_api-delegated-${executionId}`});
|
|
83
|
+
if (this.stopped) return;
|
|
61
84
|
|
|
62
|
-
|
|
63
|
-
|
|
85
|
+
if (timerContent.timeout === undefined) return this._debug(`waiting for ${timerContent.timerType || 'signal'}`);
|
|
86
|
+
if (timerContent.timeout <= 0) return this._completed();
|
|
64
87
|
|
|
65
|
-
|
|
88
|
+
const timers = this.environment.timers.register(timerContent);
|
|
89
|
+
this[kTimer] = timers.setTimeout(this._completed.bind(this), timerContent.timeout, {
|
|
90
|
+
id: content.id,
|
|
91
|
+
type: this.type,
|
|
92
|
+
executionId,
|
|
93
|
+
state: 'timeout',
|
|
94
|
+
});
|
|
95
|
+
};
|
|
66
96
|
|
|
67
|
-
|
|
68
|
-
|
|
97
|
+
proto.stop = function stopTimer() {
|
|
98
|
+
const timer = this[kTimer];
|
|
99
|
+
if (timer) this[kTimer] = this.environment.timers.clearTimeout(timer);
|
|
100
|
+
};
|
|
69
101
|
|
|
70
|
-
|
|
102
|
+
proto._completed = function completed(completeContent, options) {
|
|
103
|
+
this._stop();
|
|
71
104
|
|
|
72
|
-
|
|
105
|
+
const stoppedAt = new Date();
|
|
73
106
|
|
|
74
|
-
|
|
75
|
-
|
|
107
|
+
const runningTime = stoppedAt.getTime() - this.startedAt.getTime();
|
|
108
|
+
this._debug(`completed in ${runningTime}ms`);
|
|
76
109
|
|
|
77
|
-
|
|
110
|
+
const timerContent = this[kTimerContent];
|
|
111
|
+
const content = {stoppedAt, runningTime, state: 'timeout', ...completeContent};
|
|
78
112
|
|
|
79
|
-
|
|
80
|
-
|
|
113
|
+
const broker = this.broker;
|
|
114
|
+
broker.publish('event', 'activity.timeout', cloneContent(timerContent, content), options);
|
|
115
|
+
broker.publish('execution', 'execute.completed', cloneContent(timerContent, content), options);
|
|
116
|
+
};
|
|
81
117
|
|
|
82
|
-
|
|
118
|
+
proto._onDelegatedApiMessage = function onDelegatedApiMessage(routingKey, message) {
|
|
119
|
+
if (!message.properties.delegate) return;
|
|
83
120
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
121
|
+
const content = message.content;
|
|
122
|
+
if (!content.message) return;
|
|
87
123
|
|
|
88
|
-
|
|
89
|
-
if (!message.properties.delegate) return;
|
|
90
|
-
const {content: delegateContent} = message;
|
|
91
|
-
if (!delegateContent.message) return;
|
|
124
|
+
const {id: signalId, executionId: signalExecutionId} = content.message;
|
|
92
125
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
126
|
+
const executionId = this.executionId;
|
|
127
|
+
const id = this.activity.id;
|
|
128
|
+
if (signalId !== id && signalExecutionId !== executionId) return;
|
|
129
|
+
if (signalExecutionId && signalId === id && signalExecutionId !== executionId) return;
|
|
96
130
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
131
|
+
const {type, correlationId} = message.properties;
|
|
132
|
+
this.broker.publish('event', 'activity.consumed', cloneContent(this[kTimerContent], {
|
|
133
|
+
message: {
|
|
134
|
+
...content.message,
|
|
135
|
+
},
|
|
136
|
+
}), {correlationId, type});
|
|
101
137
|
|
|
102
|
-
|
|
103
|
-
|
|
138
|
+
return this._onApiMessage(routingKey, message);
|
|
139
|
+
};
|
|
104
140
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
stop();
|
|
108
|
-
return completed({
|
|
109
|
-
state: 'cancel',
|
|
110
|
-
...(message.content.message ? {message: message.content.message} : undefined),
|
|
111
|
-
}, {correlationId});
|
|
112
|
-
}
|
|
113
|
-
case 'stop': {
|
|
114
|
-
stop();
|
|
115
|
-
return logger.debug(`<${executionId} (${id})> stopped`);
|
|
116
|
-
}
|
|
117
|
-
case 'discard': {
|
|
118
|
-
stop();
|
|
119
|
-
logger.debug(`<${executionId} (${id})> discarded`);
|
|
120
|
-
return broker.publish('execution', 'execute.discard', cloneContent(timerContent, {state: 'discard'}), {correlationId});
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
141
|
+
proto._onApiMessage = function onApiMessage(routingKey, message) {
|
|
142
|
+
const {type: messageType, correlationId} = message.properties;
|
|
124
143
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
144
|
+
switch (messageType) {
|
|
145
|
+
case 'cancel': {
|
|
146
|
+
this._stop();
|
|
147
|
+
return this._completed({
|
|
148
|
+
state: 'cancel',
|
|
149
|
+
...(message.content.message ? {message: message.content.message} : undefined),
|
|
150
|
+
}, {correlationId});
|
|
130
151
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const content = executionMessage.content;
|
|
135
|
-
|
|
136
|
-
let expireAt;
|
|
137
|
-
if ('expireAt' in content) {
|
|
138
|
-
expireAt = new Date(content.expireAt);
|
|
152
|
+
case 'stop': {
|
|
153
|
+
this._stop();
|
|
154
|
+
return this._debug('stopped');
|
|
139
155
|
}
|
|
156
|
+
case 'discard': {
|
|
157
|
+
this._stop();
|
|
158
|
+
this._debug('discarded');
|
|
159
|
+
return this.broker.publish('execution', 'execute.discard', cloneContent(this[kTimerContent], {state: 'discard'}), {correlationId});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
proto._stop = function stop() {
|
|
165
|
+
this[kStopped] = true;
|
|
166
|
+
const timer = this[kTimer];
|
|
167
|
+
if (timer) this[kTimer] = this.environment.timers.clearTimeout(timer);
|
|
168
|
+
const broker = this.broker;
|
|
169
|
+
broker.cancel(`_api-${this.executionId}`);
|
|
170
|
+
broker.cancel(`_api-delegated-${this.executionId}`);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
proto._getTimers = function getTimers(executeMessage) {
|
|
174
|
+
const content = executeMessage.content;
|
|
175
|
+
|
|
176
|
+
const now = Date.now();
|
|
177
|
+
const result = {
|
|
178
|
+
...('expireAt' in content ? {expireAt: new Date(content.expireAt)} : undefined),
|
|
179
|
+
};
|
|
140
180
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (delay !== undefined) expireAtDate = new Date(now + delay);
|
|
155
|
-
} else {
|
|
156
|
-
expireAtDate = new Date(now);
|
|
157
|
-
}
|
|
158
|
-
break;
|
|
159
|
-
}
|
|
160
|
-
case 'timeDate': {
|
|
161
|
-
const dateStr = result[t];
|
|
162
|
-
if (dateStr) {
|
|
163
|
-
const ms = Date.parse(dateStr);
|
|
164
|
-
if (isNaN(ms)) {
|
|
165
|
-
logger.warn(`<${content.executionId} (${id})> invalid timeDate >${dateStr}<`);
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
expireAtDate = new Date(ms);
|
|
169
|
-
} else {
|
|
170
|
-
expireAtDate = new Date(now);
|
|
171
|
-
}
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
181
|
+
for (const t of ['timeDuration', 'timeDate', 'timeCycle']) {
|
|
182
|
+
if (t in content) result[t] = content[t];
|
|
183
|
+
else if (t in this) result[t] = this.environment.resolveExpression(this[t], executeMessage);
|
|
184
|
+
else continue;
|
|
185
|
+
|
|
186
|
+
let expireAtDate;
|
|
187
|
+
if (t === 'timeDuration') {
|
|
188
|
+
const durationStr = result[t];
|
|
189
|
+
if (durationStr) {
|
|
190
|
+
const delay = this._getDurationInMilliseconds(durationStr);
|
|
191
|
+
if (delay !== undefined) expireAtDate = new Date(now + delay);
|
|
192
|
+
} else {
|
|
193
|
+
expireAtDate = new Date(now);
|
|
174
194
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
195
|
+
} else if (t === 'timeDate') {
|
|
196
|
+
const dateStr = result[t];
|
|
197
|
+
if (dateStr) {
|
|
198
|
+
const ms = Date.parse(dateStr);
|
|
199
|
+
if (!isNaN(ms)) {
|
|
200
|
+
expireAtDate = new Date(ms);
|
|
201
|
+
} else {
|
|
202
|
+
this._warn(`invalid timeDate >${dateStr}<`);
|
|
203
|
+
}
|
|
204
|
+
} else {
|
|
205
|
+
expireAtDate = new Date(now);
|
|
181
206
|
}
|
|
207
|
+
}
|
|
182
208
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
if ('expireAt' in timerContent) {
|
|
189
|
-
timerContent.timeout = timerContent.expireAt - now;
|
|
190
|
-
} else if ('timeout' in content) {
|
|
191
|
-
timerContent.timeout = content.timeout;
|
|
192
|
-
} else if (!Object.keys(timerContent).length) {
|
|
193
|
-
timerContent.timeout = 0;
|
|
209
|
+
if (!expireAtDate) continue;
|
|
210
|
+
if (!('expireAt' in result) || result.expireAt > expireAtDate) {
|
|
211
|
+
result.timerType = t;
|
|
212
|
+
result.expireAt = expireAtDate;
|
|
194
213
|
}
|
|
214
|
+
}
|
|
195
215
|
|
|
196
|
-
|
|
216
|
+
if ('expireAt' in result) {
|
|
217
|
+
result.timeout = result.expireAt - now;
|
|
218
|
+
} else if ('timeout' in content) {
|
|
219
|
+
result.timeout = content.timeout;
|
|
220
|
+
} else if (!Object.keys(result).length) {
|
|
221
|
+
result.timeout = 0;
|
|
222
|
+
}
|
|
197
223
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
224
|
+
return result;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
proto._getDurationInMilliseconds = function getDurationInMilliseconds(duration) {
|
|
228
|
+
try {
|
|
229
|
+
return toSeconds(parse(duration)) * 1000;
|
|
230
|
+
} catch (err) {
|
|
231
|
+
this._warn(`failed to parse timeDuration >${duration}<: ${err.message}`);
|
|
205
232
|
}
|
|
206
|
-
}
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
proto._debug = function debug(msg) {
|
|
236
|
+
this.logger.debug(`<${this.executionId} (${this.activity.id})> ${msg}`);
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
proto._warn = function debug(msg) {
|
|
240
|
+
this.logger.warn(`<${this.executionId} (${this.activity.id})> ${msg}`);
|
|
241
|
+
};
|