[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.modeling.mdt.uml2.uml] Re: Problem creating sequence diagrams using UML2.1 API

Hi Praveen,
 
As Kenn pointed out in a subsequent posting, you might not be using the UML2.1 api.  There have been many changes to sequence diagrams between the two versions so it is important that we are talking about the same thing (several of the metaclasses have been renamed etc. ) .   Have a look at the migration document for some of the changes.  
 
Neither ExecutionOccurrenceSpecification's nor MessageOccurrenceSpecifications are created automatically so you would have to create these as you need them.   Neither are compulsory in a sequence diagram but I would expect to see them in a typical sequence diagram.
 
Cheers,
 
- James.
 
 
 
 
 
Hi,
 
I am trying to create sequence diagrams programmatically 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.