@0dep/bpmn-extensions 0.0.1 → 0.0.2
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/README.md +2 -0
- package/dist/index.js +14 -4
- package/package.json +1 -1
- package/src/ElementExtensions.js +5 -4
- package/src/getExtensions.js +9 -0
- package/types/index.d.ts +4 -0
- package/types/index.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -24,6 +24,8 @@ npm install @0dep/bpmn-extensions bpmn-elements
|
|
|
24
24
|
- **`zeebe:script`** — a `FeelScripts()` adapter runs a script task's FEEL `expression` and assigns
|
|
25
25
|
the result to its `resultVariable`.
|
|
26
26
|
- **`zeebe:taskDefinition`** — maps a service task's job `type` to an environment service (job worker).
|
|
27
|
+
- **`zeebe:calledDecision`** — a business rule task resolves its `decisionId` via an environment
|
|
28
|
+
service (you bring the decision; we don't evaluate DMN) and assigns the result to `resultVariable`.
|
|
27
29
|
- **`zeebe:ioMapping`** — input mapping on entry (parent scope) and output mapping on completion
|
|
28
30
|
(job-result scope), with dotted `target` paths. Propagates across boundaries: a call activity's
|
|
29
31
|
input reaches the called process and its output maps the called process result back; a sub
|
package/dist/index.js
CHANGED
|
@@ -16586,6 +16586,8 @@ JobService.prototype.execute = function execute(executionMessage, callback) {
|
|
|
16586
16586
|
* listeners?: ExecutionListeners,
|
|
16587
16587
|
* form?: Form,
|
|
16588
16588
|
* loop?: LoopCharacteristics,
|
|
16589
|
+
* script?: any,
|
|
16590
|
+
* calledDecision?: any,
|
|
16589
16591
|
* Service?: Function,
|
|
16590
16592
|
* }}
|
|
16591
16593
|
*/
|
|
@@ -16619,6 +16621,13 @@ function getExtensions(element) {
|
|
|
16619
16621
|
case 'zeebe:Script':
|
|
16620
16622
|
result.script = ext;
|
|
16621
16623
|
break;
|
|
16624
|
+
case 'zeebe:CalledDecision':
|
|
16625
|
+
// A business rule task runs as a service task (bpmn-elements maps it to ServiceTask). The
|
|
16626
|
+
// decision is resolved by an environment service named by the decision id; its result is
|
|
16627
|
+
// named by `resultVariable`.
|
|
16628
|
+
result.calledDecision = ext;
|
|
16629
|
+
result.Service = JobService.bind(JobService, ext.decisionId);
|
|
16630
|
+
break;
|
|
16622
16631
|
case 'zeebe:FormDefinition':
|
|
16623
16632
|
result.form = new Form(ext);
|
|
16624
16633
|
break;
|
|
@@ -16734,7 +16743,7 @@ class ElementExtensions {
|
|
|
16734
16743
|
return result;
|
|
16735
16744
|
}
|
|
16736
16745
|
#formatOnExecuted(elementApi) {
|
|
16737
|
-
const { io, script, loop } = this.extensions;
|
|
16746
|
+
const { io, script, calledDecision, loop } = this.extensions;
|
|
16738
16747
|
let jobResult = elementApi.content.output;
|
|
16739
16748
|
|
|
16740
16749
|
// Multi-instance: aggregate the per-instance outputs into the `outputCollection` array.
|
|
@@ -16750,9 +16759,10 @@ class ElementExtensions {
|
|
|
16750
16759
|
jobResult = jobResult.output;
|
|
16751
16760
|
}
|
|
16752
16761
|
|
|
16753
|
-
// A script task
|
|
16754
|
-
// an object of variables.
|
|
16755
|
-
const
|
|
16762
|
+
// A script task (`zeebe:script`) or business rule task (`zeebe:calledDecision`) names its single
|
|
16763
|
+
// result with `resultVariable`. A plain job's result is already an object of variables.
|
|
16764
|
+
const named = script || calledDecision;
|
|
16765
|
+
const resultObject = named ? (named.resultVariable ? { [named.resultVariable]: jobResult } : undefined) : jobResult;
|
|
16756
16766
|
|
|
16757
16767
|
let output;
|
|
16758
16768
|
if (io?.hasOutput) {
|
package/package.json
CHANGED
package/src/ElementExtensions.js
CHANGED
|
@@ -97,7 +97,7 @@ export class ElementExtensions {
|
|
|
97
97
|
return result;
|
|
98
98
|
}
|
|
99
99
|
#formatOnExecuted(elementApi) {
|
|
100
|
-
const { io, script, loop } = this.extensions;
|
|
100
|
+
const { io, script, calledDecision, loop } = this.extensions;
|
|
101
101
|
let jobResult = elementApi.content.output;
|
|
102
102
|
|
|
103
103
|
// Multi-instance: aggregate the per-instance outputs into the `outputCollection` array.
|
|
@@ -113,9 +113,10 @@ export class ElementExtensions {
|
|
|
113
113
|
jobResult = jobResult.output;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
// A script task
|
|
117
|
-
// an object of variables.
|
|
118
|
-
const
|
|
116
|
+
// A script task (`zeebe:script`) or business rule task (`zeebe:calledDecision`) names its single
|
|
117
|
+
// result with `resultVariable`. A plain job's result is already an object of variables.
|
|
118
|
+
const named = script || calledDecision;
|
|
119
|
+
const resultObject = named ? (named.resultVariable ? { [named.resultVariable]: jobResult } : undefined) : jobResult;
|
|
119
120
|
|
|
120
121
|
let output;
|
|
121
122
|
if (io?.hasOutput) {
|
package/src/getExtensions.js
CHANGED
|
@@ -18,6 +18,8 @@ import { JobService } from './extensions/TaskDefinition.js';
|
|
|
18
18
|
* listeners?: ExecutionListeners,
|
|
19
19
|
* form?: Form,
|
|
20
20
|
* loop?: LoopCharacteristics,
|
|
21
|
+
* script?: any,
|
|
22
|
+
* calledDecision?: any,
|
|
21
23
|
* Service?: Function,
|
|
22
24
|
* }}
|
|
23
25
|
*/
|
|
@@ -51,6 +53,13 @@ export function getExtensions(element) {
|
|
|
51
53
|
case 'zeebe:Script':
|
|
52
54
|
result.script = ext;
|
|
53
55
|
break;
|
|
56
|
+
case 'zeebe:CalledDecision':
|
|
57
|
+
// A business rule task runs as a service task (bpmn-elements maps it to ServiceTask). The
|
|
58
|
+
// decision is resolved by an environment service named by the decision id; its result is
|
|
59
|
+
// named by `resultVariable`.
|
|
60
|
+
result.calledDecision = ext;
|
|
61
|
+
result.Service = JobService.bind(JobService, ext.decisionId);
|
|
62
|
+
break;
|
|
54
63
|
case 'zeebe:FormDefinition':
|
|
55
64
|
result.form = new Form(ext);
|
|
56
65
|
break;
|
package/types/index.d.ts
CHANGED
|
@@ -96,6 +96,8 @@ declare module '@0dep/bpmn-extensions' {
|
|
|
96
96
|
listeners?: ExecutionListeners;
|
|
97
97
|
form?: Form;
|
|
98
98
|
loop?: LoopCharacteristics;
|
|
99
|
+
script?: any;
|
|
100
|
+
calledDecision?: any;
|
|
99
101
|
Service?: Function;
|
|
100
102
|
};
|
|
101
103
|
activate(message: any): void;
|
|
@@ -123,6 +125,8 @@ declare module '@0dep/bpmn-extensions' {
|
|
|
123
125
|
listeners?: ExecutionListeners;
|
|
124
126
|
form?: Form;
|
|
125
127
|
loop?: LoopCharacteristics;
|
|
128
|
+
script?: any;
|
|
129
|
+
calledDecision?: any;
|
|
126
130
|
Service?: Function;
|
|
127
131
|
};
|
|
128
132
|
activate(): void;
|
package/types/index.d.ts.map
CHANGED
|
@@ -62,6 +62,6 @@
|
|
|
62
62
|
null,
|
|
63
63
|
null
|
|
64
64
|
],
|
|
65
|
-
"mappings": ";;;;;;;iBAwBgBA,UAAUA;;;;;;;;iBAqBVC,QAAQA;;;;;;;;;;;;;;;;iBClCRC,eAAeA;;;;;;;;;;;iBCEfC,WAAWA;;;;;;;;;;;;;;;iBCIXC,UAAUA;cAAVA,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCNbC,iBAAiBA
|
|
65
|
+
"mappings": ";;;;;;;iBAwBgBA,UAAUA;;;;;;;;iBAqBVC,QAAQA;;;;;;;;;;;;;;;;iBClCRC,eAAeA;;;;;;;;;;;iBCEfC,WAAWA;;;;;;;;;;;;;;;iBCIXC,UAAUA;cAAVA,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCNbC,iBAAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCJjBC,iBAAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCIjBC,oBAAoBA;;;;;;iBCEjBC,gBAAgBA;;;;iBAShBC,SAASA;;;;;;iBAUTC,YAAYA;;;;;;;iBAYZC,qBAAqBA;;;;;;iBAYrBC,YAAYA;cCxDfC,YAAYA;;;;;;;cAQZC,WAAWA;;;;;;;;;;;OCFXC,cAAcA;;;;;;;;;;;;;;OAgCdC,aAAaA;;;;;;;;;;;;;;;;;;OCzBbC,SAASA;;;;;;;;;;;;;;;;;;;;;;;OCPTC,WAAWA;;;;;;;;;;;OCEXC,UAAUA;;;;;;;;;;;;;;;OCIVC,kBAAkBA;;;;;;;;;;;;;;;;;;;OCFlBC,IAAIA;;;;;;;;;;;;;;;;;;;;;;OCGJC,mBAAmBA",
|
|
66
66
|
"ignoreList": []
|
|
67
67
|
}
|