Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
4 replies Latest Post - ‏2013-02-07T15:08:38Z by SystemAdmin
SystemAdmin
SystemAdmin
1305 Posts
ACCEPTED ANSWER

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
    ACCEPTED ANSWER

    Re: Nested if for transition in statemachine

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

      Re: Nested if for transition in statemachine

      ‏2013-02-07T10:43:28Z  in response to SystemAdmin
      Maybe a condition connector?
      • SystemAdmin
        SystemAdmin
        1305 Posts
        ACCEPTED ANSWER

        Re: Nested if for transition in statemachine

        ‏2013-02-07T15:07:23Z  in response to shanz9903
        Thanks shanz9903.

        It worked.
      • SystemAdmin
        SystemAdmin
        1305 Posts
        ACCEPTED ANSWER

        Re: Nested if for transition in statemachine

        ‏2013-02-07T15:08:38Z  in response to shanz9903
        Thanks shanz9903.

        It worked.