bpmn-engine 14.0.0 → 15.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 CHANGED
@@ -1,12 +1,25 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ # 15.0.0
5
+
6
+ ## Breaking
7
+ - Drop node 12 support
8
+
9
+ # 14.1.1
10
+
11
+ - fix(types): add missing `moddleContext` option
12
+
13
+ # 14.1.0
14
+
15
+ - Bump [`bpmn-elements@8.1.0`](https://github.com/paed01/bpmn-elements/blob/master/CHANGELOG.md) with support for bound non-interrupting repeating timeCycle
16
+
4
17
  # 14.0.0
5
18
 
6
19
  ## Breaking
7
20
  - Engine is prototyped, can still be invoked without new
8
21
  - Bump [`bpmn-elements@8.0.0`](https://github.com/paed01/bpmn-elements/blob/master/CHANGELOG.md) with support for bpmn:CallActivity (#97)
9
- - Bump [`smqp@6.0.0`](https://github.com/paed01/smqp/blob/default/CHANGELOG.md) with support for bpmn:CallActivity (#97)
22
+ - Bump [`smqp@6.0.0`](https://github.com/paed01/smqp/blob/default/CHANGELOG.md)
10
23
 
11
24
  # 13.0.2
12
25
 
package/README.md CHANGED
@@ -12,6 +12,7 @@ BPMN 2.0 execution engine. Open source javascript workflow engine.
12
12
  - [API](/docs/API.md)
13
13
  - [Changelog](/CHANGELOG.md)
14
14
  - [Examples](/docs/Examples.md)
15
+ - [Upgrade version](/docs/Upgrade.md)
15
16
  - [Supported elements](#supported-elements)
16
17
  - [Debug](#debug)
17
18
  - [Example process](#a-pretty-image-of-a-process)
@@ -25,7 +26,7 @@ The aim is to, at least, have BPMN 2.0 [core support](https://www.omg.org/bpmn/S
25
26
 
26
27
  # Debug
27
28
 
28
- The module uses [debug](https://github.com/visionmedia/debug) so run with environment variable `DEBUG=bpmn-engine:*` or provide your own logger.
29
+ This package is shipped with [debug](https://github.com/visionmedia/debug) activated with environment variable `DEBUG=bpmn-engine:*`. You can also provide your own logger.
29
30
 
30
31
  # A pretty image of a process
31
32
 
@@ -35,4 +36,4 @@ The module uses [debug](https://github.com/visionmedia/debug) so run with enviro
35
36
 
36
37
  The **bpmn-engine** resides upon the excellent library [bpmn-io/bpmn-moddle](https://github.com/bpmn-io/bpmn-moddle) developed by [bpmn.io](https://bpmn.io/)
37
38
 
38
- One excellent modeller is the [Camunda modeler](https://camunda.com/download/modeler/).
39
+ All diagrams are designed with [Camunda modeler](https://camunda.com/download/modeler/).
package/index.js CHANGED
@@ -189,7 +189,7 @@ Engine.prototype.addSource = function addSource({sourceContext: addContext} = {}
189
189
 
190
190
  Engine.prototype.getDefinitions = async function getDefinitions(executeOptions) {
191
191
  const loadedDefinitions = this[kLoadedDefinitions];
192
- if (loadedDefinitions && loadedDefinitions.length) return loadedDefinitions;
192
+ if (loadedDefinitions?.length) return loadedDefinitions;
193
193
  return this._loadDefinitions(executeOptions);
194
194
  };
195
195
 
@@ -318,7 +318,6 @@ Execution.prototype._execute = function execute(executeOptions, callback) {
318
318
  return result;
319
319
  }, []);
320
320
 
321
-
322
321
  if (!definitionExecutions.length) {
323
322
  const error = new Error('No executable processes');
324
323
  if (!callback) return this[kEngine].emit('error', error);
@@ -409,7 +408,7 @@ Execution.prototype._setup = function setup(setupOptions = {}) {
409
408
 
410
409
  Execution.prototype._onChildMessage = function onChildMessage(routingKey, message, owner) {
411
410
  const {environment: ownerEnvironment} = owner;
412
- const listener = ownerEnvironment.options && ownerEnvironment.options.listener;
411
+ const listener = ownerEnvironment.options?.listener;
413
412
  this[kState] = 'running';
414
413
 
415
414
  let newState;
@@ -540,7 +539,7 @@ Execution.prototype.getPostponed = function getPostponed() {
540
539
 
541
540
  Execution.prototype.signal = function signal(payload, {ignoreSameDefinition} = {}) {
542
541
  for (const definition of this[kExecuting]) {
543
- if (ignoreSameDefinition && payload && payload.parent && payload.parent.id === definition.id) continue;
542
+ if (ignoreSameDefinition && payload?.parent?.id === definition.id) continue;
544
543
  definition.signal(payload);
545
544
  }
546
545
  };
@@ -71,4 +71,3 @@ DummyScript.prototype.execute = function execute(executionContext, callback) {
71
71
  this.logger.debug(`<${executionId} (${id})> passthrough dummy script ${this.language || 'esperanto'}`);
72
72
  callback();
73
73
  };
74
-
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": "14.0.0",
4
+ "version": "15.0.0",
5
5
  "main": "index.js",
6
6
  "types": "types/bpmn-engine.d.ts",
7
7
  "repository": {
@@ -13,7 +13,7 @@
13
13
  "url": "https://github.com/paed01"
14
14
  },
15
15
  "engines": {
16
- "node": ">=10"
16
+ "node": ">=14"
17
17
  },
18
18
  "files": [
19
19
  "lib/",
@@ -23,7 +23,7 @@
23
23
  "scripts": {
24
24
  "test": "mocha -R dot",
25
25
  "posttest": "eslint . --cache && npm run toc",
26
- "wintest": "node_modules/.bin/mocha",
26
+ "wintest": "mocha",
27
27
  "cov:html": "nyc mocha -R dot && nyc report --reporter=html",
28
28
  "test:lcov": "nyc mocha -R dot && nyc report --reporter lcov && npm run posttest",
29
29
  "toc": "node scripts/generate-api-toc ./docs/API.md,./docs/Examples.md",
@@ -54,15 +54,16 @@
54
54
  "camunda-bpmn-moddle": "^6.1.2",
55
55
  "chai": "^4.3.6",
56
56
  "chronokinesis": "^3.0.0",
57
- "eslint": "^7.23.0",
57
+ "eslint": "^8.21.0",
58
58
  "markdown-toc": "^1.2.0",
59
- "mocha": "^9.2.2",
59
+ "mocha": "^10.0.0",
60
60
  "mocha-cakes-2": "^3.3.0",
61
- "nock": "^13.2.4",
61
+ "nock": "^13.2.9",
62
62
  "nyc": "^15.1.0"
63
63
  },
64
64
  "dependencies": {
65
- "bpmn-elements": "^8.0.0",
65
+ "@types/bpmn-moddle": "^5.1.6",
66
+ "bpmn-elements": "^8.1.0",
66
67
  "bpmn-moddle": "^7.0.4",
67
68
  "debug": "^4.3.4",
68
69
  "moddle-context-serializer": "^2.0.0",
@@ -1,6 +1,7 @@
1
1
  // Author : Saeed Tabrizi
2
2
 
3
3
  import {EventEmitter} from 'events';
4
+ import {Definitions} from 'bpmn-moddle';
4
5
 
5
6
  declare module 'bpmn-engine' {
6
7
 
@@ -236,6 +237,7 @@ declare module 'bpmn-engine' {
236
237
  * optional bpmn-moddle options to be passed to bpmn-moddle
237
238
  */
238
239
  moddleOptions?: any;
240
+ moddleContext?: Definitions;
239
241
 
240
242
  extensions?: BpmnEngineExtension;
241
243
  /**