bpmn-engine 16.1.0 → 17.1.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/index.js +14 -12
  3. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ # 17.1.0
5
+
6
+ - Clear arbitrary engine timers on end and error, not just on stop as it was before
7
+ - Bump [`smqp@8`](https://github.com/paed01/smqp/blob/default/CHANGELOG.md)
8
+
9
+ # 17.0.0
10
+
11
+ - Even slimmer state from [`bpmn-elements@11`](https://github.com/paed01/bpmn-elements/blob/master/CHANGELOG.md). In most cases it should be safe to update, unless you inspect element states for some reason
12
+ - Remove node v14 build because it fails with `node:stream/promises` reasons. Still developing and running tests with node v14 since it works on my machine
13
+
4
14
  # 16.1.0
5
15
 
6
16
  - Introduce lane behaviour by upgrading [`bpmn-elements@10.1.0`](https://github.com/paed01/bpmn-elements/blob/master/CHANGELOG.md)
package/index.js CHANGED
@@ -432,10 +432,10 @@ Execution.prototype._setup = function setup(setupOptions = {}) {
432
432
  for (const definition of this.definitions) {
433
433
  if (listener) definition.environment.options.listener = listener;
434
434
 
435
- definition.broker.subscribeTmp('event', 'definition.#', onChildMessage, {noAck: true, consumerTag: '_engine_definition'});
436
- definition.broker.subscribeTmp('event', 'process.#', onChildMessage, {noAck: true, consumerTag: '_engine_process'});
437
- definition.broker.subscribeTmp('event', 'activity.#', onChildMessage, {noAck: true, consumerTag: '_engine_activity'});
438
- definition.broker.subscribeTmp('event', 'flow.#', onChildMessage, {noAck: true, consumerTag: '_engine_flow'});
435
+ const {queueName} = definition.broker.subscribeTmp('event', 'definition.#', onChildMessage, {noAck: true, consumerTag: '_engine_definition'});
436
+ definition.broker.bindQueue(queueName, 'event', 'process.#');
437
+ definition.broker.bindQueue(queueName, 'event', 'activity.#');
438
+ definition.broker.bindQueue(queueName, 'event', 'flow.#');
439
439
  }
440
440
  };
441
441
 
@@ -513,27 +513,29 @@ Execution.prototype._onChildMessage = function onChildMessage(routingKey, messag
513
513
  switch (newState) {
514
514
  case 'stopped':
515
515
  this._debug('stopped');
516
- broker.publish('event', 'engine.stop', {}, {type: 'stop'});
517
- return this[kEngine].emit('stop', this);
516
+ return this._complete('stop', {}, {type: 'stop'});
518
517
  case 'idle':
519
518
  this._debug('completed');
520
- broker.publish('event', 'engine.end', {}, {type: 'end'});
521
- return this[kEngine].emit('end', this);
519
+ return this._complete('end', {}, {type: 'end'});
522
520
  case 'error':
523
521
  this._debug('error');
524
- return broker.publish('event', 'engine.error', message.content.error, {type: 'error', mandatory: true});
522
+ return this._complete('error', message.content.error, {type: 'error', mandatory: true});
525
523
  }
526
524
  };
527
525
 
526
+ Execution.prototype._complete = function complete(eventType, content, messageProperties) {
527
+ const timers = this.environment.timers;
528
+ timers.executing.slice().forEach((ref) => timers.clearTimeout(ref));
529
+ this.broker.publish('event', 'engine.' + eventType, content, messageProperties);
530
+ return eventType !== 'error' && this[kEngine].emit(eventType, this);
531
+ };
532
+
528
533
  Execution.prototype._teardownDefinition = function teardownDefinition(definition) {
529
534
  const executing = this[kExecuting];
530
535
  const idx = executing.indexOf(definition);
531
536
  if (idx > -1) executing.splice(idx, 1);
532
537
 
533
538
  definition.broker.cancel('_engine_definition');
534
- definition.broker.cancel('_engine_process');
535
- definition.broker.cancel('_engine_activity');
536
- definition.broker.cancel('_engine_flow');
537
539
  };
538
540
 
539
541
  Execution.prototype.getState = function getState() {
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": "16.1.0",
4
+ "version": "17.1.0",
5
5
  "main": "index.js",
6
6
  "types": "types/bpmn-engine.d.ts",
7
7
  "repository": {
@@ -47,11 +47,11 @@
47
47
  ],
48
48
  "devDependencies": {
49
49
  "bent": "^7.3.12",
50
- "c8": "^7.14.0",
50
+ "c8": "^8.0.0",
51
51
  "camunda-bpmn-moddle": "^7.0.1",
52
52
  "chai": "^4.3.7",
53
53
  "chronokinesis": "^5.0.2",
54
- "eslint": "^8.42.0",
54
+ "eslint": "^8.44.0",
55
55
  "markdown-toc": "^1.2.0",
56
56
  "mocha": "^10.2.0",
57
57
  "mocha-cakes-2": "^3.3.0",
@@ -59,10 +59,10 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@types/bpmn-moddle": "^5.1.6",
62
- "bpmn-elements": "^10.1.0",
62
+ "bpmn-elements": "^11.0.1",
63
63
  "bpmn-moddle": "^8.0.1",
64
64
  "debug": "^4.3.4",
65
65
  "moddle-context-serializer": "^4.0.0",
66
- "smqp": "^7.1.3"
66
+ "smqp": "^8.0.0"
67
67
  }
68
68
  }