@bpmnkit/core 0.3.0 → 0.4.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.
@@ -388,6 +388,8 @@ export declare class BranchBuilder {
388
388
  receiveTask(id: string, options?: MessageTaskOptions): this;
389
389
  businessRuleTask(id: string, options?: BusinessRuleTaskOptions): this;
390
390
  callActivity(id: string, options: CallActivityOptions): this;
391
+ /** Add a manual task — work performed outside the engine, with no job worker. */
392
+ manualTask(id: string, options?: ElementOptions): this;
391
393
  /** Add an abstract task with no Zeebe extensions. */
392
394
  task(id: string, options?: ElementOptions): this;
393
395
  startEvent(id?: string, options?: StartEventOptions): this;
@@ -398,6 +400,7 @@ export declare class BranchBuilder {
398
400
  parallelGateway(id: string, options?: ElementOptions): this;
399
401
  inclusiveGateway(id: string, options?: GatewayOptions): this;
400
402
  eventBasedGateway(id: string, options?: ElementOptions): this;
403
+ complexGateway(id: string, options?: GatewayOptions): this;
401
404
  /**
402
405
  * Add a boundary event attached to an existing activity in this branch.
403
406
  *
@@ -418,6 +421,8 @@ export declare class BranchBuilder {
418
421
  withBoundary(id: string, options: Omit<BoundaryEventOptions, "attachedTo">, handler: (b: BranchBuilder) => void): this;
419
422
  /** Add a sub-process (mirrors `ProcessBuilder.subProcess`). */
420
423
  subProcess(id: string, content: (b: SubProcessContentBuilder) => void, options?: SubProcessOptions): this;
424
+ /** Add a transaction sub-process (mirrors `ProcessBuilder.transaction`). */
425
+ transaction(id: string, content: (b: SubProcessContentBuilder) => void, options?: SubProcessOptions): this;
421
426
  /** Add an ad-hoc sub-process (mirrors `ProcessBuilder.adHocSubProcess`). */
422
427
  adHocSubProcess(id: string, content: (b: SubProcessContentBuilder) => void, options?: AdHocSubProcessOptions): this;
423
428
  /** Add an event sub-process. Triggered by its start event — no incoming or outgoing sequence flows. */
@@ -471,12 +476,15 @@ export declare class SubProcessContentBuilder {
471
476
  callActivity(id: string, options: CallActivityOptions): this;
472
477
  sendTask(id: string, options?: MessageTaskOptions): this;
473
478
  receiveTask(id: string, options?: MessageTaskOptions): this;
479
+ /** Add a manual task — work performed outside the engine, with no job worker. */
480
+ manualTask(id: string, options?: ElementOptions): this;
474
481
  /** Add an abstract task with no Zeebe extensions. */
475
482
  task(id: string, options?: ElementOptions): this;
476
483
  exclusiveGateway(id: string, options?: GatewayOptions): this;
477
484
  parallelGateway(id: string, options?: ElementOptions): this;
478
485
  inclusiveGateway(id: string, options?: GatewayOptions): this;
479
486
  eventBasedGateway(id: string, options?: ElementOptions): this;
487
+ complexGateway(id: string, options?: GatewayOptions): this;
480
488
  /** Attach a text annotation to the element at the current cursor position. */
481
489
  textAnnotation(text: string): this;
482
490
  /** Attach a text annotation to an element by explicit ID. */
@@ -504,6 +512,8 @@ export declare class SubProcessContentBuilder {
504
512
  withBoundary(id: string, options: Omit<BoundaryEventOptions, "attachedTo">, handler: (b: SubProcessContentBuilder) => void): this;
505
513
  /** Add a sub-process nested inside this sub-process's content. */
506
514
  subProcess(id: string, content: (b: SubProcessContentBuilder) => void, options?: SubProcessOptions): this;
515
+ /** Add a transaction sub-process nested inside this sub-process's content. */
516
+ transaction(id: string, content: (b: SubProcessContentBuilder) => void, options?: SubProcessOptions): this;
507
517
  /** Add an ad-hoc sub-process nested inside this sub-process's content. */
508
518
  adHocSubProcess(id: string, content: (b: SubProcessContentBuilder) => void, options?: AdHocSubProcessOptions): this;
509
519
  /** Add an event sub-process. Triggered by its start event — no incoming or outgoing sequence flows. */
@@ -614,6 +624,61 @@ export declare class ProcessBuilder {
614
624
  executable(value: boolean): this;
615
625
  /** Set the process version tag. */
616
626
  versionTag(tag: string): this;
627
+ /**
628
+ * Declares the root `bpmn:message` for a message name, with the id you choose.
629
+ *
630
+ * Events name messages by name — `{ messageName: "Order Received" }` — and the
631
+ * builder declares one on first use, deriving its id from that name. Call this
632
+ * first when the id itself matters, typically because something outside this
633
+ * process already refers to it.
634
+ *
635
+ * @param id - The message's element id, used verbatim.
636
+ * @throws If a message with this name is already declared under another id,
637
+ * which the events built before this call already point at.
638
+ * @example
639
+ * ```typescript
640
+ * Bpmn.createProcess("orders")
641
+ * .message("Msg_OrderReceived", { name: "Order Received" })
642
+ * .startEvent("start", { messageName: "Order Received" })
643
+ * ```
644
+ */
645
+ message(id: string, options: {
646
+ name: string;
647
+ }): this;
648
+ /**
649
+ * Declares the root `bpmn:error` for an error code, with the id you choose.
650
+ *
651
+ * @param id - The error's element id, used verbatim.
652
+ * @param options - The `code` events match on, and the display `name`, which
653
+ * defaults to the code.
654
+ * @throws If this code is already declared under another id.
655
+ */
656
+ error(id: string, options: {
657
+ code: string;
658
+ name?: string;
659
+ }): this;
660
+ /**
661
+ * Declares the root `bpmn:signal` for a signal name, with the id you choose.
662
+ *
663
+ * @param id - The signal's element id, used verbatim.
664
+ * @throws If this name is already declared under another id.
665
+ */
666
+ signal(id: string, options: {
667
+ name: string;
668
+ }): this;
669
+ /**
670
+ * Declares the root `bpmn:escalation` for an escalation code, with the id you
671
+ * choose.
672
+ *
673
+ * @param id - The escalation's element id, used verbatim.
674
+ * @param options - The `code` events match on, and the display `name`, which
675
+ * defaults to the code.
676
+ * @throws If this code is already declared under another id.
677
+ */
678
+ escalation(id: string, options: {
679
+ code: string;
680
+ name?: string;
681
+ }): this;
617
682
  /** Add a start event. Start events never auto-connect from the previous element. */
618
683
  startEvent(id?: string, options?: StartEventOptions): this;
619
684
  /**
@@ -668,6 +733,8 @@ export declare class ProcessBuilder {
668
733
  businessRuleTask(id: string, options?: BusinessRuleTaskOptions): this;
669
734
  /** Add a call activity referencing another process. */
670
735
  callActivity(id: string, options: CallActivityOptions): this;
736
+ /** Add a manual task — work performed outside the engine, with no job worker. */
737
+ manualTask(id: string, options?: ElementOptions): this;
671
738
  /** Add an abstract task with no Zeebe extensions. */
672
739
  task(id: string, options?: ElementOptions): this;
673
740
  /** Add an exclusive gateway (XOR split/join). */
@@ -678,6 +745,8 @@ export declare class ProcessBuilder {
678
745
  inclusiveGateway(id: string, options?: GatewayOptions): this;
679
746
  /** Add an event-based gateway. Aspirational. */
680
747
  eventBasedGateway(id: string, options?: ElementOptions): this;
748
+ /** Add a complex gateway. Aspirational — Zeebe does not execute these. */
749
+ complexGateway(id: string, options?: GatewayOptions): this;
681
750
  /**
682
751
  * Create a named branch from the current gateway.
683
752
  *
@@ -709,6 +778,8 @@ export declare class ProcessBuilder {
709
778
  adHocSubProcess(id: string, content: (b: SubProcessContentBuilder) => void, options?: AdHocSubProcessOptions): this;
710
779
  /** Add a sub-process (aspirational). */
711
780
  subProcess(id: string, content: (b: SubProcessContentBuilder) => void, options?: SubProcessOptions): this;
781
+ /** Add a transaction sub-process — a sub-process with atomic semantics. */
782
+ transaction(id: string, content: (b: SubProcessContentBuilder) => void, options?: SubProcessOptions): this;
712
783
  /** Add an event sub-process. Triggered by its start event — no incoming or outgoing sequence flows. */
713
784
  eventSubProcess(id: string, content: (b: SubProcessContentBuilder) => void, options?: ElementOptions): this;
714
785
  /** Attach a text annotation to the element at the current cursor position. */