Topic
2 replies Latest Post - ‏2013-01-11T10:19:07Z by SystemAdmin
SystemAdmin
SystemAdmin
1305 Posts
ACCEPTED ANSWER

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
    pathfinder_hartmut
    39 Posts
    ACCEPTED ANSWER

    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
      SystemAdmin
      1305 Posts
      ACCEPTED ANSWER

      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.

      So,

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