Simulation of token-based activities by systems engineers

You can simulate token-based activities for C++ system engineering models.

About this task

You can simulate the following:
  • Actions: Opaque (code), CallOperation, CallBehavior, Accept/SendEvent, TimeoutEvent
  • Controls: Initial, Decision, Merge, Join, Fork, ActivityFinal, FlowFinal
  • Flows: Control, Data
  • Data passage: ObjectNodes, Action Pins, Activity Parameters
    Note: Data can be routed using Control-Nodes. Multiple activities under same Class or UseCase can interact. An Activity under Operation, enables the invocation of another classifier's behavior.

    CallBehavior, which is an Action that triggers another Activity, can only call activities under the same classifier. By using CallOperation, you can trigger an Operation on another classifier. So, if you simulate an Activity under an Operation, the CallOperation to that operation will invoke the Activity on another classifier.

You can use the provided samples in the \Samples\SystemSamples\ directory. For example, you can use the ActivitiesDiagramSimulation model to test the simulation.

Procedure

  1. In Rhapsody® Systems Designer or Developer for C++, open the model you want to simulate.
  2. In the model browser for the project, expand the Components folder, right-click the configuration you want to animate in the Configuration folder to open the Features window.
  3. In the Features window, verify that on Settings tab, in the Instrumentation Mode field, Animation is checked, and click OK.

    Accept Time Event button

  4. Right-click on the Activity, and select Features to set the activity value of property Activity::General::SimulationMode to TokenOriented, and click OK, or override it on a higher level.
    Note: Use the TOKEN to access data on Decision nodes. The Decision nodes do not have pins, so instead use the TOKEN to manipulate the data.
  5. Right-click the configuration you want to animate in the Configuration folder, and select Generate Configuration.
  6. To simulate, generate, build, and run the model, select Simulation > Full Build.
  7. Right-click on the relevant instance, and select Open Instance Activity Diagram. Use the different Go buttons to execute the Activity.
    The following is the explanation of the visualization of the animation.
    • Actions - The action will highlight in:
      • pink when it is “ready” to be invoked
      • olive when it finished its execution
      • turns off when another action has been executed
    • Flows: The color of the flow will highlight in:
      • olive when a token is offered along the flow
      • turns off when the flow’s token has been consumed