Created
March 24, 2014 03:16
-
-
Save mokemokechicken/9733565 to your computer and use it in GitHub Desktop.
SMC Sample: TodoStateMap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%package com.example.fsm.gen | |
%import com.exapmle.fsm.TodoAction | |
%class TodoAction | |
%fsmclass TodoFsm | |
%start TodoStateMap::IDLE | |
%map TodoStateMap | |
%% | |
IDLE | |
{ | |
update UPDATING {} | |
btnDelete CONFIRMING_DELETABLE {} | |
} | |
CONFIRMING_DELETABLE | |
Entry { confirmDeletable(); } | |
Exit { finishComm(); } | |
{ | |
deleteOk SHOWING_DELETE_CONFIRM {} | |
deleteNg SHOWING_CANNOT_DELETE {} | |
} | |
UPDATING | |
Entry { updateModel(); } | |
Exit { finishComm(); } | |
{ | |
finishUpdate IDLE {} | |
} | |
SHOWING_CANNOT_DELETE | |
Entry { showCannotDelete(); } | |
Exit { closeDialog(); } | |
{ | |
btnYes IDLE {} | |
} | |
SHOWING_DELETE_CONFIRM | |
Entry { showDeleteConfirm(); } | |
Exit { closeDialog(); } | |
{ | |
btnYes DELETING {} | |
btnNo IDLE {} | |
} | |
DELETING | |
Entry { deleteModel(); } | |
Exit { finishComm(); } | |
{ | |
finishDeleteOk SHOWING_RESULT_OK {} | |
finishDeleteNg SHOWING_RESULT_NG {} | |
} | |
SHOWING_RESULT_OK | |
Entry { showResultOk(); } | |
Exit { closeDialog(); } | |
{ | |
btnYes UPDATING {} | |
} | |
SHOWING_RESULT_NG | |
Entry { showResultNg(); } | |
Exit { closeDialog(); } | |
{ | |
btnYes IDLE {} | |
} | |
Default { | |
Default nil {} | |
} | |
%% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment