1
General Board / Re: Multiple instances of simple links
« on: February 19, 2010, 03:36:54 am »
Naively, if you have a state machine 'outer' with a nested machine 'inner', inner appears as a single state to outer.
At runtime, outer has a single active state. That is the sum of information to the machine at a given level.
What I assume you are trying to achive is having two identical 'inner' states which have different transitions out of them depending on what transition was used to transition into them.
There is nothing in a state machine (unless you're using the history feature) to record where you came from. So in a simple state machine, you need an extra state to indicate this state of the system.
To model this in UML, model your two different paths through the shared state as two new statemachines, each of which contain a single state - the shared statemachine you are duplicating.
Or you could merge the two paths, and either set a flag or inspect history or whatever, but then you're modelling state as data, which kind-of goes against the point of having a statemachine.
At runtime, outer has a single active state. That is the sum of information to the machine at a given level.
What I assume you are trying to achive is having two identical 'inner' states which have different transitions out of them depending on what transition was used to transition into them.
There is nothing in a state machine (unless you're using the history feature) to record where you came from. So in a simple state machine, you need an extra state to indicate this state of the system.
To model this in UML, model your two different paths through the shared state as two new statemachines, each of which contain a single state - the shared statemachine you are duplicating.
Or you could merge the two paths, and either set a flag or inspect history or whatever, but then you're modelling state as data, which kind-of goes against the point of having a statemachine.