Hi
In the finite state machine fragments in EChartsSipServlet/machines directory, a fairly common pattern is:
| Code: : |
transition CANCELLED --> END;
transition FAILURE --> END;
|
in B2buaSafeFSM
| Code: : |
transition SUCCESS --> DONE;
transition FAILURE --> DONE;
|
in SendReinviteFSM
I wonder what the rationale for adding the END or DONE state was. It seems it is more useful for the machine to stay in the CANCELLED or FAILURE case, so its parent machine can find out why the machine has reached terminal state.
Normally this is not a problem because the parent machine can simply has a transition from CANCELLED and another from FAILURE. But if this is one of several concurrent machines then it is a bit of a hassle. e.g.
| Code: : |
concurrent {
CALL1 : B2buaSafeFSM(...);
CALL2: B2buaSafeFSM(...);
transition [ CALL1.CANCELLED, CALL2.CANCELLED ] --> ...
transition [ CALL1.FAILURE, CALL2.CANCELLED ] - -> ...
|
These do not work because CALL1 would immediately transition to END after it reaches CANCELLED.
What do you think if we remove the END or DONE states?