Skip to content

Event

Event

An Event models a reactive signal raised and handled within the collaborative state machine to trigger state transitions and exchange data payload.

Events are matched based on their unique identifier (topic) and propagate across defined channels. An event may optionally encapsulate data payload gathered via expressions at the time it is raised.

Events fall into three distinct categories based on their propagation scope:

  • Internal: Handled exclusively by the state machine that raised them and hidden from other state machines.
  • External: Distributed to other state machines that have explicitly subscribed to the raising state machine's events, facilitating decentralized coordination.
  • Peripheral: Generated by the external environment outside the collaborative state machine boundary.

When a state machine processes an event and executes a transition, the encapsulated event data variables become accessible within the local execution context.

new Event {
  topic = "e1"
  channel = "external"
  data = new Context { ... }
}

Properties

Property Type Multiplicity Description
topic String Required The topic identifier used for routing and matching events.
channel Channel Required The propagation scope of the raised event.
data Context Optional The data payload transmitted to the receiving context.

topic

The topic property specifies the identifier used to match and route the event to target transitions.

Event topics may be re-used across different scopes and state machines.

Name Validity

Topic name validity and structural constraints are implementation-specific.

channel

The channel property defines the propagation boundary and visibility of the raised event.

The channel must be one of the following string enumeration values:

  • internal
  • external
  • peripheral

Constraint: Valid Channel Value

The channel property must strictly specify a valid value from the defined string enumeration.

data

The data property encapsulates the payload transmitted to the receiving state machine during a transition.

Upon processing the event, variables enclosed within the event data payload are exposed to expressions evaluated during the transition and any subsequently executed actions.

To distinguish event payload data from standard context variables, event data variables must be explicitly prefixed with a $ character within expressions.

Lifecycle: Event Data Validity

The lifetime of event data variables is strictly bound to the immediate transition triggered by the event and its associated actions.