Login Form






Lost Password?
No account yet? Register
Home arrow Forums
ECharts
Welcome, Guest
question about a common pattern seen (0 viewing) 
Go to bottom Post Reply Favoured: 0
TOPIC: question about a common pattern seen
#458
Eric Cheung (Admin)
Admin
Posts: 24
graphgraph
User Offline Click here to see the profile of this user
question about a common pattern seen 3 Months ago  
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(...);    CALL2B2buaSafeFSM(...);    transition CALL1.CANCELLEDCALL2.CANCELLED ] --> ...    transition CALL1.FAILURECALL2.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?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#459
Tom Smith (Admin)
Admin
Posts: 72
graphgraph
User Online Now Click here to see the profile of this user
Re:question about a common pattern seen 3 Months ago  
I think it's a good idea to remove the states for the reason you state. A parent machine can refer to the TERMINAL pseudostate as an exact synonym for END or DONE in the examples above. This will break existing applications that may explicitly refer to those states, but the TERMINAL reference is more robust usage anyway.
 
Report to moderator   Logged Logged  
 
Last Edit: 2010/06/10 03:57 By yotommy. Reason: add more commentary
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop
Copyright © 2006-2009 echarts.org