bpmn-engine 13.0.0 → 14.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 +290 -0
- package/index.js +463 -435
- package/lib/JavaScripts.js +34 -35
- package/lib/extensions/ProcessOutputDataObject.js +0 -1
- package/package.json +9 -9
- package/types/bpmn-engine.d.ts +1 -1
package/lib/JavaScripts.js
CHANGED
|
@@ -2,50 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
const {Script} = require('vm');
|
|
4
4
|
|
|
5
|
-
module.exports =
|
|
6
|
-
const scripts = {};
|
|
5
|
+
module.exports = Scripts;
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
function Scripts(disableDummy) {
|
|
8
|
+
if (!(this instanceof Scripts)) return new Scripts(disableDummy);
|
|
9
|
+
this.scripts = {};
|
|
10
|
+
this.disableDummy = disableDummy;
|
|
11
|
+
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
Scripts.prototype.register = function register({id, type, behaviour, logger, environment}) {
|
|
14
|
+
let scriptBody, language;
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
default: {
|
|
25
|
-
language = behaviour.scriptFormat;
|
|
26
|
-
scriptBody = behaviour.script;
|
|
27
|
-
}
|
|
16
|
+
switch (type) {
|
|
17
|
+
case 'bpmn:SequenceFlow': {
|
|
18
|
+
if (!behaviour.conditionExpression) return;
|
|
19
|
+
language = behaviour.conditionExpression.language;
|
|
20
|
+
if (!language) return;
|
|
21
|
+
scriptBody = behaviour.conditionExpression.body;
|
|
22
|
+
break;
|
|
28
23
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (disableDummy) return;
|
|
33
|
-
const script = new DummyScript(language, filename, logger);
|
|
34
|
-
scripts[id] = script;
|
|
35
|
-
return script;
|
|
24
|
+
default: {
|
|
25
|
+
language = behaviour.scriptFormat;
|
|
26
|
+
scriptBody = behaviour.script;
|
|
36
27
|
}
|
|
28
|
+
}
|
|
37
29
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
const filename = `${type}/${id}`;
|
|
31
|
+
if (!language || !scriptBody) {
|
|
32
|
+
if (this.disableDummy) return;
|
|
33
|
+
const script = new DummyScript(language, filename, logger);
|
|
34
|
+
this.scripts[id] = script;
|
|
43
35
|
return script;
|
|
44
36
|
}
|
|
45
37
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
if (!/^javascript$/i.test(language)) return;
|
|
39
|
+
|
|
40
|
+
const script = new JavaScript(language, filename, scriptBody, environment);
|
|
41
|
+
this.scripts[id] = script;
|
|
42
|
+
|
|
43
|
+
return script;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
Scripts.prototype.getScript = function getScript(language, {id}) {
|
|
47
|
+
return this.scripts[id];
|
|
49
48
|
};
|
|
50
49
|
|
|
51
50
|
function JavaScript(language, filename, scriptBody, environment) {
|
|
@@ -19,7 +19,6 @@ module.exports = function ProcessOutputDataObject(dataObjectDef, {environment})
|
|
|
19
19
|
|
|
20
20
|
environment.output.data = environment.output.data || {};
|
|
21
21
|
environment.output.data[id] = value;
|
|
22
|
-
|
|
23
22
|
return broker.publish(exchange, `${routingKeyPrefix}response`, {id, name, type, value}, messageProperties);
|
|
24
23
|
},
|
|
25
24
|
};
|
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": "14.0.0",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "types/bpmn-engine.d.ts",
|
|
7
7
|
"repository": {
|
|
@@ -51,21 +51,21 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"bent": "^7.3.12",
|
|
54
|
-
"camunda-bpmn-moddle": "^6.1.
|
|
55
|
-
"chai": "^4.3.
|
|
54
|
+
"camunda-bpmn-moddle": "^6.1.2",
|
|
55
|
+
"chai": "^4.3.6",
|
|
56
56
|
"chronokinesis": "^3.0.0",
|
|
57
57
|
"eslint": "^7.23.0",
|
|
58
58
|
"markdown-toc": "^1.2.0",
|
|
59
|
-
"mocha": "^9.
|
|
59
|
+
"mocha": "^9.2.2",
|
|
60
60
|
"mocha-cakes-2": "^3.3.0",
|
|
61
|
-
"nock": "^13.
|
|
61
|
+
"nock": "^13.2.4",
|
|
62
62
|
"nyc": "^15.1.0"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"bpmn-elements": "^
|
|
65
|
+
"bpmn-elements": "^8.0.0",
|
|
66
66
|
"bpmn-moddle": "^7.0.4",
|
|
67
|
-
"debug": "^4.3.
|
|
68
|
-
"moddle-context-serializer": "^
|
|
69
|
-
"smqp": "^
|
|
67
|
+
"debug": "^4.3.4",
|
|
68
|
+
"moddle-context-serializer": "^2.0.0",
|
|
69
|
+
"smqp": "^6.0.0"
|
|
70
70
|
}
|
|
71
71
|
}
|
package/types/bpmn-engine.d.ts
CHANGED
|
@@ -218,7 +218,7 @@ declare module 'bpmn-engine' {
|
|
|
218
218
|
/**
|
|
219
219
|
* optional Logger factory, defaults to debug logger
|
|
220
220
|
*/
|
|
221
|
-
Logger?: BpmnLogger;
|
|
221
|
+
Logger?: (scope: string) => BpmnLogger;
|
|
222
222
|
|
|
223
223
|
/**
|
|
224
224
|
* optional inline script handler, defaults to nodejs vm module handling, i.e. JavaScript
|