| [news.eclipse.modeling.mdt.uml2.uml] Problem creating sequence diagrams using UML2.1 API |
|
Hi,
I am trying to create sequence
diagrams programatically using the UML2.1 API. I am attaching sample code that I have used so far.
I am not sure, how to add
messages and fragments to the lifeline variables. Are the respective execution
occurences created automatically or do I need to create them? Are execution
occurences compulsory in a sequence diagram?
Collaboration colab =
UML2Factory.eINSTANCE.createCollaboration();
Interaction it = UML2Factory.eINSTANCE.createInteraction(); Interaction intrc = (Interaction) collab.createOwnedBehavior(it.eClass()); intrc.setName("Sequence Diagram")); Lifeline lifel =
intrc.createLifeline();
lifel.setName("L1"); Lifeline life2 =
intrc.createLifeline();
life2.setName("L2"); Thanks
Praveen.
|