@bpmnkit/core 0.0.8
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 +185 -0
- package/dist/bpmn/auto-layout.d.ts +10 -0
- package/dist/bpmn/auto-layout.js +203 -0
- package/dist/bpmn/bpmn-builder.d.ts +381 -0
- package/dist/bpmn/bpmn-builder.js +1223 -0
- package/dist/bpmn/bpmn-model.d.ts +403 -0
- package/dist/bpmn/bpmn-model.js +2 -0
- package/dist/bpmn/bpmn-parser.d.ts +4 -0
- package/dist/bpmn/bpmn-parser.js +642 -0
- package/dist/bpmn/bpmn-serializer.d.ts +4 -0
- package/dist/bpmn/bpmn-serializer.js +515 -0
- package/dist/bpmn/compact.d.ts +91 -0
- package/dist/bpmn/compact.js +349 -0
- package/dist/bpmn/di-color.d.ts +9 -0
- package/dist/bpmn/di-color.js +32 -0
- package/dist/bpmn/index.d.ts +105 -0
- package/dist/bpmn/index.js +176 -0
- package/dist/bpmn/optimize/feel.d.ts +4 -0
- package/dist/bpmn/optimize/feel.js +186 -0
- package/dist/bpmn/optimize/flow.d.ts +4 -0
- package/dist/bpmn/optimize/flow.js +323 -0
- package/dist/bpmn/optimize/index.d.ts +5 -0
- package/dist/bpmn/optimize/index.js +51 -0
- package/dist/bpmn/optimize/naming.d.ts +8 -0
- package/dist/bpmn/optimize/naming.js +145 -0
- package/dist/bpmn/optimize/tasks.d.ts +4 -0
- package/dist/bpmn/optimize/tasks.js +273 -0
- package/dist/bpmn/optimize/types.d.ts +44 -0
- package/dist/bpmn/optimize/types.js +2 -0
- package/dist/bpmn/optimize/utils.d.ts +23 -0
- package/dist/bpmn/optimize/utils.js +129 -0
- package/dist/bpmn/rest-connector.d.ts +48 -0
- package/dist/bpmn/rest-connector.js +69 -0
- package/dist/bpmn/svg.d.ts +35 -0
- package/dist/bpmn/svg.js +557 -0
- package/dist/bpmn/type-guards.d.ts +136 -0
- package/dist/bpmn/type-guards.js +211 -0
- package/dist/bpmn/utils.d.ts +88 -0
- package/dist/bpmn/utils.js +207 -0
- package/dist/bpmn/zeebe-extensions.d.ts +72 -0
- package/dist/bpmn/zeebe-extensions.js +96 -0
- package/dist/dmn/compact.d.ts +44 -0
- package/dist/dmn/compact.js +125 -0
- package/dist/dmn/dmn-builder.d.ts +59 -0
- package/dist/dmn/dmn-builder.js +144 -0
- package/dist/dmn/dmn-layout.d.ts +57 -0
- package/dist/dmn/dmn-layout.js +256 -0
- package/dist/dmn/dmn-model.d.ts +158 -0
- package/dist/dmn/dmn-model.js +2 -0
- package/dist/dmn/dmn-parser.d.ts +4 -0
- package/dist/dmn/dmn-parser.js +275 -0
- package/dist/dmn/dmn-serializer.d.ts +4 -0
- package/dist/dmn/dmn-serializer.js +296 -0
- package/dist/dmn/index.d.ts +28 -0
- package/dist/dmn/index.js +51 -0
- package/dist/errors.d.ts +77 -0
- package/dist/errors.js +66 -0
- package/dist/form/compact.d.ts +20 -0
- package/dist/form/compact.js +146 -0
- package/dist/form/form-builder.d.ts +111 -0
- package/dist/form/form-builder.js +347 -0
- package/dist/form/form-model.d.ts +221 -0
- package/dist/form/form-model.js +2 -0
- package/dist/form/form-parser.d.ts +4 -0
- package/dist/form/form-parser.js +514 -0
- package/dist/form/form-serializer.d.ts +4 -0
- package/dist/form/form-serializer.js +240 -0
- package/dist/form/index.d.ts +27 -0
- package/dist/form/index.js +43 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +19 -0
- package/dist/layout/bench.d.ts +86 -0
- package/dist/layout/bench.js +225 -0
- package/dist/layout/coordinates.d.ts +62 -0
- package/dist/layout/coordinates.js +868 -0
- package/dist/layout/crossing.d.ts +8 -0
- package/dist/layout/crossing.js +60 -0
- package/dist/layout/graph.d.ts +28 -0
- package/dist/layout/graph.js +126 -0
- package/dist/layout/index.d.ts +7 -0
- package/dist/layout/index.js +5 -0
- package/dist/layout/layers.d.ts +13 -0
- package/dist/layout/layers.js +49 -0
- package/dist/layout/layout-engine.d.ts +21 -0
- package/dist/layout/layout-engine.js +191 -0
- package/dist/layout/overlap.d.ts +10 -0
- package/dist/layout/overlap.js +70 -0
- package/dist/layout/routing.d.ts +26 -0
- package/dist/layout/routing.js +439 -0
- package/dist/layout/subprocess.d.ts +14 -0
- package/dist/layout/subprocess.js +77 -0
- package/dist/layout/types.d.ts +72 -0
- package/dist/layout/types.js +37 -0
- package/dist/types/id-generator.d.ts +8 -0
- package/dist/types/id-generator.js +31 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +2 -0
- package/dist/types/xml-element.d.ts +12 -0
- package/dist/types/xml-element.js +2 -0
- package/dist/xml/index.d.ts +2 -0
- package/dist/xml/index.js +2 -0
- package/dist/xml/xml-parser.d.ts +13 -0
- package/dist/xml/xml-parser.js +271 -0
- package/package.json +38 -0
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import type { BpmnDefinitions, BpmnFlowElement, BpmnSequenceFlow } from "./bpmn-model.js";
|
|
2
|
+
import type { RestConnectorConfig } from "./rest-connector.js";
|
|
3
|
+
/** Options shared by all element methods. */
|
|
4
|
+
export interface ElementOptions {
|
|
5
|
+
name?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Options for creating a start event. */
|
|
8
|
+
export interface StartEventOptions extends ElementOptions {
|
|
9
|
+
/** Timer duration (ISO 8601) — creates a timer start event. */
|
|
10
|
+
timerDuration?: string;
|
|
11
|
+
/** Timer date (ISO 8601) — creates a timer start event. */
|
|
12
|
+
timerDate?: string;
|
|
13
|
+
/** Timer cycle (ISO 8601) — creates a timer start event. */
|
|
14
|
+
timerCycle?: string;
|
|
15
|
+
/** Message name — creates a message start event. */
|
|
16
|
+
messageName?: string;
|
|
17
|
+
/** Zeebe properties (e.g. webhook connector config). */
|
|
18
|
+
zeebeProperties?: Array<{
|
|
19
|
+
name: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}>;
|
|
22
|
+
/** Zeebe modeler template ID. */
|
|
23
|
+
modelerTemplate?: string;
|
|
24
|
+
/** Zeebe modeler template version. */
|
|
25
|
+
modelerTemplateVersion?: string;
|
|
26
|
+
/** Zeebe modeler template icon (data URI). */
|
|
27
|
+
modelerTemplateIcon?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Options for creating a service task. */
|
|
30
|
+
export interface ServiceTaskOptions {
|
|
31
|
+
/** Display name (required for BPMN canvas visibility). */
|
|
32
|
+
name: string;
|
|
33
|
+
/** Zeebe job type for this task. */
|
|
34
|
+
taskType: string;
|
|
35
|
+
/** Number of retries (defaults to "3"). */
|
|
36
|
+
retries?: string;
|
|
37
|
+
/** Input/output variable mappings. */
|
|
38
|
+
ioMapping?: {
|
|
39
|
+
inputs?: Array<{
|
|
40
|
+
source: string;
|
|
41
|
+
target: string;
|
|
42
|
+
}>;
|
|
43
|
+
outputs?: Array<{
|
|
44
|
+
source: string;
|
|
45
|
+
target: string;
|
|
46
|
+
}>;
|
|
47
|
+
};
|
|
48
|
+
/** Task header key-value pairs. */
|
|
49
|
+
taskHeaders?: Record<string, string>;
|
|
50
|
+
/** Zeebe modeler template ID. */
|
|
51
|
+
modelerTemplate?: string;
|
|
52
|
+
/** Zeebe modeler template version. */
|
|
53
|
+
modelerTemplateVersion?: string;
|
|
54
|
+
/** Zeebe modeler template icon (data URI). */
|
|
55
|
+
modelerTemplateIcon?: string;
|
|
56
|
+
}
|
|
57
|
+
/** Options for creating a script task. */
|
|
58
|
+
export interface ScriptTaskOptions {
|
|
59
|
+
/** Display name. */
|
|
60
|
+
name?: string;
|
|
61
|
+
/** FEEL expression for the script. */
|
|
62
|
+
expression: string;
|
|
63
|
+
/** Variable name to store the result. */
|
|
64
|
+
resultVariable: string;
|
|
65
|
+
}
|
|
66
|
+
/** Options for creating a user task. */
|
|
67
|
+
export interface UserTaskOptions {
|
|
68
|
+
/** Display name. */
|
|
69
|
+
name?: string;
|
|
70
|
+
/** Form key or form reference. */
|
|
71
|
+
formId?: string;
|
|
72
|
+
}
|
|
73
|
+
/** Options for creating a call activity. */
|
|
74
|
+
export interface CallActivityOptions {
|
|
75
|
+
/** Display name. */
|
|
76
|
+
name?: string;
|
|
77
|
+
/** Process ID to call. */
|
|
78
|
+
processId: string;
|
|
79
|
+
/** Whether to propagate all child variables. */
|
|
80
|
+
propagateAllChildVariables?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/** Options for creating a business rule task. */
|
|
83
|
+
export interface BusinessRuleTaskOptions {
|
|
84
|
+
/** Display name. */
|
|
85
|
+
name?: string;
|
|
86
|
+
/** Zeebe job type. */
|
|
87
|
+
taskType?: string;
|
|
88
|
+
/** DMN decision ID to evaluate. */
|
|
89
|
+
decisionId?: string;
|
|
90
|
+
/** Variable to store the result. */
|
|
91
|
+
resultVariable?: string;
|
|
92
|
+
}
|
|
93
|
+
/** Options for gateway elements. */
|
|
94
|
+
export interface GatewayOptions extends ElementOptions {
|
|
95
|
+
/** ID of the default sequence flow (set manually; prefer branch().defaultFlow()). */
|
|
96
|
+
defaultFlow?: string;
|
|
97
|
+
}
|
|
98
|
+
/** Options for an intermediate catch event. */
|
|
99
|
+
export interface IntermediateCatchEventOptions extends ElementOptions {
|
|
100
|
+
/** Timer duration (ISO 8601) — creates a timer catch event. */
|
|
101
|
+
timerDuration?: string;
|
|
102
|
+
/** Timer date (ISO 8601) — creates a timer catch event that fires at a specific date/time. */
|
|
103
|
+
timerDate?: string;
|
|
104
|
+
/** Timer cycle (ISO 8601) — creates a recurring timer catch event. */
|
|
105
|
+
timerCycle?: string;
|
|
106
|
+
/** Message name — creates a message catch event (aspirational). */
|
|
107
|
+
messageName?: string;
|
|
108
|
+
/** Signal name — creates a signal catch event (aspirational). */
|
|
109
|
+
signalName?: string;
|
|
110
|
+
}
|
|
111
|
+
/** Options for an intermediate throw event. */
|
|
112
|
+
export interface IntermediateThrowEventOptions extends ElementOptions {
|
|
113
|
+
/** Message name — creates a message throw event (aspirational). */
|
|
114
|
+
messageName?: string;
|
|
115
|
+
/** Signal name — creates a signal throw event (aspirational). */
|
|
116
|
+
signalName?: string;
|
|
117
|
+
/** Escalation code — creates an escalation throw event (aspirational). */
|
|
118
|
+
escalationCode?: string;
|
|
119
|
+
}
|
|
120
|
+
/** Options for a boundary event. */
|
|
121
|
+
export interface BoundaryEventOptions extends ElementOptions {
|
|
122
|
+
/** ID of the activity this boundary event is attached to. */
|
|
123
|
+
attachedTo: string;
|
|
124
|
+
/** Whether the host activity is cancelled when the event triggers (default true). */
|
|
125
|
+
cancelActivity?: boolean;
|
|
126
|
+
/** Error code — creates an error boundary event. */
|
|
127
|
+
errorCode?: string;
|
|
128
|
+
/** Error reference ID. */
|
|
129
|
+
errorRef?: string;
|
|
130
|
+
/** Timer duration — creates a timer boundary event (aspirational). */
|
|
131
|
+
timerDuration?: string;
|
|
132
|
+
/** Timer date (ISO 8601) — creates a timer boundary event that fires at a specific date/time. */
|
|
133
|
+
timerDate?: string;
|
|
134
|
+
/** Timer cycle (ISO 8601) — creates a recurring timer boundary event. */
|
|
135
|
+
timerCycle?: string;
|
|
136
|
+
/** Message name — creates a message boundary event (aspirational). */
|
|
137
|
+
messageName?: string;
|
|
138
|
+
/** Signal name — creates a signal boundary event (aspirational). */
|
|
139
|
+
signalName?: string;
|
|
140
|
+
}
|
|
141
|
+
/** Multi-instance loop configuration. */
|
|
142
|
+
export interface MultiInstanceOptions {
|
|
143
|
+
isSequential?: boolean;
|
|
144
|
+
collection?: string;
|
|
145
|
+
elementVariable?: string;
|
|
146
|
+
completionCondition?: string;
|
|
147
|
+
}
|
|
148
|
+
/** Options for sub-process elements. */
|
|
149
|
+
export interface SubProcessOptions extends ElementOptions {
|
|
150
|
+
multiInstance?: MultiInstanceOptions;
|
|
151
|
+
}
|
|
152
|
+
/** Options for ad-hoc sub-process elements. */
|
|
153
|
+
export interface AdHocSubProcessOptions extends ElementOptions {
|
|
154
|
+
/** FEEL expression for determining active elements. */
|
|
155
|
+
activeElementsCollection?: string;
|
|
156
|
+
/** Output collection for tool call results (agentic AI pattern). */
|
|
157
|
+
outputCollection?: string;
|
|
158
|
+
/** Output element FEEL expression (agentic AI pattern). */
|
|
159
|
+
outputElement?: string;
|
|
160
|
+
/** Zeebe task definition (agentic AI agent job worker). */
|
|
161
|
+
taskDefinition?: {
|
|
162
|
+
type: string;
|
|
163
|
+
retries?: string;
|
|
164
|
+
};
|
|
165
|
+
/** IO mapping for the ad-hoc sub-process. */
|
|
166
|
+
ioMapping?: {
|
|
167
|
+
inputs?: Array<{
|
|
168
|
+
source: string;
|
|
169
|
+
target: string;
|
|
170
|
+
}>;
|
|
171
|
+
outputs?: Array<{
|
|
172
|
+
source: string;
|
|
173
|
+
target: string;
|
|
174
|
+
}>;
|
|
175
|
+
};
|
|
176
|
+
/** Task header key-value pairs. */
|
|
177
|
+
taskHeaders?: Record<string, string>;
|
|
178
|
+
/** Multi-instance loop configuration. */
|
|
179
|
+
loopCharacteristics?: {
|
|
180
|
+
inputCollection: string;
|
|
181
|
+
inputElement?: string;
|
|
182
|
+
outputCollection?: string;
|
|
183
|
+
outputElement?: string;
|
|
184
|
+
};
|
|
185
|
+
multiInstance?: MultiInstanceOptions;
|
|
186
|
+
/** Zeebe modeler template ID. */
|
|
187
|
+
modelerTemplate?: string;
|
|
188
|
+
/** Zeebe modeler template version. */
|
|
189
|
+
modelerTemplateVersion?: string;
|
|
190
|
+
/** Zeebe modeler template icon (data URI). */
|
|
191
|
+
modelerTemplateIcon?: string;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Builder for a single named branch path from a gateway.
|
|
195
|
+
*
|
|
196
|
+
* Use `.condition(expr)` to set a FEEL condition on the outgoing sequence
|
|
197
|
+
* flow from the gateway, or `.defaultFlow()` to mark it as the default path.
|
|
198
|
+
*/
|
|
199
|
+
export declare class BranchBuilder {
|
|
200
|
+
/** @internal */
|
|
201
|
+
readonly _elements: BpmnFlowElement[];
|
|
202
|
+
/** @internal */
|
|
203
|
+
readonly _flows: BpmnSequenceFlow[];
|
|
204
|
+
/** @internal */
|
|
205
|
+
_defaultFlowId: string | undefined;
|
|
206
|
+
private lastNodeId;
|
|
207
|
+
private readonly gatewayId;
|
|
208
|
+
private readonly branchName;
|
|
209
|
+
private isFirstElement;
|
|
210
|
+
private pendingCondition;
|
|
211
|
+
private pendingDefault;
|
|
212
|
+
/** @internal – true once connectTo() has been called, meaning the branch end is already wired */
|
|
213
|
+
_connected: boolean;
|
|
214
|
+
/** @internal */
|
|
215
|
+
constructor(gatewayId: string, branchName: string);
|
|
216
|
+
/** Set a FEEL condition expression on this branch's outgoing sequence flow. */
|
|
217
|
+
condition(expression: string): this;
|
|
218
|
+
/** Mark this branch as the gateway's default (no-condition) flow. */
|
|
219
|
+
defaultFlow(): this;
|
|
220
|
+
private addElement;
|
|
221
|
+
/**
|
|
222
|
+
* Connect the current position to an existing or future element by ID.
|
|
223
|
+
* Supports forward references (element created later) and backward references (loops).
|
|
224
|
+
*/
|
|
225
|
+
connectTo(targetId: string): this;
|
|
226
|
+
/** @internal – ID of the last element added (or the gateway if branch is empty) */
|
|
227
|
+
get _lastNodeId(): string;
|
|
228
|
+
serviceTask(id: string, options: ServiceTaskOptions): this;
|
|
229
|
+
userTask(id: string, options?: UserTaskOptions): this;
|
|
230
|
+
scriptTask(id: string, options: ScriptTaskOptions): this;
|
|
231
|
+
sendTask(id: string, options?: ElementOptions): this;
|
|
232
|
+
receiveTask(id: string, options?: ElementOptions): this;
|
|
233
|
+
businessRuleTask(id: string, options?: BusinessRuleTaskOptions): this;
|
|
234
|
+
callActivity(id: string, options: CallActivityOptions): this;
|
|
235
|
+
startEvent(id?: string, options?: StartEventOptions): this;
|
|
236
|
+
endEvent(id?: string, options?: ElementOptions): this;
|
|
237
|
+
intermediateThrowEvent(id?: string, options?: IntermediateThrowEventOptions): this;
|
|
238
|
+
intermediateCatchEvent(id?: string, options?: IntermediateCatchEventOptions): this;
|
|
239
|
+
exclusiveGateway(id: string, options?: GatewayOptions): this;
|
|
240
|
+
parallelGateway(id: string, options?: ElementOptions): this;
|
|
241
|
+
inclusiveGateway(id: string, options?: GatewayOptions): this;
|
|
242
|
+
eventBasedGateway(id: string, options?: ElementOptions): this;
|
|
243
|
+
}
|
|
244
|
+
/** Builder for the contents of a sub-process or ad-hoc sub-process. */
|
|
245
|
+
export declare class SubProcessContentBuilder {
|
|
246
|
+
/** @internal */
|
|
247
|
+
readonly _elements: BpmnFlowElement[];
|
|
248
|
+
/** @internal */
|
|
249
|
+
readonly _flows: BpmnSequenceFlow[];
|
|
250
|
+
private lastNodeId;
|
|
251
|
+
private addElement;
|
|
252
|
+
startEvent(id?: string, options?: StartEventOptions): this;
|
|
253
|
+
endEvent(id?: string, options?: ElementOptions): this;
|
|
254
|
+
serviceTask(id: string, options: ServiceTaskOptions): this;
|
|
255
|
+
userTask(id: string, options?: UserTaskOptions): this;
|
|
256
|
+
scriptTask(id: string, options: ScriptTaskOptions): this;
|
|
257
|
+
callActivity(id: string, options: CallActivityOptions): this;
|
|
258
|
+
intermediateThrowEvent(id?: string, options?: IntermediateThrowEventOptions): this;
|
|
259
|
+
intermediateCatchEvent(id?: string, options?: IntermediateCatchEventOptions): this;
|
|
260
|
+
}
|
|
261
|
+
/** Fluent builder for constructing BPMN processes. */
|
|
262
|
+
export declare class ProcessBuilder {
|
|
263
|
+
private readonly processId;
|
|
264
|
+
private processName?;
|
|
265
|
+
private _isExecutable;
|
|
266
|
+
private _versionTag?;
|
|
267
|
+
private readonly flowElements;
|
|
268
|
+
private readonly sequenceFlows;
|
|
269
|
+
private readonly rootErrors;
|
|
270
|
+
private readonly rootMessages;
|
|
271
|
+
private lastNodeId;
|
|
272
|
+
private currentGatewayId;
|
|
273
|
+
private openBranchEnds;
|
|
274
|
+
private _autoLayout;
|
|
275
|
+
constructor(processId: string);
|
|
276
|
+
/** Enable auto-layout: `build()` will run the layout engine and populate diagram interchange data. */
|
|
277
|
+
withAutoLayout(): this;
|
|
278
|
+
/** Set the display name for this process. */
|
|
279
|
+
name(name: string): this;
|
|
280
|
+
/** Set whether this process is executable. */
|
|
281
|
+
executable(value: boolean): this;
|
|
282
|
+
/** Set the process version tag. */
|
|
283
|
+
versionTag(tag: string): this;
|
|
284
|
+
/** Add a start event. Start events never auto-connect from the previous element. */
|
|
285
|
+
startEvent(id?: string, options?: StartEventOptions): this;
|
|
286
|
+
/**
|
|
287
|
+
* Add a disconnected start event — begins a new parallel path in the process.
|
|
288
|
+
*
|
|
289
|
+
* Unlike `startEvent()` which continues from the current position,
|
|
290
|
+
* `addStartEvent()` clears the current position first so the start event
|
|
291
|
+
* is completely disconnected.
|
|
292
|
+
*/
|
|
293
|
+
addStartEvent(id?: string, options?: StartEventOptions): this;
|
|
294
|
+
/** Add an end event. */
|
|
295
|
+
endEvent(id?: string, options?: ElementOptions): this;
|
|
296
|
+
/** Add an intermediate throw event (none, message, signal, escalation). */
|
|
297
|
+
intermediateThrowEvent(id?: string, options?: IntermediateThrowEventOptions): this;
|
|
298
|
+
/** Add an intermediate catch event (timer, message, signal). */
|
|
299
|
+
intermediateCatchEvent(id?: string, options?: IntermediateCatchEventOptions): this;
|
|
300
|
+
/**
|
|
301
|
+
* Add a boundary event attached to an existing activity.
|
|
302
|
+
*
|
|
303
|
+
* Boundary events do not auto-connect from the previous element.
|
|
304
|
+
* They start a new outgoing chain from the boundary event itself.
|
|
305
|
+
*/
|
|
306
|
+
boundaryEvent(id: string, options: BoundaryEventOptions): this;
|
|
307
|
+
/** Add a service task with Zeebe task definition and optional IO mappings. */
|
|
308
|
+
serviceTask(id: string, options: ServiceTaskOptions): this;
|
|
309
|
+
/** Add a REST connector task — syntactic sugar over `serviceTask()`. */
|
|
310
|
+
restConnector(id: string, config: RestConnectorConfig): this;
|
|
311
|
+
/** Add a script task with a FEEL expression. */
|
|
312
|
+
scriptTask(id: string, options: ScriptTaskOptions): this;
|
|
313
|
+
/** Add a user task with optional form reference. */
|
|
314
|
+
userTask(id: string, options?: UserTaskOptions): this;
|
|
315
|
+
/** Add a send task (aspirational). */
|
|
316
|
+
sendTask(id: string, options?: ElementOptions): this;
|
|
317
|
+
/** Add a receive task (aspirational). */
|
|
318
|
+
receiveTask(id: string, options?: ElementOptions): this;
|
|
319
|
+
/** Add a business rule task. */
|
|
320
|
+
businessRuleTask(id: string, options?: BusinessRuleTaskOptions): this;
|
|
321
|
+
/** Add a call activity referencing another process. */
|
|
322
|
+
callActivity(id: string, options: CallActivityOptions): this;
|
|
323
|
+
/** Add an exclusive gateway (XOR split/join). */
|
|
324
|
+
exclusiveGateway(id: string, options?: GatewayOptions): this;
|
|
325
|
+
/** Add a parallel gateway (AND split/join). */
|
|
326
|
+
parallelGateway(id: string, options?: ElementOptions): this;
|
|
327
|
+
/** Add an inclusive gateway (OR split/join). Aspirational. */
|
|
328
|
+
inclusiveGateway(id: string, options?: GatewayOptions): this;
|
|
329
|
+
/** Add an event-based gateway. Aspirational. */
|
|
330
|
+
eventBasedGateway(id: string, options?: ElementOptions): this;
|
|
331
|
+
/**
|
|
332
|
+
* Create a named branch from the current gateway.
|
|
333
|
+
*
|
|
334
|
+
* Each branch receives a {@link BranchBuilder} whose chain starts from
|
|
335
|
+
* the gateway. Use `.condition(expr)` or `.defaultFlow()` to configure
|
|
336
|
+
* the outgoing sequence flow, then chain flow-node methods, and finish
|
|
337
|
+
* with `.connectTo(targetId)` to merge into another element.
|
|
338
|
+
*
|
|
339
|
+
* @example
|
|
340
|
+
* ```ts
|
|
341
|
+
* .exclusiveGateway("check")
|
|
342
|
+
* .branch("yes", b => b.condition("= ok").serviceTask("do", { taskType: "x" }).connectTo("merge"))
|
|
343
|
+
* .branch("no", b => b.defaultFlow().serviceTask("fail", { taskType: "y" }).connectTo("merge"))
|
|
344
|
+
* .exclusiveGateway("merge")
|
|
345
|
+
* .endEvent("end")
|
|
346
|
+
* ```
|
|
347
|
+
*/
|
|
348
|
+
branch(name: string, callback: (b: BranchBuilder) => void): this;
|
|
349
|
+
/** Connect the current position to an existing or future element by ID. */
|
|
350
|
+
connectTo(targetId: string): this;
|
|
351
|
+
/**
|
|
352
|
+
* Position the builder at an existing element, allowing additional
|
|
353
|
+
* outgoing flows from any point in the graph.
|
|
354
|
+
*
|
|
355
|
+
* @throws If no element with the given ID exists.
|
|
356
|
+
*/
|
|
357
|
+
element(elementId: string): this;
|
|
358
|
+
/** Add an ad-hoc sub-process with optional AI agent or multi-instance configuration. */
|
|
359
|
+
adHocSubProcess(id: string, content: (b: SubProcessContentBuilder) => void, options?: AdHocSubProcessOptions): this;
|
|
360
|
+
/** Add a sub-process (aspirational). */
|
|
361
|
+
subProcess(id: string, content: (b: SubProcessContentBuilder) => void, options?: SubProcessOptions): this;
|
|
362
|
+
/** Add an event sub-process (aspirational). */
|
|
363
|
+
eventSubProcess(id: string, content: (b: SubProcessContentBuilder) => void, options?: ElementOptions): this;
|
|
364
|
+
/**
|
|
365
|
+
* Build the complete BPMN definitions model.
|
|
366
|
+
*
|
|
367
|
+
* Resolves all forward-referenced `incoming` / `outgoing` arrays and wraps
|
|
368
|
+
* the process in a {@link BpmnDefinitions} ready for XML serialization.
|
|
369
|
+
*/
|
|
370
|
+
build(): BpmnDefinitions;
|
|
371
|
+
private buildDiagram;
|
|
372
|
+
/**
|
|
373
|
+
* Insert matching join gateways where split-gateway branches converge
|
|
374
|
+
* on a non-gateway target. BPMN best practice: every split has a join.
|
|
375
|
+
*/
|
|
376
|
+
private insertJoinGateways;
|
|
377
|
+
/** Trace backward from a node to find which split gateway it belongs to. */
|
|
378
|
+
private traceBackToSplit;
|
|
379
|
+
private addFlowElement;
|
|
380
|
+
}
|
|
381
|
+
//# sourceMappingURL=bpmn-builder.d.ts.map
|