Topic
  • 4 replies
  • Latest Post - ‏2013-02-07T15:08:38Z by SystemAdmin
SystemAdmin
SystemAdmin
1305 Posts

Pinned topic Nested if for transition in statemachine

‏2013-02-06T10:52:40Z |
Hello

I am using Rhapsody in C.

Imagine a statechart with 3 states: state 1, state 2 and state 3.
Assume that I am in state 1.

How can I implement the following scenario? I mean, I dont know where should I write these conditions so that following scenario is satisfied.
Scenario: I enter state 1. Now,

if (condition 1)
{
if (condition 2)
{
myVariable = 10; //set the value of a variable

if (condition 3)
{
goto state 2
}
else
{
goto state 3
}
}
}
Can someone attach a sample project illustrating this?
Updated on 2013-02-07T15:08:38Z at 2013-02-07T15:08:38Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1305 Posts

    Re: Nested if for transition in statemachine

    ‏2013-02-06T10:53:42Z  
    sorry for bad indentation. I could not find a setting here on the forum for proper indentation. Spacing does not work. :-(
  • shanz9903
    shanz9903
    277 Posts

    Re: Nested if for transition in statemachine

    ‏2013-02-07T10:43:28Z  
    sorry for bad indentation. I could not find a setting here on the forum for proper indentation. Spacing does not work. :-(
    Maybe a condition connector?
  • SystemAdmin
    SystemAdmin
    1305 Posts

    Re: Nested if for transition in statemachine

    ‏2013-02-07T15:07:23Z  
    • shanz9903
    • ‏2013-02-07T10:43:28Z
    Maybe a condition connector?
    Thanks shanz9903.

    It worked.
  • SystemAdmin
    SystemAdmin
    1305 Posts

    Re: Nested if for transition in statemachine

    ‏2013-02-07T15:08:38Z  
    • shanz9903
    • ‏2013-02-07T10:43:28Z
    Maybe a condition connector?
    Thanks shanz9903.

    It worked.