Skip to content

Commit 184464e

Browse files
committed
major update of bpmn-elements@17, mitigate issue #197
1 parent 5d99d69 commit 184464e

File tree

9 files changed

+49
-44
lines changed

9 files changed

+49
-44
lines changed

.github/workflows/build.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ name: Build
33
on:
44
pull_request:
55
push:
6-
branches: master
6+
branches:
7+
- master
78

89
jobs:
910
build:
1011
runs-on: ubuntu-latest
1112
strategy:
1213
matrix:
13-
node-version: [18, 20, latest]
14+
node-version: [18, 20, 22, latest]
1415
steps:
1516
- name: Checkout
1617
uses: actions/checkout@v4
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"endOfLine": "lf",
2+
"tabWidth": 2,
3+
"printWidth": 140,
34
"singleQuote": true,
45
"trailingComma": "es5"
56
}

CHANGELOG.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
11
# Changelog
22

3-
## 23.0.2
3+
## [24.0.0] - 2025-02-08
4+
5+
- major update [`bpmn-elements@17`](https://github.com/paed01/bpmn-elements/blob/master/CHANGELOG.md), something about mitigating weird formatting behaviour
6+
7+
## [23.0.2] - 2024-10-22
48

59
- move `smqp` to peerDependencies since it's included in `bpmn-elements`
610
- patch [`[email protected]`](https://github.com/paed01/bpmn-elements/blob/master/CHANGELOG.md)
711
- use optional chaining and remove futile object creations
812

9-
## 23.0.1
13+
## [23.0.1] - 2024-09-08
1014

1115
- patch [`[email protected]`](https://github.com/paed01/bpmn-elements/blob/master/CHANGELOG.md)
1216
- fix AppVeyor build badge
1317

14-
## 23.0.0
18+
## [23.0.0] - 2024-08-08
1519

1620
### Breaking
1721

1822
- changed `ConditionalEventDefinition` behaviour in [`bpmn-elements@16`](https://github.com/paed01/bpmn-elements/blob/master/CHANGELOG.md)
1923

20-
## 22.0.2
24+
## [22.0.2] - 2024-07-10
2125

2226
- patch [`[email protected]`](https://github.com/paed01/bpmn-elements/blob/master/CHANGELOG.md)
2327

24-
## 22.0.1
28+
## [22.0.1] - 2024-06-19
2529

2630
- for a number of years the `extendFn` option has been accepted, but never passed to moddle-context-serializer. Now it is
2731
- fix type declaration for options `extendFn` and `TypeResolver`
2832
- type declare that a generic listener instance with an emit function works just as well as a full blown new EventEmitter
2933

30-
## 22.0.0
34+
## [22.0.0] - 2024-06-14
3135

3236
Performance tweaks.
3337

@@ -39,11 +43,11 @@ Performance tweaks.
3943
- drop support for node 14 and 16
4044
- JavaScripts.Script property scripts is now a Map
4145

42-
## 21.1.0
46+
## [21.1.0] - 2024-05-17
4347

4448
- minor bump [`[email protected]`](https://github.com/paed01/bpmn-elements/blob/master/CHANGELOG.md), addresses issue #180
4549

46-
## 21.0.0
50+
## [21.0.0] - 2024-05-04
4751

4852
Stop execution if invalid time duration, cycle, or date is encountered.
4953

docs/API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- version -->
22

3-
# 23.0.2 API Reference
3+
# 24.0.0 API Reference
44

55
<!-- versionstop -->
66

lib/index.cjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,10 @@ Execution.prototype._setup = function setup(setupOptions) {
577577
for (const definition of this.definitions) {
578578
if (listener) definition.environment.options.listener = listener;
579579

580-
const { queueName } = definition.broker.subscribeTmp('event', 'definition.#', onChildMessage, { noAck: true, consumerTag: '_engine_definition' });
580+
const { queueName } = definition.broker.subscribeTmp('event', 'definition.#', onChildMessage, {
581+
noAck: true,
582+
consumerTag: '_engine_definition',
583+
});
581584
definition.broker.bindQueue(queueName, 'event', 'process.#');
582585
definition.broker.bindQueue(queueName, 'event', 'activity.#');
583586
definition.broker.bindQueue(queueName, 'event', 'flow.#');

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bpmn-engine",
33
"description": "BPMN 2.0 execution engine. Open source javascript workflow engine.",
4-
"version": "23.0.2",
4+
"version": "24.0.0",
55
"type": "module",
66
"module": "./src/index.js",
77
"main": "./lib/index.cjs",
@@ -69,7 +69,7 @@
6969
"texample": "^0.0.6"
7070
},
7171
"dependencies": {
72-
"bpmn-elements": "^16.2.1",
72+
"bpmn-elements": "^17.0.0",
7373
"bpmn-moddle": "^9.0.1",
7474
"debug": "^4.3.7",
7575
"moddle-context-serializer": "^4.2.1"

src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,10 @@ Execution.prototype._setup = function setup(setupOptions) {
431431
for (const definition of this.definitions) {
432432
if (listener) definition.environment.options.listener = listener;
433433

434-
const { queueName } = definition.broker.subscribeTmp('event', 'definition.#', onChildMessage, { noAck: true, consumerTag: '_engine_definition' });
434+
const { queueName } = definition.broker.subscribeTmp('event', 'definition.#', onChildMessage, {
435+
noAck: true,
436+
consumerTag: '_engine_definition',
437+
});
435438
definition.broker.bindQueue(queueName, 'event', 'process.#');
436439
definition.broker.bindQueue(queueName, 'event', 'activity.#');
437440
definition.broker.bindQueue(queueName, 'event', 'flow.#');

test/feature/multiple-sources-feature.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ Feature('Multiple sources', () => {
6868
Then('admin is notified that spot price has been updated', () => {
6969
const [, , adminApprove] = execution.getPostponed();
7070
expect(adminApprove).to.have.property('id', 'approveSpotPrice');
71-
expect(adminApprove.content).to.have.property('form').with.property('fields').with.property('newPrice').with.property('defaultValue', 110);
71+
expect(adminApprove.content)
72+
.to.have.property('form')
73+
.with.property('fields')
74+
.with.property('newPrice')
75+
.with.property('defaultValue', 110);
7276
});
7377

7478
And('the tasks can be retrieved by getActivityById', () => {
@@ -256,7 +260,11 @@ Feature('Multiple sources', () => {
256260

257261
When('admin approves new spot price', () => {
258262
expect(approveSpotPrice).to.have.property('id', 'approveSpotPrice');
259-
expect(approveSpotPrice.content).to.have.property('form').with.property('fields').with.property('newPrice').with.property('defaultValue', 100);
263+
expect(approveSpotPrice.content)
264+
.to.have.property('form')
265+
.with.property('fields')
266+
.with.property('newPrice')
267+
.with.property('defaultValue', 100);
260268

261269
approveSpotPrice.signal({
262270
form: {
@@ -642,7 +650,11 @@ function getExtendedEngine(options) {
642650
if (activity.behaviour.expression) {
643651
activity.behaviour.Service = ServiceExpression;
644652
}
645-
if (activity.isStart && activity.eventDefinitions && activity.eventDefinitions.find(({ type }) => type === 'bpmn:SignalEventDefinition')) {
653+
if (
654+
activity.isStart &&
655+
activity.eventDefinitions &&
656+
activity.eventDefinitions.find(({ type }) => type === 'bpmn:SignalEventDefinition')
657+
) {
646658
activity.on('end', (api) => {
647659
activity.environment.variables.message = api.content.output;
648660
});

types/bpmn-engine.d.ts

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33

44
import { EventEmitter } from 'node:events';
55
import { Definitions as BpmnModdleDefinitions } from 'bpmn-moddle';
6-
import {
7-
extendFn,
8-
SerializableContext,
9-
TypeResolver,
10-
} from 'moddle-context-serializer';
6+
import { extendFn, SerializableContext, TypeResolver } from 'moddle-context-serializer';
117
import {
128
ActivityStatus,
139
ElementBroker,
@@ -61,10 +57,7 @@ declare module 'bpmn-engine' {
6157
flow.discard: The sequence flow was discarded
6258
flow.looped: The sequence is looped
6359
*/
64-
export type BpmnSequenceFlowEvent =
65-
| 'flow.take'
66-
| 'flow.discard'
67-
| 'flow.looped';
60+
export type BpmnSequenceFlowEvent = 'flow.take' | 'flow.discard' | 'flow.looped';
6861

6962
export interface BpmnMessage {
7063
id?: string;
@@ -173,10 +166,7 @@ declare module 'bpmn-engine' {
173166
*/
174167
execute(): Promise<Execution>;
175168
execute(options: BpmnEngineExecuteOptions): Promise<Execution>;
176-
execute(
177-
options: BpmnEngineExecuteOptions,
178-
cb: (err: Error, execution?: Execution) => void
179-
): Promise<Execution>;
169+
execute(options: BpmnEngineExecuteOptions, cb: (err: Error, execution?: Execution) => void): Promise<Execution>;
180170
execute(cb: (err: Error) => void): Promise<Execution>;
181171

182172
/**
@@ -207,10 +197,7 @@ declare module 'bpmn-engine' {
207197
* @param options
208198
* @param callback
209199
*/
210-
resume(
211-
options?: BpmnEngineExecuteOptions,
212-
callback?: (err: Error, execution?: Execution) => void
213-
): Promise<Execution>;
200+
resume(options?: BpmnEngineExecuteOptions, callback?: (err: Error, execution?: Execution) => void): Promise<Execution>;
214201

215202
/**
216203
* Stop execution. The instance is terminated.
@@ -320,10 +307,7 @@ declare module 'bpmn-engine' {
320307
* @param message {BpmnMessage}
321308
* @param options
322309
*/
323-
signal(
324-
message?: BpmnMessage,
325-
options?: { ignoreSameDefinition?: boolean }
326-
): void;
310+
signal(message?: BpmnMessage, options?: { ignoreSameDefinition?: boolean }): void;
327311

328312
/**
329313
* send cancel activity to execution, distributed to all definitions
@@ -345,9 +329,6 @@ declare module 'bpmn-engine' {
345329
*/
346330
constructor(disableDummy?: boolean);
347331
register(activity: any): Script | undefined;
348-
getScript(
349-
language: string,
350-
identifier: { id: string; [x: string]: any }
351-
): Script;
332+
getScript(language: string, identifier: { id: string; [x: string]: any }): Script;
352333
}
353334
}

0 commit comments

Comments
 (0)