Esempio n. 1
0
/*
 * Init
 */
func init() {
	sm.RegisterEvent(EventNone, "None")
	sm.RegisterEvent(EventSignIn, "Sign-in")
	sm.RegisterEvent(EventGoOnBreak, "Go on break")
	sm.RegisterEvent(EventSignOut, "Sign-out")
	sm.RegisterEvent(EventMakeAvailable, "Make available")
	sm.RegisterEvent(EventOfferTask, "Offer task")
	sm.RegisterEvent(EventAcceptTask, "Accept task")
	sm.RegisterEvent(EventRejectTask, "Reject task")
	sm.RegisterEvent(EventFinishTask, "Finish task")
	sm.RegisterEvent(EventStartOtherWork, "Start other work")
	sm.RegisterEvent(EventEnqueue, "Enqueue")
	sm.RegisterEvent(EventDequeue, "Dequeue")
	sm.RegisterEvent(EventOffer, "Offer")
	sm.RegisterEvent(EventRequeue, "Requeue")
	sm.RegisterEvent(EventAssign, "Assign")
	sm.RegisterEvent(EventComplete, "Complete")

	sm.RegisterStatus(StatusNone, "None")
	sm.RegisterStatus(StatusSignedOut, "Signed out")
	sm.RegisterStatus(StatusOnBreak, "On break")
	sm.RegisterStatus(StatusWaiting, "Waiting")
	sm.RegisterStatus(StatusOffered, "Offered")
	sm.RegisterStatus(StatusBusy, "Busy")
	sm.RegisterStatus(StatusWrappingUp, "Wrapping up")
	sm.RegisterStatus(StatusCompleted, "Completed")
	sm.RegisterStatus(StatusOtherWork, "Other work")
	sm.RegisterStatus(StatusCreated, "Created")
	sm.RegisterStatus(StatusQueued, "Queued")
	sm.RegisterStatus(StatusAssigned, "Assigned")
}
Esempio n. 2
0
func (s *StateMachineSuite) TestRegisterStatus(c *C) {
	c.Assert(statusLocked.String(), Equals, "Status{?Unknown?}")
	sm.RegisterStatus(statusLocked, "Locked")
	c.Assert(statusLocked.String(), Equals, "Status{Locked}")
}