import type { Block } from "../declarative.js"; /** Options for `.boundary(...)`: an attached timer SLA on the preceding activity. * - `timer` — the timeout: an ISO-8601 duration (`PT24H`, `P1DT6H`) or a FEEL * `=`-expression (`=escalationSlaTimeout`); the duration need not be a literal. * - `onTimeout` — the escalation body run when the timer elapses. By default its * danglers converge with the activity's normal continuation; with * `fireAndForget: true` the body is capped by an end event instead (see below). * - `interrupting` — whether firing cancels the host activity. Defaults to * `true` (an interrupting boundary; `cancelActivity` omitted, the BPMN default). * Pass `false` for a non-interrupting boundary (`cancelActivity="false"`). * - `fireAndForget` — when `true`, the `onTimeout` escalation body is a * NON-CONVERGING escape path: its danglers terminate in a `` * rather than merging back into the host activity's continuation. This is the * correct model for a non-interrupting reviewer nudge (an SLA side-effect that * ends its own token and must NOT re-enter the reviewed activity). Defaults to * `false` (the converging boundary). Typically paired with * `interrupting: false`. * - `name` — an optional label for the boundary event. */ export interface BoundaryOptions { timer: string; onTimeout: Block; interrupting?: boolean; fireAndForget?: boolean; name?: string; } declare module "../types.js" { interface FlowNodeRegistry { boundary: { kind: "boundary"; /** The derived element id of the activity this boundary attaches to. */ attachedTo: string; /** The timeout — an ISO-8601 duration or a FEEL `=`-expression. */ timer: string; /** Whether firing cancels the host (interrupting). */ interrupting: boolean; /** When true, the escalation body is capped by an end event and does NOT * converge with the host activity's continuation (fire-and-forget). */ fireAndForget: boolean; /** The escalation body wired from the boundary event's outgoing flow. */ onTimeout: FlowNode[]; /** Optional boundary-event label. */ label?: string; }; } } declare module "../declarative.js" { interface FlowBuilder { /** * Attach an interrupting timer boundary event (an SLA) to the PRECEDING * activity (a `run`/`task`). When `timer` elapses, the activity is * cancelled (for an interrupting boundary) and the token routes to the * `onTimeout` escalation body; that body then converges with the activity's * normal continuation. `timer` is an ISO-8601 duration or a FEEL * `=`-expression. Chains as `w.run(...).boundary({ timer, onTimeout })`. * * Pass `fireAndForget: true` for a NON-CONVERGING escape path: the * `onTimeout` body is capped by a `` and contributes no * danglers to the host continuation — the correct model for a * non-interrupting reviewer nudge (typically with `interrupting: false`). */ boundary(opts: BoundaryOptions): FlowBuilder; } }