@bpmnkit/core 0.1.1 → 0.2.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/README.md +32 -1
- package/dist/bpmn/agentic.d.ts +121 -0
- package/dist/bpmn/agentic.js +97 -0
- package/dist/bpmn/auto-layout.d.ts +5 -5
- package/dist/bpmn/auto-layout.js +592 -36
- package/dist/bpmn/bpmn-builder.d.ts +265 -3
- package/dist/bpmn/bpmn-builder.js +603 -197
- package/dist/bpmn/bpmn-model.d.ts +114 -0
- package/dist/bpmn/bpmn-parser.js +1414 -521
- package/dist/bpmn/bpmn-serializer.js +107 -19
- package/dist/bpmn/compact.d.ts +17 -2
- package/dist/bpmn/compact.js +3 -3
- package/dist/bpmn/full-operations.d.ts +89 -0
- package/dist/bpmn/full-operations.js +478 -0
- package/dist/bpmn/index.d.ts +19 -0
- package/dist/bpmn/index.js +21 -0
- package/dist/bpmn/optimize/agentic.d.ts +10 -0
- package/dist/bpmn/optimize/agentic.js +88 -0
- package/dist/bpmn/optimize/deploy.d.ts +16 -0
- package/dist/bpmn/optimize/deploy.js +143 -0
- package/dist/bpmn/optimize/feel-syntax.d.ts +12 -0
- package/dist/bpmn/optimize/feel-syntax.js +87 -0
- package/dist/bpmn/optimize/feel.js +7 -4
- package/dist/bpmn/optimize/flow.js +22 -2
- package/dist/bpmn/optimize/index.js +20 -9
- package/dist/bpmn/optimize/patterns.js +23 -16
- package/dist/bpmn/optimize/tasks.js +30 -7
- package/dist/bpmn/optimize/types.d.ts +10 -1
- package/dist/bpmn/optimize/utils.js +2 -4
- package/dist/bpmn/optimize/variable-flow.js +58 -67
- package/dist/bpmn/semantic-hash.d.ts +93 -0
- package/dist/bpmn/semantic-hash.js +155 -0
- package/dist/bpmn/sha256.d.ts +17 -0
- package/dist/bpmn/sha256.js +95 -0
- package/dist/bpmn/zeebe-extensions.d.ts +83 -0
- package/dist/bpmn/zeebe-extensions.js +117 -0
- package/dist/bpmn/zeebe-placement.d.ts +12 -0
- package/dist/bpmn/zeebe-placement.js +140 -0
- package/dist/errors.d.ts +40 -1
- package/dist/errors.js +41 -0
- package/dist/index.d.ts +16 -5
- package/dist/index.js +9 -3
- package/dist/layout/annotations.js +36 -1
- package/dist/layout/collaboration/alignment.d.ts +26 -0
- package/dist/layout/collaboration/alignment.js +66 -0
- package/dist/layout/collaboration/ordering.d.ts +21 -0
- package/dist/layout/collaboration/ordering.js +102 -0
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/layout-engine.d.ts +13 -3
- package/dist/layout/layout-engine.js +9 -4
- package/dist/layout/semantic/bands.d.ts +19 -0
- package/dist/layout/semantic/bands.js +324 -0
- package/dist/layout/semantic/graph.d.ts +37 -0
- package/dist/layout/semantic/graph.js +242 -0
- package/dist/layout/semantic/index.d.ts +13 -0
- package/dist/layout/semantic/index.js +181 -0
- package/dist/layout/semantic/place.d.ts +40 -0
- package/dist/layout/semantic/place.js +271 -0
- package/dist/layout/semantic/route.d.ts +14 -0
- package/dist/layout/semantic/route.js +514 -0
- package/dist/layout/types.d.ts +17 -0
- package/dist/node/index.d.ts +10 -0
- package/dist/node/index.js +9 -0
- package/dist/node/write.d.ts +81 -0
- package/dist/node/write.js +167 -0
- package/dist/plan/compile.d.ts +39 -0
- package/dist/plan/compile.js +380 -0
- package/dist/plan/extract.d.ts +31 -0
- package/dist/plan/extract.js +248 -0
- package/dist/plan/index.d.ts +6 -0
- package/dist/plan/index.js +5 -0
- package/dist/plan/merge.d.ts +13 -0
- package/dist/plan/merge.js +80 -0
- package/dist/plan/slug.d.ts +5 -0
- package/dist/plan/slug.js +22 -0
- package/dist/plan/types.d.ts +225 -0
- package/dist/plan/types.js +13 -0
- package/dist/types/id-generator.js +11 -3
- package/dist/xml/index.d.ts +3 -1
- package/dist/xml/index.js +2 -1
- package/dist/xml/xml-parser.d.ts +32 -0
- package/dist/xml/xml-parser.js +394 -143
- package/package.json +9 -2
|
@@ -4,11 +4,15 @@ import type { RestConnectorConfig } from "./rest-connector.js";
|
|
|
4
4
|
export interface ElementOptions {
|
|
5
5
|
name?: string;
|
|
6
6
|
isForCompensation?: boolean;
|
|
7
|
+
/** Free-text documentation (`<bpmn:documentation>`). Used by the AI Agent connector as a tool description. */
|
|
8
|
+
documentation?: string;
|
|
7
9
|
}
|
|
8
10
|
/** Options for send/receive task elements. */
|
|
9
11
|
export interface MessageTaskOptions extends ElementOptions {
|
|
10
12
|
/** Message name — generates or reuses a root <bpmn:message> and sets messageRef. */
|
|
11
13
|
messageName?: string;
|
|
14
|
+
/** FEEL expression correlating this message to a specific process instance (`zeebe:subscription`). */
|
|
15
|
+
correlationKey?: string;
|
|
12
16
|
}
|
|
13
17
|
/** Options for creating a start event. */
|
|
14
18
|
export interface StartEventOptions extends ElementOptions {
|
|
@@ -58,6 +62,11 @@ export interface ServiceTaskOptions {
|
|
|
58
62
|
};
|
|
59
63
|
/** Task header key-value pairs. */
|
|
60
64
|
taskHeaders?: Record<string, string>;
|
|
65
|
+
/** Zeebe property key-value pairs (`zeebe:properties`/`zeebe:property`). */
|
|
66
|
+
zeebeProperties?: Array<{
|
|
67
|
+
name: string;
|
|
68
|
+
value: string;
|
|
69
|
+
}>;
|
|
61
70
|
/** Zeebe modeler template ID. */
|
|
62
71
|
modelerTemplate?: string;
|
|
63
72
|
/** Zeebe modeler template version. */
|
|
@@ -66,6 +75,8 @@ export interface ServiceTaskOptions {
|
|
|
66
75
|
modelerTemplateIcon?: string;
|
|
67
76
|
/** Mark this task as a compensation handler. */
|
|
68
77
|
isForCompensation?: boolean;
|
|
78
|
+
/** Free-text documentation (`<bpmn:documentation>`). Used by the AI Agent connector as a tool description. */
|
|
79
|
+
documentation?: string;
|
|
69
80
|
}
|
|
70
81
|
/** Options for creating a script task. */
|
|
71
82
|
export interface ScriptTaskOptions {
|
|
@@ -77,6 +88,8 @@ export interface ScriptTaskOptions {
|
|
|
77
88
|
resultVariable: string;
|
|
78
89
|
/** Mark this task as a compensation handler. */
|
|
79
90
|
isForCompensation?: boolean;
|
|
91
|
+
/** Free-text documentation (`<bpmn:documentation>`). */
|
|
92
|
+
documentation?: string;
|
|
80
93
|
}
|
|
81
94
|
/** Options for creating a user task. */
|
|
82
95
|
export interface UserTaskOptions {
|
|
@@ -88,6 +101,20 @@ export interface UserTaskOptions {
|
|
|
88
101
|
zeebeUserTask?: boolean;
|
|
89
102
|
/** Mark this task as a compensation handler. */
|
|
90
103
|
isForCompensation?: boolean;
|
|
104
|
+
/** Free-text documentation (`<bpmn:documentation>`). */
|
|
105
|
+
documentation?: string;
|
|
106
|
+
/** Static assignee (`zeebe:assignmentDefinition assignee`). FEEL expressions must start with "=". */
|
|
107
|
+
assignee?: string;
|
|
108
|
+
/** Candidate groups, comma-separated or a FEEL expression (`zeebe:assignmentDefinition candidateGroups`). */
|
|
109
|
+
candidateGroups?: string;
|
|
110
|
+
/** Candidate users, comma-separated or a FEEL expression (`zeebe:assignmentDefinition candidateUsers`). */
|
|
111
|
+
candidateUsers?: string;
|
|
112
|
+
/** Due date — ISO 8601 or FEEL expression (`zeebe:taskSchedule dueDate`). */
|
|
113
|
+
dueDate?: string;
|
|
114
|
+
/** Follow-up date — ISO 8601 or FEEL expression (`zeebe:taskSchedule followUpDate`). */
|
|
115
|
+
followUpDate?: string;
|
|
116
|
+
/** Task priority 0-100, default 50 (`zeebe:priorityDefinition`). */
|
|
117
|
+
priority?: number;
|
|
91
118
|
}
|
|
92
119
|
/** Options for creating a call activity. */
|
|
93
120
|
export interface CallActivityOptions {
|
|
@@ -99,6 +126,8 @@ export interface CallActivityOptions {
|
|
|
99
126
|
propagateAllChildVariables?: boolean;
|
|
100
127
|
/** Mark this activity as a compensation handler. */
|
|
101
128
|
isForCompensation?: boolean;
|
|
129
|
+
/** Free-text documentation (`<bpmn:documentation>`). */
|
|
130
|
+
documentation?: string;
|
|
102
131
|
}
|
|
103
132
|
/** Options for creating a business rule task. */
|
|
104
133
|
export interface BusinessRuleTaskOptions {
|
|
@@ -112,12 +141,60 @@ export interface BusinessRuleTaskOptions {
|
|
|
112
141
|
resultVariable?: string;
|
|
113
142
|
/** Mark this task as a compensation handler. */
|
|
114
143
|
isForCompensation?: boolean;
|
|
144
|
+
/** Free-text documentation (`<bpmn:documentation>`). */
|
|
145
|
+
documentation?: string;
|
|
115
146
|
}
|
|
116
147
|
/** Options for gateway elements. */
|
|
117
148
|
export interface GatewayOptions extends ElementOptions {
|
|
118
149
|
/** ID of the default sequence flow (set manually; prefer branch().defaultFlow()). */
|
|
119
150
|
defaultFlow?: string;
|
|
120
151
|
}
|
|
152
|
+
/** Options for {@link ProcessBuilder.build}. */
|
|
153
|
+
export interface BuildOptions {
|
|
154
|
+
/**
|
|
155
|
+
* Refuse to infer join gateways, so converging branches must be declared.
|
|
156
|
+
*
|
|
157
|
+
* Generated code should set this: the builder's inference is a help to someone
|
|
158
|
+
* reading the chain they just wrote, and a silent topology change to a model
|
|
159
|
+
* that cannot see what it did not emit.
|
|
160
|
+
*/
|
|
161
|
+
explicitJoins?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* The former name for {@link BuildOptions.explicitJoins}, still honoured.
|
|
164
|
+
*
|
|
165
|
+
* Renamed because "strict" says nothing about what it is strict *about*, and
|
|
166
|
+
* because `applyBpmnOperations` takes a `strict` that means something else
|
|
167
|
+
* entirely — whether to throw or report problems.
|
|
168
|
+
*
|
|
169
|
+
* @deprecated Use `explicitJoins`.
|
|
170
|
+
*/
|
|
171
|
+
strict?: boolean;
|
|
172
|
+
}
|
|
173
|
+
/** Options for a collaboration participant (a pool). */
|
|
174
|
+
export interface ParticipantOptions {
|
|
175
|
+
/** Pool label. */
|
|
176
|
+
name?: string;
|
|
177
|
+
/** Id of the process this pool executes. Omit for a black box. */
|
|
178
|
+
processId?: string;
|
|
179
|
+
}
|
|
180
|
+
/** Options for a root-level message declared on a diagram. */
|
|
181
|
+
export interface DiagramMessageOptions {
|
|
182
|
+
/** Message name, which is what Camunda 8 publishes against. */
|
|
183
|
+
name?: string;
|
|
184
|
+
/** FEEL expression Camunda 8 correlates published messages on (`zeebe:subscription`). */
|
|
185
|
+
correlationKey?: string;
|
|
186
|
+
}
|
|
187
|
+
/** Options for a message flow between two pools. */
|
|
188
|
+
export interface MessageFlowOptions {
|
|
189
|
+
/** Id of the participant, or of a flow node inside one, the message leaves. */
|
|
190
|
+
source: string;
|
|
191
|
+
/** Id of the participant, or of a flow node inside one, the message reaches. */
|
|
192
|
+
target: string;
|
|
193
|
+
/** Flow label. */
|
|
194
|
+
name?: string;
|
|
195
|
+
/** Id of a message declared with `.message()`. */
|
|
196
|
+
messageRef?: string;
|
|
197
|
+
}
|
|
121
198
|
/** Options for an intermediate catch event. */
|
|
122
199
|
export interface IntermediateCatchEventOptions extends ElementOptions {
|
|
123
200
|
/** Timer duration (ISO 8601) — creates a timer catch event. */
|
|
@@ -128,6 +205,8 @@ export interface IntermediateCatchEventOptions extends ElementOptions {
|
|
|
128
205
|
timerCycle?: string;
|
|
129
206
|
/** Message name — creates a message catch event (aspirational). */
|
|
130
207
|
messageName?: string;
|
|
208
|
+
/** FEEL expression correlating this message to a specific process instance (`zeebe:subscription`). Required for a deployable message catch when `messageName` is set. */
|
|
209
|
+
correlationKey?: string;
|
|
131
210
|
/** Signal name — creates a signal catch event (aspirational). */
|
|
132
211
|
signalName?: string;
|
|
133
212
|
}
|
|
@@ -175,6 +254,8 @@ export interface BoundaryEventOptions extends ElementOptions {
|
|
|
175
254
|
timerCycle?: string;
|
|
176
255
|
/** Message name — creates a message boundary event (aspirational). */
|
|
177
256
|
messageName?: string;
|
|
257
|
+
/** FEEL expression correlating this message to a specific process instance (`zeebe:subscription`). Required for a deployable message boundary event when `messageName` is set. */
|
|
258
|
+
correlationKey?: string;
|
|
178
259
|
/** Signal name — creates a signal boundary event (aspirational). */
|
|
179
260
|
signalName?: string;
|
|
180
261
|
/** Creates a compensation boundary event. */
|
|
@@ -217,6 +298,11 @@ export interface AdHocSubProcessOptions extends ElementOptions {
|
|
|
217
298
|
};
|
|
218
299
|
/** Task header key-value pairs. */
|
|
219
300
|
taskHeaders?: Record<string, string>;
|
|
301
|
+
/** Zeebe property key-value pairs (`zeebe:properties`/`zeebe:property`). */
|
|
302
|
+
zeebeProperties?: Array<{
|
|
303
|
+
name: string;
|
|
304
|
+
value: string;
|
|
305
|
+
}>;
|
|
220
306
|
/** Multi-instance loop configuration. */
|
|
221
307
|
loopCharacteristics?: {
|
|
222
308
|
inputCollection: string;
|
|
@@ -231,6 +317,13 @@ export interface AdHocSubProcessOptions extends ElementOptions {
|
|
|
231
317
|
modelerTemplateVersion?: string;
|
|
232
318
|
/** Zeebe modeler template icon (data URI). */
|
|
233
319
|
modelerTemplateIcon?: string;
|
|
320
|
+
/**
|
|
321
|
+
* FEEL expression evaluated after each tool activity completes; ends the
|
|
322
|
+
* ad-hoc scope when true (`bpmn:completionCondition`).
|
|
323
|
+
*/
|
|
324
|
+
completionCondition?: string;
|
|
325
|
+
/** Whether still-running inner activity instances are cancelled once the completion condition is met (default true). */
|
|
326
|
+
cancelRemainingInstances?: boolean;
|
|
234
327
|
}
|
|
235
328
|
/**
|
|
236
329
|
* Builder for a single named branch path from a gateway.
|
|
@@ -241,6 +334,8 @@ export interface AdHocSubProcessOptions extends ElementOptions {
|
|
|
241
334
|
export declare class BranchBuilder {
|
|
242
335
|
/** @internal */
|
|
243
336
|
readonly _elements: BpmnFlowElement[];
|
|
337
|
+
/** Ids in `_elements`, for O(1) duplicate checks. */
|
|
338
|
+
private readonly _ids;
|
|
244
339
|
/** @internal */
|
|
245
340
|
readonly _flows: BpmnSequenceFlow[];
|
|
246
341
|
/** @internal */
|
|
@@ -340,6 +435,8 @@ export declare class BranchBuilder {
|
|
|
340
435
|
export declare class SubProcessContentBuilder {
|
|
341
436
|
/** @internal */
|
|
342
437
|
readonly _elements: BpmnFlowElement[];
|
|
438
|
+
/** Ids in `_elements`, for O(1) duplicate checks. */
|
|
439
|
+
private readonly _ids;
|
|
343
440
|
/** @internal */
|
|
344
441
|
readonly _flows: BpmnSequenceFlow[];
|
|
345
442
|
/** @internal */
|
|
@@ -354,6 +451,15 @@ export declare class SubProcessContentBuilder {
|
|
|
354
451
|
/** @internal */
|
|
355
452
|
constructor(rootMessages?: BpmnMessage[]);
|
|
356
453
|
private addElement;
|
|
454
|
+
/**
|
|
455
|
+
* Add an element with no sequence-flow wiring and no cursor movement.
|
|
456
|
+
*
|
|
457
|
+
* Used for ad-hoc sub-process tool activities, which the AI Agent connector
|
|
458
|
+
* requires to be root nodes (no incoming sequence flow, not a boundary event).
|
|
459
|
+
* Unlike `serviceTask()`/`userTask()`/etc., this does not auto-connect from
|
|
460
|
+
* the current cursor and does not move it.
|
|
461
|
+
*/
|
|
462
|
+
addDisconnected(element: BpmnFlowElement): this;
|
|
357
463
|
startEvent(id?: string, options?: StartEventOptions): this;
|
|
358
464
|
endEvent(id?: string, options?: EndEventOptions): this;
|
|
359
465
|
intermediateThrowEvent(id?: string, options?: IntermediateThrowEventOptions): this;
|
|
@@ -408,8 +514,12 @@ export declare class ProcessBuilder {
|
|
|
408
514
|
private readonly processId;
|
|
409
515
|
private processName?;
|
|
410
516
|
private _isExecutable;
|
|
517
|
+
/** Whether `executable()` was called, so continue-mode leaves it alone if not. */
|
|
518
|
+
private _executableSet;
|
|
411
519
|
private _versionTag?;
|
|
412
520
|
private readonly flowElements;
|
|
521
|
+
/** Ids in `flowElements`, for O(1) duplicate and existence checks. */
|
|
522
|
+
private readonly elementIds;
|
|
413
523
|
private readonly sequenceFlows;
|
|
414
524
|
private readonly rootErrors;
|
|
415
525
|
private readonly rootMessages;
|
|
@@ -425,7 +535,69 @@ export declare class ProcessBuilder {
|
|
|
425
535
|
private _executionPlatformVersion;
|
|
426
536
|
private _serviceTaskDefaults;
|
|
427
537
|
private _savedMainFlowId;
|
|
538
|
+
/** Set by {@link ProcessBuilder.from}; makes `build()` update rather than generate. */
|
|
539
|
+
private _source?;
|
|
540
|
+
/** Pre-existing flow endpoints, so `build()` can prove it did not rewire them. */
|
|
541
|
+
private _sourceFlowTargets;
|
|
542
|
+
/** An `insertAfter` flow waiting to be reattached to what gets built next. */
|
|
543
|
+
private _pendingSpliceFlowId;
|
|
544
|
+
/** Flows the caller deliberately spliced, exempt from the rewiring guard. */
|
|
545
|
+
private readonly _splicedFlowIds;
|
|
428
546
|
constructor(processId: string);
|
|
547
|
+
/**
|
|
548
|
+
* Continues an existing model rather than generating a new one.
|
|
549
|
+
*
|
|
550
|
+
* `build()` then returns *that document* with this process's contents
|
|
551
|
+
* replaced, so everything the builder has no opinion about — other processes,
|
|
552
|
+
* the collaboration, lanes, diagram interchange, root elements, imports,
|
|
553
|
+
* unmodelled content — is still there afterwards. Generating a replacement
|
|
554
|
+
* from scratch is what loses those.
|
|
555
|
+
*
|
|
556
|
+
* The input is not mutated; the builder works on a copy.
|
|
557
|
+
*
|
|
558
|
+
* @param definitions - The parsed model to continue.
|
|
559
|
+
* @param processId - Which process to continue. Named explicitly, because
|
|
560
|
+
* "the first process" is a guess that goes wrong on a collaboration.
|
|
561
|
+
* @example
|
|
562
|
+
* ```typescript
|
|
563
|
+
* const updated = ProcessBuilder.from(Bpmn.parse(xml), "order")
|
|
564
|
+
* .at("validate")
|
|
565
|
+
* .serviceTask("notify", { name: "Notify", taskType: "notify" })
|
|
566
|
+
* .build()
|
|
567
|
+
* ```
|
|
568
|
+
*/
|
|
569
|
+
static from(definitions: BpmnDefinitions, processId: string): ProcessBuilder;
|
|
570
|
+
/**
|
|
571
|
+
* Moves the cursor to an existing flow node, so the next call chains from it.
|
|
572
|
+
*
|
|
573
|
+
* @param nodeId - A flow node directly contained by this process. Nodes inside
|
|
574
|
+
* a sub-process are not reachable: continuing into one means building that
|
|
575
|
+
* sub-process, not this one.
|
|
576
|
+
*/
|
|
577
|
+
at(nodeId: string): this;
|
|
578
|
+
/**
|
|
579
|
+
* Splices what you build next into the path leaving an existing node.
|
|
580
|
+
*
|
|
581
|
+
* `insertAfter("validate")` followed by `.serviceTask("notify", …)` turns
|
|
582
|
+
* `validate → end` into `validate → notify → end`. The existing flow keeps its
|
|
583
|
+
* id and its target and only changes where it starts, so an edge nobody asked
|
|
584
|
+
* to move keeps its identity in the diagram and in a diff.
|
|
585
|
+
*
|
|
586
|
+
* This is the counterpart to {@link at}, which continues from a node whose
|
|
587
|
+
* path is open. Which one you mean is not guessable, so it is not guessed.
|
|
588
|
+
*
|
|
589
|
+
* @param nodeId - A flow node with exactly one outgoing sequence flow.
|
|
590
|
+
*/
|
|
591
|
+
insertAfter(nodeId: string): this;
|
|
592
|
+
/** Points the cursor at an existing node and forgets any branch state. */
|
|
593
|
+
private moveCursor;
|
|
594
|
+
/**
|
|
595
|
+
* Reattaches the flow a pending `insertAfter` detached, to whatever the cursor
|
|
596
|
+
* has reached. With nothing built in between the cursor has not moved and this
|
|
597
|
+
* is a no-op, which is the right answer for `insertAfter(x)` followed by
|
|
598
|
+
* nothing.
|
|
599
|
+
*/
|
|
600
|
+
private resolvePendingSplice;
|
|
429
601
|
/** Enable auto-layout: `build()` will run the layout engine and populate diagram interchange data. */
|
|
430
602
|
withAutoLayout(): this;
|
|
431
603
|
/** Set the Camunda execution platform version stamped into the BPMN definitions. Defaults to `"8.9.0"`. */
|
|
@@ -548,10 +720,50 @@ export declare class ProcessBuilder {
|
|
|
548
720
|
*
|
|
549
721
|
* Resolves all forward-referenced `incoming` / `outgoing` arrays and wraps
|
|
550
722
|
* the process in a {@link BpmnDefinitions} ready for XML serialization.
|
|
723
|
+
*
|
|
724
|
+
* **The join contract.** Branches built with `.branch()` converge implicitly:
|
|
725
|
+
* where several paths from one gateway reach the same element, a matching join
|
|
726
|
+
* gateway is inserted for you. That is convenient by hand and a trap for
|
|
727
|
+
* generated code, which cannot see the element it did not write. Pass
|
|
728
|
+
* `{ explicitJoins: true }` to be told instead of helped — the build throws,
|
|
729
|
+
* naming the gateways it would have inserted, and you declare them yourself
|
|
730
|
+
* with `.connectTo(joinId)`.
|
|
731
|
+
*
|
|
732
|
+
* A join you declare only counts if it *matches the split*: an exclusive split
|
|
733
|
+
* converging on a parallel gateway is not the gateway inference would have
|
|
734
|
+
* added, so it is still inferred — and with `explicitJoins` that refusal is the
|
|
735
|
+
* only thing that tells you.
|
|
736
|
+
*
|
|
737
|
+
* {@link ProcessBuilder.from} never infers joins at all, whatever this option
|
|
738
|
+
* says: inference reads the whole topology, and on a document you were handed
|
|
739
|
+
* that means rewriting edges you never touched.
|
|
740
|
+
*
|
|
741
|
+
* @param options - `explicitJoins` refuses inferred join gateways. `strict` is
|
|
742
|
+
* the former name for it and still works.
|
|
743
|
+
*/
|
|
744
|
+
build(options?: BuildOptions): BpmnDefinitions;
|
|
745
|
+
/**
|
|
746
|
+
* Writes this process's contents back into the document it came from.
|
|
747
|
+
*
|
|
748
|
+
* Everything not listed here is kept by identity — other processes, the
|
|
749
|
+
* collaboration, diagram interchange, root elements, the process's own lanes,
|
|
750
|
+
* documentation, extensions and unmodelled content. That is the whole point of
|
|
751
|
+
* continuing rather than regenerating.
|
|
752
|
+
*
|
|
753
|
+
* Diagram interchange is *not* regenerated: existing shapes keep their
|
|
754
|
+
* positions, and elements added here have none until `withAutoLayout()` or a
|
|
755
|
+
* later `applyAutoLayout()` gives them one.
|
|
756
|
+
*/
|
|
757
|
+
private buildOntoSource;
|
|
758
|
+
/**
|
|
759
|
+
* Refuses to rewire a flow that was already in the document.
|
|
760
|
+
*
|
|
761
|
+
* `insertJoinGateways` retargets converging flows, which is right for a
|
|
762
|
+
* topology this builder just created and wrong for one it was handed: a
|
|
763
|
+
* document would come back with edges the caller never touched pointing
|
|
764
|
+
* somewhere else. Continuing a model has to leave the model alone.
|
|
551
765
|
*/
|
|
552
|
-
|
|
553
|
-
strict?: boolean;
|
|
554
|
-
}): BpmnDefinitions;
|
|
766
|
+
private assertSourceTopologyIntact;
|
|
555
767
|
private validate;
|
|
556
768
|
private addFlowElement;
|
|
557
769
|
}
|
|
@@ -564,11 +776,61 @@ export declare class DiagramBuilder {
|
|
|
564
776
|
private readonly _processes;
|
|
565
777
|
private readonly _errors;
|
|
566
778
|
private readonly _messages;
|
|
779
|
+
private readonly _participants;
|
|
780
|
+
private readonly _messageFlows;
|
|
781
|
+
private _collaborationId;
|
|
567
782
|
private _executionPlatformVersion;
|
|
568
783
|
constructor(id: string);
|
|
569
784
|
/** Set the Camunda execution platform version stamped into the BPMN definitions. Defaults to `"8.9.0"`. */
|
|
570
785
|
executionPlatformVersion(version: string): this;
|
|
571
786
|
process(id: string, callback: (b: ProcessBuilder) => void): this;
|
|
787
|
+
/** Renames the collaboration element. Defaults to `"Collaboration_1"`. */
|
|
788
|
+
collaborationId(id: string): this;
|
|
789
|
+
/**
|
|
790
|
+
* Adds a pool.
|
|
791
|
+
*
|
|
792
|
+
* Omit `processId` for a black box — a participant whose internals are not
|
|
793
|
+
* modelled. That is a real BPMN construct, not an incomplete one: it is how
|
|
794
|
+
* you draw the counterparty you exchange messages with but do not execute.
|
|
795
|
+
*
|
|
796
|
+
* @param id - The participant's element id, used verbatim.
|
|
797
|
+
*/
|
|
798
|
+
participant(id: string, options?: ParticipantOptions): this;
|
|
799
|
+
/**
|
|
800
|
+
* Declares a root-level message, which a message flow may name and a Camunda 8
|
|
801
|
+
* message subscription correlates on.
|
|
802
|
+
*
|
|
803
|
+
* `ProcessBuilder` already creates messages by name for message events, so
|
|
804
|
+
* only call this for a message no event declared — typically one carried by a
|
|
805
|
+
* message flow between pools.
|
|
806
|
+
*
|
|
807
|
+
* @param id - The message's element id, used verbatim.
|
|
808
|
+
*/
|
|
809
|
+
message(id: string, options?: DiagramMessageOptions): this;
|
|
810
|
+
/**
|
|
811
|
+
* Connects two pools.
|
|
812
|
+
*
|
|
813
|
+
* `source` and `target` name either participants or flow nodes inside them.
|
|
814
|
+
* Both forms are valid BPMN and the layout engine reads either, but they must
|
|
815
|
+
* be in *different* pools — a message flow is what crosses a pool boundary,
|
|
816
|
+
* and one that does not is the error this catches.
|
|
817
|
+
*
|
|
818
|
+
* @param id - The message flow's element id, used verbatim.
|
|
819
|
+
*/
|
|
820
|
+
messageFlow(id: string, options: MessageFlowOptions): this;
|
|
821
|
+
/**
|
|
822
|
+
* Reports every way the declared collaboration would not survive contact with
|
|
823
|
+
* a modeler, so `build()` can refuse rather than emit a file that opens broken.
|
|
824
|
+
*/
|
|
825
|
+
private collaborationProblems;
|
|
826
|
+
/** Maps every participant id and every flow node id to its owning participant. */
|
|
827
|
+
private participantIndex;
|
|
572
828
|
build(): BpmnDefinitions;
|
|
829
|
+
/**
|
|
830
|
+
* A document with no participants has no collaboration — an empty
|
|
831
|
+
* `<bpmn:collaboration/>` is not a neutral addition, it makes every process a
|
|
832
|
+
* pool-less participant in a modeler.
|
|
833
|
+
*/
|
|
834
|
+
private buildCollaborations;
|
|
573
835
|
}
|
|
574
836
|
//# sourceMappingURL=bpmn-builder.d.ts.map
|