Skip to content

πŸ› Custom text notation used to describe, visualize and prototype nested state machines

Notifications You must be signed in to change notification settings

schalkventer/phasi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸ› Phasi

A custom text notation used to describe and prototype nested state machines

Basic Example

We can create a basic statemachine to describes the phases that a butterfly enters during its life as follows.

---
Organism
---

egg
  grow
  hatch >> caterpillar

caterpillar
  eat
  crawl
  cocoon >> butterfly

butterfly
  fly
  mate >> egg

The basic syntax can be described as follows:

  • The value between the --- lines provides a name for the machine
  • All lines with no whitespace at the front describe phases (in this case egg, caterpillar and butterfly)
  • Any indented line (with whitespace at the front) describe an action nested inside a phase.
  • Any actions that have >> at the end indicates that the action causes a transition to a new phase (the name of the target phase after the >>)
  • Actions that do not have >> do not trigger transitions, but usually causes some side-effect outside the statemachine itself.

You can view the Basic Example Demo to see this in action. Remember to open the panes on the right-hand side (since they are closed by default) and click on an action in the current phase to transition.

About

πŸ› Custom text notation used to describe, visualize and prototype nested state machines

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages