Skip to content

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 #checkout

Multiple 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) Suffix

Added at the end of an on line to mark public/external events:

flow
on :checkout from @customer (api)
  // Externally accessible

Guard Logic

AND Logic (multiple ?)

flow
? condition1
? condition2
  // Runs only if BOTH true

OR Logic (??)

flow
? condition1
?? condition2
  // Runs if EITHER true

Combined

flow
? conditionA
? conditionB
?? conditionC
  // Runs if (A AND B) OR C

Default Case

flow
? condition1
  handle case 1
? condition2
  handle case 2
otherwise
  handle default

// Or with empty ?
? condition
  handle condition
?
  handle else

Released under the MIT License.