bpmn-engine 24.0.1 → 25.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/lib/index.cjs +5 -3
- package/package.json +2 -2
- package/src/index.js +5 -3
package/lib/index.cjs
CHANGED
|
@@ -281,9 +281,7 @@ Engine.prototype.stop = function stop() {
|
|
|
281
281
|
|
|
282
282
|
Engine.prototype.recover = function recover(savedState, recoverOptions) {
|
|
283
283
|
if (this[kExecution]?.isRunning) {
|
|
284
|
-
|
|
285
|
-
this.logger.debug(`<${this.name}> stopping current running execution`);
|
|
286
|
-
this[kExecution].stop();
|
|
284
|
+
throw new Error('cannot recover a running engine');
|
|
287
285
|
}
|
|
288
286
|
|
|
289
287
|
if (!savedState) return this;
|
|
@@ -338,6 +336,10 @@ Engine.prototype.resume = async function resume(...args) {
|
|
|
338
336
|
throw err;
|
|
339
337
|
}
|
|
340
338
|
execution = this[kExecution] = new Execution(this, definitions, this.options);
|
|
339
|
+
} else if (execution.isRunning) {
|
|
340
|
+
const err = new Error('cannot resume a running engine');
|
|
341
|
+
if (callback) return callback(err);
|
|
342
|
+
throw err;
|
|
341
343
|
}
|
|
342
344
|
|
|
343
345
|
return execution._resume(resumeOptions, callback);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpmn-engine",
|
|
3
3
|
"description": "BPMN 2.0 execution engine. Open source javascript workflow engine.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "25.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./src/index.js",
|
|
7
7
|
"main": "./lib/index.cjs",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"bpmn-elements": "^17.0.0",
|
|
73
73
|
"bpmn-moddle": "^9.0.1",
|
|
74
74
|
"debug": "^4.3.7",
|
|
75
|
-
"moddle-context-serializer": "^4.
|
|
75
|
+
"moddle-context-serializer": "^4.3.0"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"smqp": ">=9"
|
package/src/index.js
CHANGED
|
@@ -135,9 +135,7 @@ Engine.prototype.stop = function stop() {
|
|
|
135
135
|
|
|
136
136
|
Engine.prototype.recover = function recover(savedState, recoverOptions) {
|
|
137
137
|
if (this[kExecution]?.isRunning) {
|
|
138
|
-
|
|
139
|
-
this.logger.debug(`<${this.name}> stopping current running execution`);
|
|
140
|
-
this[kExecution].stop();
|
|
138
|
+
throw new Error('cannot recover a running engine');
|
|
141
139
|
}
|
|
142
140
|
|
|
143
141
|
if (!savedState) return this;
|
|
@@ -192,6 +190,10 @@ Engine.prototype.resume = async function resume(...args) {
|
|
|
192
190
|
throw err;
|
|
193
191
|
}
|
|
194
192
|
execution = this[kExecution] = new Execution(this, definitions, this.options);
|
|
193
|
+
} else if (execution.isRunning) {
|
|
194
|
+
const err = new Error('cannot resume a running engine');
|
|
195
|
+
if (callback) return callback(err);
|
|
196
|
+
throw err;
|
|
195
197
|
}
|
|
196
198
|
|
|
197
199
|
return execution._resume(resumeOptions, callback);
|