It is currently Thu Feb 09, 2012 12:20 am

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 [ 3 posts ] 
Author Message
 Post subject: New messages in Sequence Diagram
PostPosted: Thu Oct 02, 2008 11:46 am 

Joined: Thu Oct 02, 2008 11:40 am
Posts: 11
Hi,
I am creating Sequence Diagram using the Rhapsody API and I am working in C#. I could create "ClassifierRoles" for the classes using AddNewNodeForElement(). I am not able to create Messages. Can anyone share about how to do this?

Thanks,
Karthik.


Offline
 Profile  
 
 Post subject:
PostPosted: Mon Nov 03, 2008 4:43 pm 

Joined: Fri May 23, 2008 7:23 am
Posts: 6
Hello, I don't know if this can solve your problem, but I often use "addNewAggr" on many types of elements. It accepts any Rhapsody metaclass as parameters (including those which are not present in the API since they are just linked to stereotypes in the profiles). The name of the metaclass is the same as in the "Add New" right-clic menu.

PS: Have you tried "IRPCollaboration:
IRPMessage addMessage(IRPInterfaceItem interItem, java.lang.String actualParamList, IRPClassifierRole sender, IRPClassifierRole receiver)
" :?:
in which IRPInterfaceItem interItem is probably the operation that realizes the message.


Offline
 Profile  
 
 Post subject:
PostPosted: Tue Feb 03, 2009 10:01 am 

Joined: Tue Feb 03, 2009 9:55 am
Posts: 1
Hi,

Milhouse is right. You can use IRPCollaboration as follow (with Java API) :


IRPCollaboration myColla;
IRPClassifierRole role1, role2;
IRPInterfaceItem myInterface, myInterface2, myInterface3;
IRPPackage pack = proj.addPackage("TestSequenceDiagramPack");
IRPClass component1 = pack.addClass("Class1");
IRPClass component2 = pack.addClass("Class2");
IRPOperation ope1 =((IRPClassifier)component1).addOperation("send");
IRPOperation ope2 =((IRPClassifier)component1).addOperation("Reply");
IRPOperation ope3 =((IRPClassifier)component1).addOperation("Compute");
myInterface = (IRPInterfaceItem)ope1;
myInterface2 = (IRPInterfaceItem)ope2;
myInterface3 = (IRPInterfaceItem)ope3;
myColla = proj.getNewCollaboration();
role1 = myColla.addClassifierRole("component1", (IRPClassifier)component1);
role2 = myColla.addClassifierRole("component2", (IRPClassifier)component2);

IRPMessage mess = myColla.addMessage(myInterface, null, role1, role2);
IRPMessage mess1 = myColla.addMessage(myInterface3, null, role1, role1);
IRPMessage mess2 = myColla.addMessage(myInterface2, null, role2, role1);

myColla.generateSequence("theSequenceDiagram", pack);


The last instruction "draws" the diagram.


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 3 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:

cron

suspicion-preferred