Symbol Reference
Complete reference for all symbols used in EventFlow.
Symbol Quick Reference
| Symbol | Position | Element | Example |
|---|---|---|---|
| (none) | - | Action (default) | order moves to #paid |
? | line prefix | Guard | ? cart is valid |
?? | line prefix | Guard (OR) | ?? user is admin |
= | line prefix | Assertion | = order is in #processing |
> | after on | API Event | on> :checkout from @customer |
@ | inline | Actor | @customer |
: | inline | Event | :checkout |
# | inline | State | #processing |
$ | inline | Context | $total |
Line Prefixes
Line prefixes indicate what the line does.
No Prefix (Action)
Lines without prefix are actions - the default line type:
flow
order moves to #paid
emit :notification to @customer
$total increases by 100
send confirmation email? (Guard)
Condition that must be true for indented actions:
flow
? cart is not empty
order moves to #checkoutMultiple guards are AND:
flow
? cart is not empty
? user is logged in
order moves to #checkout?? (OR Guard)
Alternative condition - any one passing is enough:
flow
? user is admin
?? user has override permission
allow action= (Assertion)
Verification statement in expect: blocks:
flow
expect:
= order is in #paid
= $total equals 1200> (API Event)
After on to mark public/external events:
flow
on> :checkout from @customer
// Externally accessibleInline Symbols
Inline symbols indicate references within a line.
@ (Actor)
Reference to a machine/actor:
flow
machine: @order
on> :checkout from @customer
emit :request to @payment: (Event)
Reference to an event:
flow
on> :checkout from @customer
emit :payment_request to @payment
on :payment_success from @payment# (State)
Reference to a machine state:
flow
order moves to #pending
? order is in #paid
order transitions to #completed$ (Context Variable)
Reference to context data:
flow
$total becomes 100
$items adds "Laptop"
? $total > 0With type annotation:
flow
$total: number becomes 100
$items: array adds "Laptop"Case Rules
| Element | Case | Example |
|---|---|---|
| Keywords | lowercase | machine:, scenario:, expect: |
| Actors | lowercase | @customer, @admin |
| States | lowercase | #checkout, #processing |
| Events | lowercase | :checkout, :payment_request |
| Context | lowercase | $total, $items |
| Types | lowercase | string, number, array |
| String literals | as-is | "Proceed to Checkout" |
Type Annotations
Optional types for context variables:
| Type | Description | Example |
|---|---|---|
string | Text values | $name: string becomes "John" |
number | Integers and decimals | $total: number becomes 100 |
boolean | True/false | $active: boolean becomes true |
array | List of items | $items: array becomes empty |
object | Key-value pairs | $config: object becomes empty |
Comparison Operators
Used in guards and assertions:
| Operator | Meaning | Example |
|---|---|---|
equals / is | Equal to | ? $total equals 100 |
is not | Not equal to | ? $status is not "cancelled" |
is greater than | > | ? $total is greater than 100 |
is less than | < | ? $count is less than 5 |
is at least | >= | ? $age is at least 18 |
is at most | <= | ? $items is at most 10 |
contains | Has element | ? $items contains "Laptop" |
is empty | Empty collection | ? $cart is empty |
is not empty | Has elements | ? $items is not empty |
State Transition Verbs
All equivalent - use what reads best:
| Verb | Example |
|---|---|
moves to | order moves to #paid |
transitions to | order transitions to #approved |
enters | payment enters #processing |
becomes | ticket becomes #closed |
changes to | status changes to #active |
Guard Logic
AND Logic (multiple ?)
flow
? condition1
? condition2
// Runs only if BOTH trueOR Logic (??)
flow
? condition1
?? condition2
// Runs if EITHER trueCombined
flow
? conditionA
? conditionB
?? conditionC
// Runs if (A AND B) OR CDefault Case
flow
? condition1
handle case 1
? condition2
handle case 2
otherwise
handle default
// Or with empty ?
? condition
handle condition
?
handle else