File: librarybookstate.pystate

package info (click to toggle)
pyparsing 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,888 kB
  • sloc: python: 25,293; ansic: 422; makefile: 22
file content (19 lines) | stat: -rw-r--r-- 542 bytes parent folder | download | duplicates (3)
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