package Ġorg . s ug gs . fsm . behavior Ċ Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġorg . s ug gs . fsm . behavior . builders . Behavior Builder . Companion . a Behavior Called Ċ import Ġorg . s ug gs . fsm . behavior . builders . Event Builder . Companion . an Event Called Ċ import Ġorg . s ug gs . fsm . behavior . builders . Region Builder . Companion . a Region Called Ċ import Ġorg . s ug gs . fsm . behavior . builders . StateMachine Builder . Companion . a StateMachine Called Ċ import Ġorg . s ug gs . fsm . behavior . builders . Transition Builder . Companion . a Transition Called Ċ import Ġorg . s ug gs . fsm . behavior . builders . Vertex Builder . Companion . a Composite State Called Ċ import Ġorg . s ug gs . fsm . behavior . builders . Vertex Builder . Companion . a Final State Ċ import Ġorg . s ug gs . fsm . behavior . builders . Vertex Builder . Companion . a Simple State Called Ċ import Ġorg . s ug gs . fsm . behavior . builders . Vertex Builder . Companion . an Initial Pseudo State Ċ Ċ object ĠF sm Pro totypes Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġlog Ġ= ĠLoggerFactory . getLogger ( this :: class . java ) ĊĊĠĠĠ Ġfun Ġf sm With Entry And Exit Be haviors Prototype () Ġ= ĊĠĠĠĠĠĠĠ Ġa StateMachine Called (" context "). with Region ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġa Region Called (" region 0 ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Vertices ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġan Initial Pseudo State (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Simple State Called (" state 1 ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Entry Behavior ( a Behavior Called (" do Logging Entry Action () "). with Action Ġ{ Ġlog . debug (" entry Ġaction Ġfor Ġ$ it ") Ġ}) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Exit Behavior ( a Behavior Called (" do Logging Exit Action () "). with Action Ġ{ Ġlog . debug (" exit Ġaction Ġfor Ġ$ it ") Ġ}), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Simple State Called (" state 2 "), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Simple State Called (" state 3 ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Transitions ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Transition Called (" region 0 _ trans 1 "). starting At InitialState (). ending At (" state 1 "). triggered By ( an Event Called (" e 1 ")), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Transition Called (" region 0 _ trans 2 "). starting At (" state 1 "). ending At (" state 2 "). triggered By ( an Event Called (" internal Even _ trigger 1 ")), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Transition Called (" region 0 _ trans 3 "). starting At (" state 1 "). ending At (" state 3 "). triggered By ( an Event Called (" internal Even _ trigger 2 ")) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġfun Ġnested State StateMachine Prototype () Ġ= ĊĠĠĠĠĠĠĠ Ġa StateMachine Called (" context "). with Region ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġa Region Called (" region 0 ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Vertices ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġan Initial Pseudo State (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Simple State Called (" state 1 "), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Simple State Called (" state 2 "), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Composite State Called (" state 3 "). with Region ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Region Called (" region 1 "). with Vertices ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġan Initial Pseudo State (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Simple State Called (" state 1 "), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Simple State Called (" state 2 ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Transitions ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Transition Called (" trans 1 "). starting At InitialState (). ending At (" state 1 "), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Transition Called (" trans 2 "). starting At (" state 1 "). ending At (" state 1 "). triggered By ( an Event Called (" New ĠData ")), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Transition Called (" trans 3 "). starting At (" state 1 "). ending At (" state 2 "). triggered By ( an Event Called (" en ough ")) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Final State () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Transitions ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Transition Called (" trans 1 "). starting At InitialState (). ending At (" state 1 "), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Transition Called (" trans 2 "). starting At (" state 1 "). ending At (" state 2 "). triggered By ( an Event Called (" succeeded ")), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Transition Called (" trans 3 "). starting At (" state 1 "). ending At Final State (). triggered By ( an Event Called (" abort ed ")), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Transition Called (" trans 4 "). starting At (" state 2 "). ending At Final State (). triggered By ( an Event Called (" abort ed ")), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Transition Called (" trans 5 "). starting At (" state 2 "). ending At (" state 3 "). triggered By ( an Event Called (" succeeded ")), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Transition Called (" trans 6 "). starting At (" state 3 "). ending At Final State (). triggered By ( an Event Called (" succeeded ")), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Transition Called (" trans 7 "). starting At (" state 3 "). ending At Final State (). triggered By ( an Event Called (" abort ed ")), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġa Transition Called (" trans 8 "). starting At (" state 3 "). ending At (" state 3 "). triggered By ( an Event Called (" failed ")) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġ) ĊĊ Ċ }