State Machines Pub

On one beautiful summer eve, a guest arrived:

$msg fsm1.init (id="fsm1")

$expect (status=="init")

$msg fsm1.move (id="fsm1", to="1")

$expect (status=="1")

$msg fsm1.move (id="fsm1", to="2")

$expect (status=="2")

$when fsm1.*(id) => ctx.persisted(kind="fsm1", id=id)

$when fsm1.init(id) => (status="init")

$when fsm1.move(to="2") $if (status=="1") => (status=to)

$when fsm1.move => (status=to)


Was this useful?    

By: Razie | 2016-06-27 .. 2019-05-09 | Tags: dsl


Viewed 191 times ( | Print ) this page.

You need to log in to post a comment!

© Copyright DieselApps, 2012-2021, all rights reserved.