@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.
Files changed (83) hide show
  1. package/README.md +32 -1
  2. package/dist/bpmn/agentic.d.ts +121 -0
  3. package/dist/bpmn/agentic.js +97 -0
  4. package/dist/bpmn/auto-layout.d.ts +5 -5
  5. package/dist/bpmn/auto-layout.js +592 -36
  6. package/dist/bpmn/bpmn-builder.d.ts +265 -3
  7. package/dist/bpmn/bpmn-builder.js +603 -197
  8. package/dist/bpmn/bpmn-model.d.ts +114 -0
  9. package/dist/bpmn/bpmn-parser.js +1414 -521
  10. package/dist/bpmn/bpmn-serializer.js +107 -19
  11. package/dist/bpmn/compact.d.ts +17 -2
  12. package/dist/bpmn/compact.js +3 -3
  13. package/dist/bpmn/full-operations.d.ts +89 -0
  14. package/dist/bpmn/full-operations.js +478 -0
  15. package/dist/bpmn/index.d.ts +19 -0
  16. package/dist/bpmn/index.js +21 -0
  17. package/dist/bpmn/optimize/agentic.d.ts +10 -0
  18. package/dist/bpmn/optimize/agentic.js +88 -0
  19. package/dist/bpmn/optimize/deploy.d.ts +16 -0
  20. package/dist/bpmn/optimize/deploy.js +143 -0
  21. package/dist/bpmn/optimize/feel-syntax.d.ts +12 -0
  22. package/dist/bpmn/optimize/feel-syntax.js +87 -0
  23. package/dist/bpmn/optimize/feel.js +7 -4
  24. package/dist/bpmn/optimize/flow.js +22 -2
  25. package/dist/bpmn/optimize/index.js +20 -9
  26. package/dist/bpmn/optimize/patterns.js +23 -16
  27. package/dist/bpmn/optimize/tasks.js +30 -7
  28. package/dist/bpmn/optimize/types.d.ts +10 -1
  29. package/dist/bpmn/optimize/utils.js +2 -4
  30. package/dist/bpmn/optimize/variable-flow.js +58 -67
  31. package/dist/bpmn/semantic-hash.d.ts +93 -0
  32. package/dist/bpmn/semantic-hash.js +155 -0
  33. package/dist/bpmn/sha256.d.ts +17 -0
  34. package/dist/bpmn/sha256.js +95 -0
  35. package/dist/bpmn/zeebe-extensions.d.ts +83 -0
  36. package/dist/bpmn/zeebe-extensions.js +117 -0
  37. package/dist/bpmn/zeebe-placement.d.ts +12 -0
  38. package/dist/bpmn/zeebe-placement.js +140 -0
  39. package/dist/errors.d.ts +40 -1
  40. package/dist/errors.js +41 -0
  41. package/dist/index.d.ts +16 -5
  42. package/dist/index.js +9 -3
  43. package/dist/layout/annotations.js +36 -1
  44. package/dist/layout/collaboration/alignment.d.ts +26 -0
  45. package/dist/layout/collaboration/alignment.js +66 -0
  46. package/dist/layout/collaboration/ordering.d.ts +21 -0
  47. package/dist/layout/collaboration/ordering.js +102 -0
  48. package/dist/layout/index.d.ts +1 -0
  49. package/dist/layout/layout-engine.d.ts +13 -3
  50. package/dist/layout/layout-engine.js +9 -4
  51. package/dist/layout/semantic/bands.d.ts +19 -0
  52. package/dist/layout/semantic/bands.js +324 -0
  53. package/dist/layout/semantic/graph.d.ts +37 -0
  54. package/dist/layout/semantic/graph.js +242 -0
  55. package/dist/layout/semantic/index.d.ts +13 -0
  56. package/dist/layout/semantic/index.js +181 -0
  57. package/dist/layout/semantic/place.d.ts +40 -0
  58. package/dist/layout/semantic/place.js +271 -0
  59. package/dist/layout/semantic/route.d.ts +14 -0
  60. package/dist/layout/semantic/route.js +514 -0
  61. package/dist/layout/types.d.ts +17 -0
  62. package/dist/node/index.d.ts +10 -0
  63. package/dist/node/index.js +9 -0
  64. package/dist/node/write.d.ts +81 -0
  65. package/dist/node/write.js +167 -0
  66. package/dist/plan/compile.d.ts +39 -0
  67. package/dist/plan/compile.js +380 -0
  68. package/dist/plan/extract.d.ts +31 -0
  69. package/dist/plan/extract.js +248 -0
  70. package/dist/plan/index.d.ts +6 -0
  71. package/dist/plan/index.js +5 -0
  72. package/dist/plan/merge.d.ts +13 -0
  73. package/dist/plan/merge.js +80 -0
  74. package/dist/plan/slug.d.ts +5 -0
  75. package/dist/plan/slug.js +22 -0
  76. package/dist/plan/types.d.ts +225 -0
  77. package/dist/plan/types.js +13 -0
  78. package/dist/types/id-generator.js +11 -3
  79. package/dist/xml/index.d.ts +3 -1
  80. package/dist/xml/index.js +2 -1
  81. package/dist/xml/xml-parser.d.ts +32 -0
  82. package/dist/xml/xml-parser.js +394 -143
  83. package/package.json +9 -2
