Book a Demo

Author Topic: Code Gen. for Composite States has Wrong Target  (Read 2913 times)

pmueller

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Code Gen. for Composite States has Wrong Target
« on: June 29, 2010, 08:55:30 am »
I am modifying the  code generation templates. However, I noticed what seems like a flaw.

Scenario:
I have a composite state machine (state chart) with an inner state. In the inner state, I have a final pseudo state.

The transition to the final pseudostate has the target as Final and this is shown in the Transition Properties dialog. But the template macros return that the target is the outer state, not the Final pseudostate.  The transition template snippet is below:

Code: [Select]
$Target           = %EASL_GET("Property", $GUID, "Target")%
$sTargetName = %StateEnumeratedName($Target)%

Is this the correct behavior?
I'm using EA 7.5.849

Nizam Mohamed

  • EA User
  • **
  • Posts: 193
  • Karma: +1/-0
    • View Profile
Re: Code Gen. for Composite States has Wrong Targe
« Reply #1 on: June 29, 2010, 12:28:36 pm »


In a submachine state, a transition to final state is internally elicited to its parent state , to facilitate executing the parent state's behaviors,(eg: state5's transition), similar to how a transition to a submachine state's initial(pseudo state) is transfered to the actual initial state(state4 in the diagram)
Code: [Select]
private void stateMachine_State2_State5(CommandType command)
{...nextState = StateType.StateMachine_State2}

private void stateMachine_State1(CommandType command)
{...nextState = StateType.StateMachine_State2_State4;}

whereas a transition to final state elsewhere will be rendered as is(eg: state3's transition)
Code: [Select]
private void stateMachine_State3(CommandType command)
{...nextState = StateType.ST_NOSTATE/*Final State*/;}