Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346322 - A transition point at the top level state generates code that not runs
Summary: A transition point at the top level state generates code that not runs
Status: CLOSED FIXED
Alias: None
Product: eTrice
Classification: Modeling
Component: Generators (show other bugs)
Version: 0.1.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: 0.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-18 15:24 EDT by Thomas Jung CLA
Modified: 2011-12-16 02:45 EST (History)
1 user (show)

See Also:
hrr: indigo+


Attachments
buggy model (3.75 KB, text/plain)
2011-05-18 15:24 EDT, Thomas Jung CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Jung CLA 2011-05-18 15:24:27 EDT
Created attachment 196040 [details]
buggy model

The attached model has a transition point at the boarder of the top level state. The generated code is clean but but doesn´t run correctly. Execution stops after receiving the message that triggers the transition point transition. I assume a problem with history handling.
Comment 1 Henrik Rentz-Reichert CLA 2011-05-19 12:33:29 EDT
fixed with
49616f380ac30c1e9ef2ca67f9be1e4f548fc63b

@Thomas Jung: please verify!
Comment 2 Thomas Jung CLA 2011-05-20 15:51:16 EDT
(In reply to comment #1)
> fixed with
> 49616f380ac30c1e9ef2ca67f9be1e4f548fc63b
> 
> @Thomas Jung: please verify!

still not working correctly:
 assumed fault:


private int enterHistory(int state, boolean handler) {
       while (true) {
             switch (state) {
                    «FOREACH this.stateMachine.getBaseStateList() AS state-»
                    case «state.getStateId()»:
                           «IF state.hasEntryCode()»if (!handler) «state.getEntryCodeOperationName()»();«ENDIF-»
                           «IF state.isLeaf()-»
                           return «state.getStateId()»;
                           «ELSE-»
                                 «IF !state.subgraph.hasInitTransition()-»
                                        state = history[«state.getStateId()»];
                                 >>>>>>return state;<<<<<<<
                                 «ELSE-»
                                 if (history[«state.getStateId()»]==NO_STATE) {
                                        «LET state.subgraph.getInitTransition() AS initt-»
                                        «IF initt!=null-»
                                               int chain = «this.getChain(initt).getChainId()-»;
                                               int next = executeTransitionChain(chain, null, null);
                                               state = enterHistory(next, false);
                                        «ENDIF-»
                                        «ENDLET-»
                                        state = «state.subgraph.getInitState().getStateId()»;
                               >>>>>>>>>return state;<<<<<<<<<<<
                                 }
                                 else {
                                        state = history[«state.getStateId()»];
                                 }
                                 break;
                                 «ENDIF-»
                           «ENDIF-»
                    «ENDFOREACH-»
                    case STATE_TOP:
                           state = history[STATE_TOP];
                           break;
             }
Comment 3 Henrik Rentz-Reichert CLA 2011-12-16 02:45:57 EST
closed resolved bug