@@ -90,7 +90,16 @@ export type BpmnEventDefinition = BpmnTimerEventDefinition | BpmnErrorEventDefin
90
90
  export interface BpmnMultiInstanceLoopCharacteristics {
91
91
  /** When true, iterations run one at a time (sequential). When false or absent, runs in parallel. */
92
92
  isSequential?: boolean;
93
+ /** How many instances to create. Losing this turns a bounded loop into an unbounded one. */
94
+ loopCardinality?: BpmnConditionExpression;
95
+ /** Stops the loop early once it evaluates true. */
96
+ completionCondition?: BpmnConditionExpression;
93
97
  extensionElements: XmlElement[];
98
+ /**
99
+ * Children the SDK does not model, kept verbatim and re-emitted after the
100
+ * modelled ones so a round trip cannot silently discard them.
101
+ */
102
+ unknownChildren?: XmlElement[];
94
103
  }
95
104
  /** A FEEL condition expression on a sequence flow outgoing from a gateway. */
96
105
  export interface BpmnConditionExpression {
@@ -106,6 +115,17 @@ interface BpmnFlowNodeBase {
106
115
  extensionElements: XmlElement[];
107
116
  unknownAttributes: Record<string, string>;
108
117
  isForCompensation?: boolean;
118
+ /** `bpmn:property` children — placeholders data input associations target. */
119
+ properties?: BpmnProperty[];
120
+ /** `bpmn:dataInputAssociation` children. */
121
+ dataInputAssociations?: BpmnDataAssociation[];
122
+ /** `bpmn:dataOutputAssociation` children. */
123
+ dataOutputAssociations?: BpmnDataAssociation[];
124
+ /**
125
+ * Children the SDK does not model, kept verbatim and re-emitted after the
126
+ * modelled ones so a round trip cannot silently discard them.
127
+ */
128
+ unknownChildren?: XmlElement[];
109
129
  }
110
130
  export interface BpmnStartEvent extends BpmnFlowNodeBase {
111
131
  type: "startEvent";
@@ -183,6 +203,10 @@ export interface BpmnReceiveTask extends BpmnFlowNodeBase {
183
203
  export interface BpmnAdHocSubProcess extends BpmnFlowNodeBase {
184
204
  type: "adHocSubProcess";
185
205
  loopCharacteristics?: BpmnMultiInstanceLoopCharacteristics;
206
+ /** FEEL expression evaluated after each tool activity completes; ends the ad-hoc scope when true. */
207
+ completionCondition?: BpmnConditionExpression;
208
+ /** Whether still-running inner activity instances are cancelled once the completion condition is met (default true). */
209
+ cancelRemainingInstances?: boolean;
186
210
  flowElements: BpmnFlowElement[];
187
211
  sequenceFlows: BpmnSequenceFlow[];
188
212
  textAnnotations: BpmnTextAnnotation[];
@@ -274,10 +298,39 @@ export interface BpmnSequenceFlow {
274
298
  extensionElements: XmlElement[];
275
299
  unknownAttributes: Record<string, string>;
276
300
  }
301
+ /**
302
+ * A `bpmn:property` on a flow node. Modellers emit one per data input
303
+ * association as the association's `targetRef` placeholder.
304
+ */
305
+ export interface BpmnProperty {
306
+ id?: string;
307
+ name?: string;
308
+ itemSubjectRef?: string;
309
+ unknownAttributes: Record<string, string>;
310
+ }
311
+ /**
312
+ * A `dataInputAssociation` or `dataOutputAssociation` — the wiring between a
313
+ * flow node and a data object, data store or property.
314
+ */
315
+ export interface BpmnDataAssociation {
316
+ id?: string;
317
+ /** Ids named by `<bpmn:sourceRef>` child elements. */
318
+ sourceRefs: string[];
319
+ /** Id named by the `<bpmn:targetRef>` child element. */
320
+ targetRef?: string;
321
+ unknownAttributes: Record<string, string>;
322
+ /**
323
+ * Children the SDK does not model, kept verbatim and re-emitted after the
324
+ * modelled ones so a round trip cannot silently discard them.
325
+ */
326
+ unknownChildren?: XmlElement[];
327
+ }
277
328
  /** A free-text annotation element attached to the diagram via an association. */
278
329
  export interface BpmnTextAnnotation {
279
330
  id: string;
280
331
  text?: string;
332
+ documentation?: string;
333
+ extensionElements?: XmlElement[];
281
334
  unknownAttributes: Record<string, string>;
282
335
  }
283
336
  /** A directed or undirected link between a flow element and a text annotation. */
@@ -286,6 +339,8 @@ export interface BpmnAssociation {
286
339
  sourceRef: string;
287
340
  targetRef: string;
288
341
  associationDirection?: string;
342
+ documentation?: string;
343
+ extensionElements?: XmlElement[];
289
344
  unknownAttributes: Record<string, string>;
290
345
  }
291
346
  /** A group artifact — a dashed rounded rectangle visually grouping elements. */
@@ -293,6 +348,21 @@ export interface BpmnGroup {
293
348
  id: string;
294
349
  /** Id of the `categoryValue` supplying the group's label, if any. */
295
350
  categoryValueRef?: string;
351
+ documentation?: string;
352
+ extensionElements?: XmlElement[];
353
+ unknownAttributes: Record<string, string>;
354
+ }
355
+ /** A label a {@link BpmnGroup} can point at through `categoryValueRef`. */
356
+ export interface BpmnCategoryValue {
357
+ id: string;
358
+ value?: string;
359
+ unknownAttributes: Record<string, string>;
360
+ }
361
+ /** A root-level container of {@link BpmnCategoryValue}s — the source of group labels. */
362
+ export interface BpmnCategory {
363
+ id?: string;
364
+ name?: string;
365
+ categoryValues: BpmnCategoryValue[];
296
366
  unknownAttributes: Record<string, string>;
297
367
  }
298
368
  /** A swim lane within a pool (organises flow nodes visually). */
@@ -301,12 +371,16 @@ export interface BpmnLane {
301
371
  name?: string;
302
372
  flowNodeRefs: string[];
303
373
  childLaneSet?: BpmnLaneSet;
374
+ documentation?: string;
375
+ extensionElements?: XmlElement[];
304
376
  unknownAttributes: Record<string, string>;
305
377
  }
306
378
  /** Container for lanes within a pool or sub-process. */
307
379
  export interface BpmnLaneSet {
308
380
  id?: string;
381
+ name?: string;
309
382
  lanes: BpmnLane[];
383
+ unknownAttributes?: Record<string, string>;
310
384
  }
311
385
  /**
312
386
  * A BPMN process definition containing flow elements and sequence flows.
@@ -320,6 +394,7 @@ export interface BpmnProcess {
320
394
  id: string;
321
395
  name?: string;
322
396
  isExecutable?: boolean;
397
+ documentation?: string;
323
398
  extensionElements: XmlElement[];
324
399
  flowElements: BpmnFlowElement[];
325
400
  sequenceFlows: BpmnSequenceFlow[];
@@ -328,12 +403,19 @@ export interface BpmnProcess {
328
403
  groups: BpmnGroup[];
329
404
  laneSet?: BpmnLaneSet;
330
405
  unknownAttributes: Record<string, string>;
406
+ /**
407
+ * Children the SDK does not model, kept verbatim and re-emitted after the
408
+ * modelled ones so a round trip cannot silently discard them.
409
+ */
410
+ unknownChildren?: XmlElement[];
331
411
  }
332
412
  /** A participant (pool) in a BPMN collaboration diagram. */
333
413
  export interface BpmnParticipant {
334
414
  id: string;
335
415
  name?: string;
336
416
  processRef?: string;
417
+ documentation?: string;
418
+ extensionElements?: XmlElement[];
337
419
  unknownAttributes: Record<string, string>;
338
420
  }
339
421
  /** A message flow between participants in a collaboration. */
@@ -342,6 +424,10 @@ export interface BpmnMessageFlow {
342
424
  name?: string;
343
425
  sourceRef: string;
344
426
  targetRef: string;
427
+ /** Id of the {@link BpmnMessage} carried by this flow. */
428
+ messageRef?: string;
429
+ documentation?: string;
430
+ extensionElements?: XmlElement[];
345
431
  unknownAttributes: Record<string, string>;
346
432
  }
347
433
  /** A BPMN collaboration element grouping multiple participants and their message flows. */
@@ -354,29 +440,49 @@ export interface BpmnCollaboration {
354
440
  groups: BpmnGroup[];
355
441
  extensionElements: XmlElement[];
356
442
  unknownAttributes: Record<string, string>;
443
+ /**
444
+ * Children the SDK does not model, kept verbatim and re-emitted after the
445
+ * modelled ones so a round trip cannot silently discard them.
446
+ */
447
+ unknownChildren?: XmlElement[];
357
448
  }
358
449
  /** A root-level BPMN error definition referenced by error boundary events. */
359
450
  export interface BpmnError {
360
451
  id: string;
361
452
  name?: string;
362
453
  errorCode?: string;
454
+ documentation?: string;
455
+ extensionElements?: XmlElement[];
456
+ unknownAttributes?: Record<string, string>;
363
457
  }
364
458
  /** A root-level BPMN escalation definition referenced by escalation events. */
365
459
  export interface BpmnEscalation {
366
460
  id: string;
367
461
  name?: string;
368
462
  escalationCode?: string;
463
+ documentation?: string;
464
+ extensionElements?: XmlElement[];
465
+ unknownAttributes?: Record<string, string>;
369
466
  }
370
467
  /** A root-level BPMN message definition referenced by message events. */
371
468
  export interface BpmnMessage {
372
469
  id: string;
373
470
  name?: string;
471
+ documentation?: string;
472
+ /**
473
+ * Carries `zeebe:subscription`, whose `correlationKey` is what Camunda 8
474
+ * correlates published messages on.
475
+ */
476
+ extensionElements?: XmlElement[];
374
477
  unknownAttributes: Record<string, string>;
375
478
  }
376
479
  /** A root-level BPMN signal definition referenced by signal catch/throw events. */
377
480
  export interface BpmnSignal {
378
481
  id: string;
379
482
  name?: string;
483
+ documentation?: string;
484
+ extensionElements?: XmlElement[];
485
+ unknownAttributes?: Record<string, string>;
380
486
  }
381
487
  /** Optional label positioning information for a BPMNDi shape or edge. */
382
488
  export interface BpmnDiLabel {
@@ -436,6 +542,9 @@ export interface BpmnDefinitions {
436
542
  namespaces: Record<string, string>;
437
543
  /** Namespace-qualified attributes not directly modeled */
438
544
  unknownAttributes: Record<string, string>;
545
+ documentation?: string;
546
+ /** Root-level category containers supplying {@link BpmnGroup} labels. */
547
+ categories?: BpmnCategory[];
439
548
  errors: BpmnError[];
440
549
  escalations: BpmnEscalation[];
441
550
  messages: BpmnMessage[];
@@ -443,6 +552,11 @@ export interface BpmnDefinitions {
443
552
  collaborations: BpmnCollaboration[];
444
553
  processes: BpmnProcess[];
445
554
  diagrams: BpmnDiagram[];
555
+ /**
556
+ * Children the SDK does not model, kept verbatim and re-emitted after the
557
+ * modelled ones so a round trip cannot silently discard them.
558
+ */
559
+ unknownChildren?: XmlElement[];
446
560
  }
447
561
  export {};
448
562
  //# sourceMappingURL=bpmn-model.d.ts.map