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.
2 replies Latest Post - ‏2013-01-11T10:19:07Z by SystemAdmin
1305 Posts

Pinned topic Statechart inside a function

‏2013-01-07T08:30:11Z |
Hi all,

i have a primitive function which implements a statechart. That means, the states of this statechart are checked and appropriate transitions will take place only after this function has been called.

is there any way to add a statechart diagram in a function? or is there a way such that i can draw a statechart anywhere and then associate it with this function so that the statechart is implemented only when the function is called?

NOTE: when i generate the code, the statechart implementation code must be inside the function body.

Thanks in advance!
Updated on 2013-01-11T10:19:07Z at 2013-01-11T10:19:07Z by SystemAdmin
  • pathfinder_hartmut
    49 Posts

    Re: Statechart inside a function

    ‏2013-01-09T13:08:42Z  in response to SystemAdmin
    Hi RJadhay,

    as far as I know, you can't do that to a statechart. But you can use a Flowchart instead (depending on the language you're using. For C and C++ it should work) Property {Lang}_CG.Operation.ImplementFlowchart must be checked in order to generate the operation body from the flowchart.
    Note, that flowcharts implementing operation need a termination action, and don't support reception of events.

    Regards, Hartmut
    • SystemAdmin
      1305 Posts

      Re: Statechart inside a function

      ‏2013-01-11T10:19:07Z  in response to pathfinder_hartmut
      Thanks Harmut.
      But flowchart will be quite tedious for any 3rd person reading it. Moreover it will be plainly implemented as an if-else sequence.
      I want a statechart because it would be easier for my colleagues to understand and also implemented as a faste switch case.


      Is there any way of atleast "calling" a statechart/statemachine from a function?