• 3 replies
  • Latest Post - ‏2015-07-08T18:33:50Z by Eraankur
1305 Posts

Pinned topic Port inheritance issue

‏2011-09-16T13:11:08Z |
Hi all,

I'm facing a problem about class generalization in Rhapsody

I try to explain the situation:

Class A with PortA showing InterfaceA as required contract. InterfaceA has got an operation() method.

I draw a sequence diagram showing a client calling operation() on A.

Now I define a new class B with a generalization relation to A. B inheriths PortA from A and defines a new PortB with another interface.

When in a sequence diagram I try to call a method on B, Rhapsody lets me select operation() (in the feature window of the message) but an error popup occurs:
Formal message "operation" now define in "B".

It seems that is not allowed to call a method exposed by an inherited interface. It is correct? There is something I missed?

Thanks for the precious help.

Valerio Del Grande
Updated on 2012-03-21T18:13:40Z at 2012-03-21T18:13:40Z by M2D7_Steve_Lilleyman
  • SystemAdmin
    1305 Posts

    Re: Port inheritance issue


    I don't seem to follow you.
    Since class A only has portA which has a required interface to interface 'I', and interface 'I' has operation 'foo', you can't call directly on class 'A' operation 'foo', since class 'A' doesn't inherit from the interface (it just has an association to it). The only way to call 'foo' is via the port (i.e. OUT_PORT(portA)->foo() ). The same for class 'B'.
    Therefore, i don't understand how you were able to select the opeation in the Sequence Diagram. It seems that you have done something more than what you've described.
  • M2D7_Steve_Lilleyman
    2 Posts

    Re: Port inheritance issue

    I have the same problem in Rhapsody

    I have defined a port with a contract on an actor A which represents a generic role.

    I have created another more specialised actor B which inherits from the general actor A. I have done this to enable multiple inheritance of services from different actors representing different service providers/requirers.

    I can see the inherited ports in the specialised actor B's Features dialog by ticking the 'Show Inherited' checkbox on the Ports tab.

    When I try to realise a message for the specialized actor B on a sequence diagram, I can see the event receptions inherited from the port contract in actor A, in the 'Select Message' option in the right-click menu. However, when I select one of the inherited reception, I get the error message:

    Formal message "<message name>" not declare in ""

    This is I believe the exact same issue. It means I cannot inherit any port contracts, which makes reuse of the service definitions impossible.
  • Eraankur
    1 Post

    Re: Port inheritance issue



    I have used Rhapsody with Qt, I have made Rhapsody library and I'm using it inside Qt as a library. Whenever I need to send events from Qt Ui, I can call functions from the object of a class. But I'm not able to send any events from library to UI. I tried to implement signal and slot mechanism of Qt. I tried to create signal inside Rhapsody but able to achieve the same. Can anybody help in this issue. I want to send a signal whenever I'm recieving an event from other subsytem through port and wants to perform action on Qt UI on the based on same. How can I achieve. Please help.