[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.modeling.mdt.uml2.uml] Re: UML Interactions via the API

Paul,

I'm sure this topic has already been addressed in the old newsgroup - please 
search in the archives for eclipse.tools.uml2.

Kenn

"Paul Smith" <paul.t.smith@xxxxxxxxx> wrote in message 
news:ef66f8af80d070bf105ab9cbc63e809c$1@xxxxxxxxxxxxxxxxxx
> I'm currently writing some code to interrogate a model that contains an 
> Interaction. That interaction has a series of EventOccurrence and Message 
> elements. It's basically a sequence diagram and I'm trying to generate 
> code from the model that implements the flow of excecution of the sequence 
> diagram.
>
> I'm using the following code to get the Messages of the interaction:
>
> List messages = interaction.getMessages();
>
> for (Iterator messageIterator = messages.iterator(); messageIterator
>                                .hasNext();) {
>    Message message = (Message) messageIterator.next();
>    logger.trace("Message name: " + message.getName());
>    logger.trace("Message sort: " + message.getMessageSort().getName());
>
> This all works but I cannot seem work out a way of determining the 
> sequence of those messages. I tried looking at the GeneralOrderings of the 
> EventOccurrence but the lists are always empty. Does anyone have a way of 
> doing this?