bpmn-elements 12.0.0 → 13.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.
- package/CHANGELOG.md +14 -0
- package/dist/Environment.js +15 -15
- package/dist/activity/Activity.js +125 -142
- package/dist/activity/ActivityExecution.js +0 -1
- package/dist/definition/Definition.js +38 -42
- package/dist/definition/DefinitionExecution.js +51 -53
- package/dist/eventDefinitions/EventDefinitionExecution.js +10 -10
- package/dist/eventDefinitions/TimerEventDefinition.js +16 -16
- package/dist/events/BoundaryEvent.js +12 -11
- package/dist/events/index.js +60 -0
- package/dist/flows/Association.js +3 -2
- package/dist/flows/MessageFlow.js +3 -2
- package/dist/flows/SequenceFlow.js +3 -2
- package/dist/gateways/index.js +49 -0
- package/dist/process/Process.js +53 -59
- package/dist/process/ProcessExecution.js +40 -35
- package/dist/tasks/SubProcess.js +2 -2
- package/dist/tasks/index.js +93 -0
- package/events.d.ts +1 -0
- package/gateways.d.ts +1 -0
- package/index.d.ts +1 -0
- package/package.json +39 -19
- package/src/Environment.js +16 -17
- package/src/activity/Activity.js +100 -132
- package/src/activity/ActivityExecution.js +0 -1
- package/src/definition/Definition.js +30 -40
- package/src/definition/DefinitionExecution.js +47 -55
- package/src/eventDefinitions/EventDefinitionExecution.js +9 -10
- package/src/eventDefinitions/TimerEventDefinition.js +14 -16
- package/src/events/BoundaryEvent.js +11 -11
- package/src/events/index.js +5 -0
- package/src/flows/Association.js +4 -2
- package/src/flows/MessageFlow.js +4 -2
- package/src/flows/SequenceFlow.js +4 -2
- package/src/gateways/index.js +4 -0
- package/src/process/Process.js +40 -54
- package/src/process/ProcessExecution.js +37 -35
- package/src/tasks/SubProcess.js +2 -2
- package/src/tasks/index.js +8 -0
- package/tasks.d.ts +1 -0
- package/types/index.d.ts +69 -767
- package/types/types.d.ts +721 -0
package/src/process/Process.js
CHANGED
|
@@ -60,68 +60,54 @@ export function Process(processDef, context) {
|
|
|
60
60
|
this[kExtensions] = context.loadExtensions(this);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
Object.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
Object.defineProperties(Process.prototype, {
|
|
64
|
+
counters: {
|
|
65
|
+
get() {
|
|
66
|
+
return {...this[kCounters]};
|
|
67
|
+
},
|
|
67
68
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const lanes = this[kLanes];
|
|
74
|
-
return lanes && lanes.slice();
|
|
69
|
+
lanes: {
|
|
70
|
+
get() {
|
|
71
|
+
const lanes = this[kLanes];
|
|
72
|
+
return lanes && lanes.slice();
|
|
73
|
+
},
|
|
75
74
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
get() {
|
|
81
|
-
return this[kExtensions];
|
|
75
|
+
extensions: {
|
|
76
|
+
get() {
|
|
77
|
+
return this[kExtensions];
|
|
78
|
+
},
|
|
82
79
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
get() {
|
|
88
|
-
return this[kStopped];
|
|
80
|
+
stopped: {
|
|
81
|
+
get() {
|
|
82
|
+
return this[kStopped];
|
|
83
|
+
},
|
|
89
84
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (!this[kConsuming]) return false;
|
|
96
|
-
return !!this.status;
|
|
85
|
+
isRunning: {
|
|
86
|
+
get() {
|
|
87
|
+
if (!this[kConsuming]) return false;
|
|
88
|
+
return !!this.status;
|
|
89
|
+
},
|
|
97
90
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const {executionId, initExecutionId} = this[kExec];
|
|
104
|
-
return executionId || initExecutionId;
|
|
91
|
+
executionId: {
|
|
92
|
+
get() {
|
|
93
|
+
const {executionId, initExecutionId} = this[kExec];
|
|
94
|
+
return executionId || initExecutionId;
|
|
95
|
+
},
|
|
105
96
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
get() {
|
|
111
|
-
return this[kExec].execution;
|
|
97
|
+
execution: {
|
|
98
|
+
get() {
|
|
99
|
+
return this[kExec].execution;
|
|
100
|
+
},
|
|
112
101
|
},
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
get() {
|
|
118
|
-
return this[kStatus];
|
|
102
|
+
status: {
|
|
103
|
+
get() {
|
|
104
|
+
return this[kStatus];
|
|
105
|
+
},
|
|
119
106
|
},
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return this[kExec].execution && this[kExec].execution.activityStatus || 'idle';
|
|
107
|
+
activityStatus: {
|
|
108
|
+
get() {
|
|
109
|
+
return this[kExec].execution && this[kExec].execution.activityStatus || 'idle';
|
|
110
|
+
},
|
|
125
111
|
},
|
|
126
112
|
});
|
|
127
113
|
|
|
@@ -58,42 +58,36 @@ function ProcessExecution(parentActivity, context) {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
Object.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
Object.defineProperties(ProcessExecution.prototype, {
|
|
62
|
+
stopped: {
|
|
63
|
+
get() {
|
|
64
|
+
return this[kStopped];
|
|
65
|
+
},
|
|
65
66
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
get() {
|
|
71
|
-
return this[kCompleted];
|
|
67
|
+
completed: {
|
|
68
|
+
get() {
|
|
69
|
+
return this[kCompleted];
|
|
70
|
+
},
|
|
72
71
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
get() {
|
|
78
|
-
return this[kStatus];
|
|
72
|
+
status: {
|
|
73
|
+
get() {
|
|
74
|
+
return this[kStatus];
|
|
75
|
+
},
|
|
79
76
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return this[kElements].postponed.length;
|
|
77
|
+
postponedCount: {
|
|
78
|
+
get() {
|
|
79
|
+
return this[kElements].postponed.length;
|
|
80
|
+
},
|
|
85
81
|
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return this[kActivated];
|
|
82
|
+
isRunning: {
|
|
83
|
+
get() {
|
|
84
|
+
return this[kActivated];
|
|
85
|
+
},
|
|
91
86
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return this[kTracker].activityStatus;
|
|
87
|
+
activityStatus: {
|
|
88
|
+
get() {
|
|
89
|
+
return this[kTracker].activityStatus;
|
|
90
|
+
},
|
|
97
91
|
},
|
|
98
92
|
});
|
|
99
93
|
|
|
@@ -171,6 +165,13 @@ ProcessExecution.prototype.resume = function resume() {
|
|
|
171
165
|
|
|
172
166
|
ProcessExecution.prototype.getState = function getState() {
|
|
173
167
|
const {children, flows, outboundMessageFlows, associations} = this[kElements];
|
|
168
|
+
|
|
169
|
+
const flowStates = flows.reduce((result, flow) => {
|
|
170
|
+
const elmState = flow.getState();
|
|
171
|
+
if (elmState) result.push(elmState);
|
|
172
|
+
return result;
|
|
173
|
+
}, []);
|
|
174
|
+
|
|
174
175
|
return {
|
|
175
176
|
executionId: this.executionId,
|
|
176
177
|
stopped: this[kStopped],
|
|
@@ -178,12 +179,13 @@ ProcessExecution.prototype.getState = function getState() {
|
|
|
178
179
|
status: this.status,
|
|
179
180
|
children: children.reduce((result, activity) => {
|
|
180
181
|
if (activity.placeholder) return result;
|
|
181
|
-
|
|
182
|
+
const elmState = activity.getState();
|
|
183
|
+
if (elmState) result.push(elmState);
|
|
182
184
|
return result;
|
|
183
185
|
}, []),
|
|
184
|
-
...(flows.length && {flows:
|
|
185
|
-
...(outboundMessageFlows.length && {messageFlows: outboundMessageFlows.length && outboundMessageFlows.map((f) => f.getState())}),
|
|
186
|
-
...(associations.length && {associations: associations.map((f) => f.getState())}),
|
|
186
|
+
...(flows.length && { flows: flowStates }),
|
|
187
|
+
...(outboundMessageFlows.length && { messageFlows: outboundMessageFlows.length && outboundMessageFlows.map((f) => f.getState()).filter(Boolean) }),
|
|
188
|
+
...(associations.length && { associations: associations.map((f) => f.getState()).filter(Boolean) }),
|
|
187
189
|
};
|
|
188
190
|
};
|
|
189
191
|
|
package/src/tasks/SubProcess.js
CHANGED
|
@@ -44,12 +44,12 @@ export function SubProcessBehaviour(activity, context) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
Object.defineProperties(SubProcessBehaviour.prototype, {
|
|
47
|
-
|
|
47
|
+
execution: {
|
|
48
48
|
get() {
|
|
49
49
|
return this[kExecutions][0];
|
|
50
50
|
},
|
|
51
51
|
},
|
|
52
|
-
|
|
52
|
+
executions: {
|
|
53
53
|
get() {
|
|
54
54
|
return this[kExecutions].slice();
|
|
55
55
|
},
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './CallActivity.js';
|
|
2
|
+
export * from './ReceiveTask.js';
|
|
3
|
+
export * from './ScriptTask.js';
|
|
4
|
+
export * from './ServiceTask.js';
|
|
5
|
+
export * from './SignalTask.js';
|
|
6
|
+
export * from './SubProcess.js';
|
|
7
|
+
export * from './Task.js';
|
|
8
|
+
export * from './Transaction.js';
|
package/tasks.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './types/index.js';
|