1 reply Latest Post - ‏2012-04-15T12:01:38Z by EhudH
1 Post

Pinned topic Code generation from ACTIVITY DIAGRAM

‏2012-04-03T06:22:52Z |
Hi all, I would like to know if code can be generated from activity diagram.

This question is bugging me because, at class level either one can have STATECHART or ACTIVITY DIAGRAM. Statechars can produce code; can one say the same about activity diagram.

If someone has any relevant answers. Kindly give some examples.

Harshul mittal
Updated on 2012-04-15T12:01:38Z at 2012-04-15T12:01:38Z by EhudH
  • EhudH
    6 Posts

    Re: Code generation from ACTIVITY DIAGRAM

    ‏2012-04-15T12:01:38Z  in response to harshul.mittal
    Yes. It is possible to generate code and execute Activity diagrams using Rhapsody.
    Rhapsody can generate and execute both "state-semantics" Activities and "token-semantics" Activities.

    Are you looking to simulate system-level processes? or do you need it for a production-level code? something else?
    For systems, we usually recommend the token semantics, while the state-semantics might be more suitable for software production ..

    Look for the Property "SimulationMode".
    "StateOriented" mode will cause Rhapsody to interpret the Activity according to State semantics (this is the older "style").
    For "StateOriented" CG and execution, make sure it is not marked as "Analysis only" on the Activity Features Dialog (otherwise, the diagrams are merely drawings, and lose the CG relevancy).
    "TokenOriented" mode will generate the code according to Token semantics (the new "style", since Rhapsody 7.5.3).
    Currently, Token Activities requires instrumentation to be set to "animation", in order to get code out of it.

    Please see the samples "ActivityDiagramSimulation" ("Quickfood") and "Tollroad" for Token Activity examples.
    Please refer to the documentation regarding "Activities" and "Token Activities" for more information.