Skip to content

Convention Guide

Fahmi Akbar Wildana edited this page May 29, 2019 · 13 revisions

When designing a State Machine, you need to know the purpose. Each State Machine has a slightly different convention.

State Machine for...

Manage users workflow

  • When the element name of the State Machine similar to each other:
    • Rename the state as past tense when it has the same name as event
  • For the event name, the name must answer this question:
    1. What is the event? (Answer: pay)
    2. How to trigger it? (Answer: by clicking the button or hit the enter key)

Manage system processes

  • Always think about how the system can recover from failure
  • Usually, they use self (loop) and backward transition to recover from failure

Creating deterministic A.I

  • use Behaviour Tree (HSFM & Behaviour Tree) or
  • shape it as acyclic graph (no self or backward transition)

Manage resources or data

  • utilize State Management library or
  • rely heavily on invoking/spawning services and calling actions
Clone this wiki locally