It is currently Wed Feb 08, 2012 5:12 pm

All times are UTC



Welcome
Welcome to RHAPSODY4YOU

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, respond to polls, upload and download content, and access many other special features. Registration is fast, simple, and absolutely free, so please, register to join our community today.





 Page 1 of 1 [ 8 posts ] 
Author Message
 Post subject: send event via port to part in composite class
PostPosted: Mon Jan 28, 2008 11:09 am 

Joined: Tue Jan 15, 2008 9:02 am
Posts: 10
Hi,

I got a composite class named "Ping", which consists of a subpart named "Pong" (drawn inside the Composite Structure Diagram of Ping).

Both of them have statecharts and a port defined (the ports are connected via a link). All I want to for now is to send events in a particular state of "Ping" via the port to the "Pong" object, which should cause a state transition in the second statechart. (And vice-versa, by sending an event back).

Please see the corresponding diagrams attached below.

Up to now, I was not able to receive the event in the Pong statechart. Can somebody tell me what I'm missing?

P.S.: I've also tried to specify the ports as "Behavior", but that didn't work either


Attachments:
File comment: Composite Structure Diagram of class "Ping", and Statecharts of class "Ping" and "Pong".
PingPongArchitecture_01.JPG
PingPongArchitecture_01.JPG [ 46.51 KiB | Viewed 587 times ]
Offline
 Profile  
 
 Post subject:
PostPosted: Mon Jan 28, 2008 1:38 pm 

Joined: Tue Jan 15, 2008 9:02 am
Posts: 10
forgot to add that I'm using Rhapsody in C (RiC 7.0)


Offline
 Profile  
 
 Post subject:
PostPosted: Wed Jan 30, 2008 11:42 am 

Joined: Sun Sep 02, 2007 1:44 am
Posts: 34
mmmh that is not working... but pong is a part of ping , so why not adressing its part directly ?


Offline
 Profile  
 
 Post subject:
PostPosted: Wed Jan 30, 2008 12:42 pm 

Joined: Tue Jan 15, 2008 9:02 am
Posts: 10
Hi Bob,

I was not used to composite structure diagrams before and therefore was inspired by the last picture on http://de.wikipedia.org/wiki/Konnektor_(UML) - so initially I thought I need ports to be able to communicate with my parts (but when looking precisely at the diagram on that page, it turns out that the part has no port, just a connector).
So if I got it right now, I just need to draw the part inside Ping (with no connector/link at all), and just address the part as usual...

Rgs


Offline
 Profile  
 
 Post subject:
PostPosted: Wed Jan 30, 2008 8:46 pm 

Joined: Tue Jan 15, 2008 9:02 am
Posts: 10
Well...Bob, I tried to model it as to your suggestion - my composite structure diagram of Ping now only consists of the nested class Pong - without any ports or links attached to it.

My events are sent now by RiCGEN(&me->itsPong, event_ping()) - instead of sending it to a port as before. This works perfectly well!

However, the other way round it does not work (itsPong is not aware of its parentClass itsPing). Is there a built-in-mechanism to send events/call operations directly on the parent object? Or am I forced to draw some additional association to be able to reference the parent?

I appreciate your help again!


Offline
 Profile  
 
 Post subject:
PostPosted: Wed Jan 30, 2008 11:06 pm 

Joined: Tue Jan 15, 2008 9:02 am
Posts: 10
Ah, I found that in the features of the part you can specify whether the parent should be known or not ("knows parent as:").

Ticking this box, my PingPong example works now. Maybe someone can confirm, if this is the correct/intended way of referencing the parent?

thx


Offline
 Profile  
 
 Post subject:
PostPosted: Wed Feb 13, 2008 11:31 am 

Joined: Thu Aug 30, 2007 4:31 pm
Posts: 152
Location: Germany
yes
per default the relation to the "child" (call it part instead of child) is directional - with the check box bidirectional

well done !


Offline
 Profile  
 
 Post subject: Re: send event via port to part in composite class
PostPosted: Thu Sep 17, 2009 6:32 pm 

Joined: Mon Sep 14, 2009 6:34 pm
Posts: 3
Just throwing it out there, but i believe if you MUST use ports to send to the "whole" for some reason or another, you could also send events to the port in the "whole' by ticking the "behavioral" box.

I was forced to do this once. I had an external class in another subpackage placed as a "part" of another class in another subpackage. For some reason Rhapsody would always throw errors when compiling stating it couldn't find the "whole" object. Does anyone know what might have been causing this?

Thanks


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:


suspicion-preferred