-
Notifications
You must be signed in to change notification settings - Fork 0
Iteration 3: State Machine Diagram
gtjarvis edited this page Nov 5, 2020
·
6 revisions
In this page, we will demonstrate the state machine diagram for iteration 3, as well as a description of each transition in the state machine.
For past versions, please see the appendix page State Machine Development Log.
Transition | Description |
---|---|
Starting transition | When an appointment object is created, it is placed in the Booked state. |
cancelAppointment(Date currentDate) [!isOnSameDayAsAppointment(currentDate)]-> FinalState; |
If the appointment is canceled, the state is changed from Booked to FinalState, where it will be deleted. This transition can only occur if the change is not occurring on the day of the appointment. |
updateAppointmentTime (Date newDate ,Time newStartTime, Date currentDate,Time currentTime) [isGoodForTimeUpdate(newDate,newStartTime,currentDate,currentTime) && isBeforeToday(currentDate)] /{doUpdateTime(newDate , newStartTime);}->Booked; |
This updates the appointment time slot, provided the new time slot does not conflict with any existing time slots, vacations, holidays, or business hours, and provided the change is not occurring on the day of the appointment. This transition does not change the state. |
updateAppointmentContent (String action, String optService, Date currentDate,Time currentTime) [isGoodForContentUpdate(action, optService, currentDate,currentTime ) && !isOnSameDayAsAppointment(currentDate) ]/ {doUpdateContent(action, optService);}->Booked; |
This updates the appointment composition, such as which service or combination of services the appointment is booked for. The single service can be changed, or an optional service can be added/removed, provided the new time slot does not conflict with any existing time slots, vacations, holidays, or business hours, and provided the change is not occurring on the day of the appointment. The guard condition also checks if the request is attempting to remove any mandatory service. If it is, then similar to conflicting time cases, the event is blocked. This transition does not change the state. |
startAppointment(Date currentDate, Time currentTime) [hasReachedStartTime(currentDate, currentTime)] -> InProgress; |
This event is triggered when the Owner starts the appointment, provided the current time is past or equal to the appointment's start time. This transition changes the state from Booked to InProgress. |
registeredNoShow()/{incrementNoShow();} -> FinalState; | If the Customer does not arrive for the appointment, the Owner can register that the Customer was a no-show. This transition increments the noShowCount associated to the Customer. This transition changes the state to FinalState, where the appointment will be deleted. |
updateAppointmentContent (String action, String optService, Date currentDate, Time currentTime) [isGoodForContentUpdate(action,optService,currentDate,currentTime)] /{doUpdateContent(action, optService);}-> InProgress; |
This method is the same as the corresponding method above. It implements the same checks as before except it is no longer verifying whether it is occurring on the day of the appointment. |
finishedAppointment() -> FinalState; | When the appointment is completed, the state changes from InProgress to FinalState, where it will be deleted. |