1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#
# librarybookstate.pystate
#
# This state machine models the state of books in a library.
#
statemachine BookState:
New -(shelve)-> Available
Available -(reserve)-> OnHold
OnHold -(release)-> Available
Available -(checkout)-> CheckedOut
CheckedOut -(checkin)-> Available
# add states for restricted books
New -(restrict)-> Restricted
Available -(restrict)-> Restricted
Restricted -(release)-> Available
Restricted -(checkout)-> CheckedOutRestricted
CheckedOutRestricted -(checkin)-> Restricted
|