Firstly if we take this statechart we can see that if I exit and return a state then the default transition will be taken:
A history connector is a way to get the state-chart to remember the state it was in when you exit and return to it when you re-enter. The UML would normally have you drawing it something like this:
The trouble is, this won't work if you want Rhapsody to generate the desirable code, i.e. Rhapsody will still take the default transition if you re-enter the state.
to draw the history connector correctly in Rhapsiody (at least correctly to generate the correct code), you need to a) Draw the default transition to the History Connector, and b) Draw a transition from the history connector to where you want the default transition to go.
This has the effect of initialization the history connector to the default transition.
.. and then remembering the history, the next time you re-enter the state (and the default transition is called upon).
No comments:
Post a Comment
Note: only a member of this blog may post a comment.