[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.uml2] Re: questions about creating sequence diagram

Hi James

I finally resolved this error by myself. I created a SynchCall message but I haven't created a reply message. So when I try to show the interaction in
Rational tool, it generates this error.

Thanks a lot for you help!

- James

James Bruck wrote:
> Hi James,
> 
> What do you mean by "fail to show" ?   Could there be an issue in the code
> used to render your sequence diagram?
> Are there exceptions being thrown from opensource code?
> Your first message is called "createMessage", are you perhaps trying to
> create "create messages" in the middle of your diagram?
> 
> I'm not sure if this is an opensource issue.
> 
> Could you post your model so I can inspect the entire contents.
> 
> Cheers,
> 
> - James.
> 
> 
> <user@xxxxxxxxxxxxxx> wrote in message
> news:ehml4a$7s3$1@xxxxxxxxxxxxxxxxxxxx
>> Hi, dear all
>>
>> I'm trying to create a sequence diagram by manually writing code. So I
> created a utility method for this purpose:
>> private void createMessage(Lifeline lifeLine1, Lifeline lifeLine2,
>> MessageSort ms, Operation op) {
>> Message createMessage = interaction.createMessage("new");
>> createMessage.setMessageSort(ms);
>> MessageOccurrenceSpecification sendEventOccur =
> (MessageOccurrenceSpecification) interaction
>> .createFragment(
>> null,
>>
> org.eclipse.uml2.uml.UMLPackage.Literals.MESSAGE_OCCURRENCE_SPECIFICATION);
>> sendEventOccur.getCovereds().add(lifeLine1);
>> sendEventOccur.setMessage(createMessage);
>> MessageOccurrenceSpecification recvEventOccur =
> (MessageOccurrenceSpecification) interaction
>> .createFragment(
>> null,
>>
> org.eclipse.uml2.uml.UMLPackage.Literals.MESSAGE_OCCURRENCE_SPECIFICATION);
>> recvEventOccur.getCovereds().add(lifeLine2);
>> recvEventOccur.setMessage(createMessage);
>> createMessage.setSendEvent(sendEventOccur);
>> createMessage.setReceiveEvent(recvEventOccur);
>> SendOperationEvent sendOpEvent = (SendOperationEvent) pack
>> .createPackagedElement(TransformUtil.chooseName("sendEvent",
>> pack), UML2P.eINSTANCE.getSendOperationEvent());
>> sendEventOccur.setEvent(sendOpEvent);
>> ReceiveOperationEvent recvOpEvent = (ReceiveOperationEvent) pack
>> .createPackagedElement(TransformUtil.chooseName("recvEvent",
>> pack), UML2P.eINSTANCE.getReceiveOperationEvent());
>> recvEventOccur.setEvent(recvOpEvent);
>>
>> if (op != null) {
>> sendOpEvent.setOperation(op);
>> recvOpEvent.setOperation(op);
>> }
>> }
>>
>> This method works well when I set "op" argument to null. But it will fail
> to show if I specify other value to op. Is there a standard way to do such
>> things?
>>
>> Thanks a lot!
>> James Gan
> 
>