Diagram - BPMN Events

Author event positions, attached boundaries, composite definitions, Link pairs and compensation relationships.

#Usage

Use a selected event profile that permits a Timer trigger.

Choose an event by its position and trigger, then check its scope. A Timer catch, a Message Start and a compensation boundary have different legal relationships.

Use the BPMN setup with the module installed in the store. Keep the matching semantic root and copied inspector under Diagram.Root. The examples below include their complete model and controls.

#Compare event positions

Loading Demo...

Select each event in Entity or on the canvas, then use the copied inspector. Catch markers are outlined; throw markers are filled. Timer/conditions/references are descriptive values, with no waiting or execution.

#Attach a boundary event

Loading Demo...

Choose a Side and Offset, then Place attachment. Offset is normalized from 0 to 1 along that side. Rotate host rotates Fulfill order and its attached boundary; the boundary remains attached rather than becoming an independent child position. Side/Offset controls reposition it through attachment policy. Independent ordinary drag is rejected because its geometry belongs to the host; host move/resize/collapse keeps the relationship. Timer is non-interrupting here and can originate a normal handler flow.

editor.attach(id, activityId, trigger, interrupting = true) creates a boundary 32 world units wide with initial bottom side/0.75 offset. Compensation forces interrupting: false. placeAttachment(id, side, offset) changes placement. Boundary data names the host in attachedToId, and actual parentId/attachment must agree. Hosts are tasks, calls or non-event subprocesses. Error and Cancel always interrupt; Cancel requires a transaction subprocess. None, Terminate and Link are excluded as boundaries.

#Handle an event subprocess

Loading Demo...

The Alert handler has one non-interrupting Signal Start and an internal Notify task. The outer event subprocess does not accept sequence flow; its inner flow has the subprocess scope. Collapse retains children and shows the actual Start marker. A missing Start warns, multiple Starts reject. Event Starts require explicit interrupting; Error is always interrupting and Compensation is non-interrupting. They permit Message, Timer, Signal, Conditional, Error, Escalation, Compensation, Multiple and Parallel Multiple. Ordinary/transaction subprocess Starts are None; ad-hoc scopes exclude Start and End.

#Define composite events

Loading Demo...

Select Arrival or deadline for Multiple, Approved and paid for Parallel Multiple. Edit the explicit constituents in the inspector. Missing definitions/details warn; an invalid constituent set rejects. Multiple represents any-of catching or all-results throwing; Parallel Multiple represents all-of catching.

definitions is omitted for unfinished composite authoring or contains 2–8 distinct local IDs. Message/Signal/Error/Escalation use optional nonblank reference ≤256; Timer/Conditional use optional nonblank expression ≤2048. IDs use the record-ID syntax and are unique within that event. Different definitions may share a kind.

ContextPermitted constituent kinds
Top-level Start or intermediate catchMessage, Timer, Signal, Conditional
Boundary or event-subprocess StartAbove plus Escalation; Error only in interrupting Multiple
Intermediate throw or EndMessage, Signal, Escalation

Parallel Multiple excludes Error and throwing. Compensation, Link, Cancel and Terminate are never composite constituents. Definitions on a non-composite trigger reject. Composite events have no explicit Message Flow endpoint in this profile.

Loading Demo...

The throw explicitly targets the catch. Duplicate pair remaps both ends and their shared unique name. Try throw alone rejects because its required catch is absent. Links stay in one process/scope. A catch has link: { name }, a throw link: { name, targetId }; nonblank name ≤256. One catch per name/scope, multiple throws allowed. No implicit same-name lookup creates a target. Missing identity or unused catches warn. Throws receive sequence but cannot originate it; catches originate sequence but cannot receive it. Repair/clear references before renaming, removing or retyping a referenced catch.

#Model compensation

Loading Demo...

The non-interrupting compensation boundary owns Refund through a one-way association. Refund has isForCompensation: true; Try sequence into handler rejects. Each ordinary non-compensation host has at most one compensation boundary, each boundary has at most one handler, and each handler has one boundary owner in this profile. Unconnected handlers/boundaries warn. Annotation associations are separate.

Compensation intermediate/End throws use optional compensation: { activityId, waitForCompletion }. Omitted activity targets the visible scope; omitted wait defaults true. An explicit target is an ordinary activity in the same scope, or the parent scope of a Compensation Event Subprocess. Missing handler coverage warns. Compensation Starts are exclusive to event subprocesses, require interrupting: false and have no throw target properties. No reversal executes.

#Event reference

PositionTriggers
Top-level startnone, message, timer, signal, conditional, multiple, parallelMultiple
intermediateCatchmessage, timer, signal, conditional, link, multiple, parallelMultiple
intermediateThrownone, message, signal, escalation, compensation, link, multiple
endnone, message, signal, terminate, error, escalation, cancel, compensation, multiple; Cancel directly inside transaction scope only
boundarymessage, timer, signal, conditional, error, escalation, cancel, compensation, multiple, parallelMultiple; host/interruption rules above

BPMN_EVENT_TRIGGERS supplies position choices; BPMN_BOUNDARY_TRIGGERS supplies boundary choices. Event interrupting is accepted only for Start, with event-subprocess scope rules above. The copied inspector exposes eventPosition, eventTrigger, toggleInterrupting, boundaryTrigger, placeBoundary, addDefinition, removeDefinition, clearDefinitions, definitionDetail, definitionText, linkProperties, clearLink, compensationTarget and associateHandler. Changing a trigger reconciles incompatible properties; failed relationships are atomic. All updates share store history and current editing policy.