Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 346322

Summary: A transition point at the top level state generates code that not runs
Product: [Modeling] eTrice Reporter: Thomas Jung <tj>
Component: GeneratorsAssignee: Project Inbox <etrice.generators-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: hrr
Version: 0.1.0Flags: hrr: indigo+
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: 0.1.0
Attachments:
Description Flags
buggy model none

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