IBM Support

How to send a value over SysML 1.2 Flow ports in IBM Rational Rhapsody

Question & Answer


Question

How do you send a value over SysML 1.2 Flow ports in IBM Rational Rhapsody?

Cause

You are unsure of the correct procedure for using SysML 1.2 Flow ports and their limitations.
You also require a simple example project to demonstrate these points.

Answer


Requirements:

  • Both blocks need to have an attribute of the same name and type e.g. an Integer attribute called "Arg"
  • Both blocks need a flow port of the same name and type of above attribute. For example, Arg:int.
  • There must be a connector between the two flow ports.


Constraints/Limitations:
  • Note: Bidirectional flow ports are not supported. You would need to model an attribute and flow port pair for each direction between the two blocks.
  • Source code for the Flow port connection is successfully generated when you see a special mutator method SetValue and a separate interface class <type>FlowInterface added to your source code.


  • To send your value to the other block/part using the flow port, you use the default mutator method for the attribute. Rhapsody adds a macroFLOW_DATA_SEND to the mutator that routes the new value to SetValue automatically.

Sending the value

In this example a statechart is created for each block/part which constantly output the value of their respective attributes. This way we can monitor the value of the attribute in both blocks/parts as the value is changed. The "Statechart of part_0_Class" below shows a transition calling the setArg() mutator method.

[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"8.0;8.0.1;8.0.2;8.0.3;8.0.4;8.0.5;8.0.6;8.1;8.1.1;8.1.2;8.1.2.1;8.1.3;8.1.4;8.1.5","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21993065