bpmn-engine 24.0.1 → 25.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/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
- this.logger.error('recover during running execution will be deprecated next major version');
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,12 +1,19 @@
1
1
  {
2
2
  "name": "bpmn-engine",
3
3
  "description": "BPMN 2.0 execution engine. Open source javascript workflow engine.",
4
- "version": "24.0.1",
4
+ "version": "25.0.1",
5
5
  "type": "module",
6
6
  "module": "./src/index.js",
7
7
  "main": "./lib/index.cjs",
8
8
  "types": "./types/bpmn-engine.d.ts",
9
9
  "sideEffects": false,
10
+ "exports": {
11
+ ".": {
12
+ "types": "./types/bpmn-engine.d.ts",
13
+ "require": "./lib/index.cjs",
14
+ "import": "./src/index.js"
15
+ }
16
+ },
10
17
  "repository": {
11
18
  "type": "git",
12
19
  "url": "git://github.com/paed01/bpmn-engine.git"
@@ -52,27 +59,27 @@
52
59
  ],
53
60
  "devDependencies": {
54
61
  "@bonniernews/hot-bev": "^0.4.0",
55
- "@rollup/plugin-commonjs": "^28.0.0",
62
+ "@rollup/plugin-commonjs": "^29.0.0",
56
63
  "@types/bpmn-moddle": "^5.1.6",
57
64
  "@types/node": "^18.19.31",
58
65
  "bent": "^7.3.12",
59
66
  "c8": "^10.0.0",
60
67
  "camunda-bpmn-moddle": "^7.0.1",
61
- "chai": "^5.1.0",
62
- "chronokinesis": "^6.0.0",
68
+ "chai": "^6.2.0",
69
+ "chronokinesis": "^7.0.1",
63
70
  "eslint": "^9.10.0",
64
71
  "markdown-toc": "^1.2.0",
65
72
  "mocha": "^11.0.1",
66
73
  "mocha-cakes-2": "^3.3.0",
67
74
  "prettier": "^3.2.5",
68
75
  "rollup": "^4.10.0",
69
- "texample": "^0.0.7"
76
+ "texample": "^0.1.0"
70
77
  },
71
78
  "dependencies": {
72
- "bpmn-elements": "^17.0.0",
73
- "bpmn-moddle": "^9.0.1",
74
- "debug": "^4.3.7",
75
- "moddle-context-serializer": "^4.2.1"
79
+ "bpmn-elements": "^17.2.2",
80
+ "bpmn-moddle": "^9.0.4",
81
+ "debug": "^4.4.3",
82
+ "moddle-context-serializer": "^4.4.1"
76
83
  },
77
84
  "peerDependencies": {
78
85
  "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
- this.logger.error('recover during running execution will be deprecated next major version');
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);