IBM Support

Rhapsody model experiences runtime exception on call to getOutBound.

Question & Answer


Question

Rhapsody model experiences runtime exception on call to getOutBound.

Answer

Scenario:
I have a model with two classes, "A" and "B", with an object for each class. The two classes have ports, which are connected via a link.
"A" sends a message to "B" through a port, for example:
 
OPORT(pName)->foo();
 
"A's" port contains a required interface and "B" provides the same interface.
 
Problems:
When running the application on my target (VxWorks), t he application crashes on the call to getOutBound(); "OutBound" has no address to return.
The port class owns an "OutBound" instance, which inherits from the required interface and holds a pointer to it.
 
When running the application on my Windows environment:
The message is not received by class "B"
 
Solution:
The problem is caused by the fact that the link between the ports has not been initialized properly. The OUT_PORT macro calls
"getOutBound()" on the port, which returns the a pointer to the OutBound instance.
It is necessary for the setIts operation to be called prior to using the OUT_PORT macro. This initializer is generated automatically
when a link is specified between the contracted ports.
 
Ensure that the initRelations() operation is generated for the link (it is generated for the class or package that "owns" the link).
Check that initRelations() correctly initializes the link and that the initialization is performed prior to the usage of the port.
1592 AnswerProduct versionPartner ContentInternal ContentCategoryReference ID

[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Historical Number

10522

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21323781