Robami / pystatecharts

Automatically exported from code.google.com/p/pystatecharts
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

event to non-alive state is not ignored but causes code to blow up #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Build the tictactoe design as presented
2. Change the transition from the done->playstate, to the 
done->wait_for_user_input state on replay event
3. Generate a replay event from the done state

What is the expected output? What do you see instead?
I expect the event to be ignored because the wait_for_input state is not alive 
because playstate is not alive
What happens:  The code blows up at "if not runtime.activestates[self]" under 
the method HierarchicalState in the file states.py

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by r...@haystack.mit.edu on 14 Jul 2011 at 2:00

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
The problem is not there. The problem is a side effect of that transition in a 
different hierarchical state.

If there is a transition from optionState to doneState on gameover event, then 
replay event causes the exception
in the done to playstate transition. This is a different hierarchy and the 
exception is a side-efffect and a surprise!

I removed the transition from optionstate to donestate on gameover event.  
The transition done to wait-for-user on replay event works again without 
raising an exception.

Original comment by r...@haystack.mit.edu on 14 Jul 2011 at 4:17

GoogleCodeExporter commented 8 years ago
I think the larger design issue is that a transition to a state that is not in 
the "from" state's hierarchy generates unrecoverable side-effects. 

Original comment by r...@haystack.mit.edu on 18 Jul 2011 at 12:17