Draw on the right, write (Umple) model code on the left. Analyse models and generate code. This tool stores your data in cookies and on a server. I understand. Click to learn about privacy. Download Donate For help: User manual Ask questions Report issue
//The state machine sm makes use //of the unspecified event to reach //specific error states to complete //auto-transitions //If the machine is idle and receives //a non-handled event, the destination //state is error 1, while if the sm was //in state active, the machines reaches //error 2 class AutomatedTellerMachine{ queued sm{ idle { cardInserted -> active; maintain -> maintenance; unspecified -> error1; } maintenance { isMaintained -> idle; } active { entry /{readCard();} exit /{ejectCard();} validating { validated -> selecting; unspecified -> error2; } selecting { select -> processing; } processing { selectAnotherTransiction -> selecting; finish -> printing; } printing { receiptPrinted -> idle; } cancel -> idle; } error1{ ->idle; } error2{ ->validating; } } void readCard() {/*Code would be written here*/} void ejectCard() {/*Code would be written here*/} } // @@@skipcppcompile