Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How to add a SendOperationEvent to a Package?
How to add a SendOperationEvent to a Package? [message #474501] Mon, 23 July 2007 11:40 Go to next message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 90
Registered: July 2009
Member
Hello NG,
I want to add a SendOperationEvent to a Package. Thought it is trivial
but it isn't :( Well now I think I am mixing up "owned" and "owning". At
first I thought it's just SendOperationEvent#setPackage(Package) but it
wasn't. So I tried this:

event.allOwnedElements().add(eventsPack);
event.allOwningPackages().add(eventsPack);
event.getOwnedElements().add(eventsPack);

But I had no success. Do you have some ideas?

greets
J.R.
Re: How to add a SendOperationEvent to a Package? [message #474502 is a reply to message #474501] Mon, 23 July 2007 11:51 Go to previous messageGo to next message
Philippe is currently offline PhilippeFriend
Messages: 100
Registered: July 2009
Senior Member
Hello Jan,

try pack.getPackagedElements().add(evt);
here is a small snippet

org.eclipse.uml2.uml.Package pack = UMLFactory.eINSTANCE.createPackage();
SendOperationEvent evt = UMLFactory.eINSTANCE.createSendOperationEvent();
pack.getPackagedElements().add(evt);

Good luck
Philippe

Jan Reimann wrote:
> Hello NG,
> I want to add a SendOperationEvent to a Package. Thought it is trivial
> but it isn't :( Well now I think I am mixing up "owned" and "owning". At
> first I thought it's just SendOperationEvent#setPackage(Package) but it
> wasn't. So I tried this:
>
> event.allOwnedElements().add(eventsPack);
> event.allOwningPackages().add(eventsPack);
> event.getOwnedElements().add(eventsPack);
>
> But I had no success. Do you have some ideas?
>
> greets
> J.R.
Re: How to add a SendOperationEvent to a Package? [message #474503 is a reply to message #474502] Mon, 23 July 2007 12:30 Go to previous messageGo to next message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 90
Registered: July 2009
Member
Philippe wrote:
> try pack.getPackagedElements().add(evt);

thanks - that's it :)
Re: How to add a SendOperationEvent to a Package? [message #474517 is a reply to message #474502] Tue, 24 July 2007 16:16 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Or, perhaps more conveniently,

SendOperationEvent evt = (SendOperationEvent) pack.createPackagedElement("My
event", UMLPackage.Literals.SEND_OPERATION_EVENT);

Kenn

"Philippe" <philippeweber57@yahoo.fr> wrote in message
news:f824tj$pop$1@build.eclipse.org...
> Hello Jan,
>
> try pack.getPackagedElements().add(evt);
> here is a small snippet
>
> org.eclipse.uml2.uml.Package pack = UMLFactory.eINSTANCE.createPackage();
> SendOperationEvent evt = UMLFactory.eINSTANCE.createSendOperationEvent();
> pack.getPackagedElements().add(evt);
>
> Good luck
> Philippe
>
> Jan Reimann wrote:
>> Hello NG,
>> I want to add a SendOperationEvent to a Package. Thought it is trivial
>> but it isn't :( Well now I think I am mixing up "owned" and "owning". At
>> first I thought it's just SendOperationEvent#setPackage(Package) but it
>> wasn't. So I tried this:
>>
>> event.allOwnedElements().add(eventsPack);
>> event.allOwningPackages().add(eventsPack);
>> event.getOwnedElements().add(eventsPack);
>>
>> But I had no success. Do you have some ideas?
>>
>> greets
>> J.R.
Re: How to add a SendOperationEvent to a Package? [message #474726 is a reply to message #474517] Thu, 26 July 2007 10:28 Go to previous message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 90
Registered: July 2009
Member
Kenn Hussey wrote:
> SendOperationEvent evt = (SendOperationEvent) pack.createPackagedElement("My
> event", UMLPackage.Literals.SEND_OPERATION_EVENT);

Thanks for this solution. Indeed it's more convenient :)

greets
J.R.
Re: How to add a SendOperationEvent to a Package? [message #623937 is a reply to message #474501] Mon, 23 July 2007 11:51 Go to previous message
Philippe is currently offline PhilippeFriend
Messages: 100
Registered: July 2009
Senior Member
Hello Jan,

try pack.getPackagedElements().add(evt);
here is a small snippet

org.eclipse.uml2.uml.Package pack = UMLFactory.eINSTANCE.createPackage();
SendOperationEvent evt = UMLFactory.eINSTANCE.createSendOperationEvent();
pack.getPackagedElements().add(evt);

Good luck
Philippe

Jan Reimann wrote:
> Hello NG,
> I want to add a SendOperationEvent to a Package. Thought it is trivial
> but it isn't :( Well now I think I am mixing up "owned" and "owning". At
> first I thought it's just SendOperationEvent#setPackage(Package) but it
> wasn't. So I tried this:
>
> event.allOwnedElements().add(eventsPack);
> event.allOwningPackages().add(eventsPack);
> event.getOwnedElements().add(eventsPack);
>
> But I had no success. Do you have some ideas?
>
> greets
> J.R.
Re: How to add a SendOperationEvent to a Package? [message #623938 is a reply to message #474502] Mon, 23 July 2007 12:30 Go to previous message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 90
Registered: July 2009
Member
Philippe wrote:
> try pack.getPackagedElements().add(evt);

thanks - that's it :)
Re: How to add a SendOperationEvent to a Package? [message #624053 is a reply to message #474502] Tue, 24 July 2007 16:16 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Or, perhaps more conveniently,

SendOperationEvent evt = (SendOperationEvent) pack.createPackagedElement("My
event", UMLPackage.Literals.SEND_OPERATION_EVENT);

Kenn

"Philippe" <philippeweber57@yahoo.fr> wrote in message
news:f824tj$pop$1@build.eclipse.org...
> Hello Jan,
>
> try pack.getPackagedElements().add(evt);
> here is a small snippet
>
> org.eclipse.uml2.uml.Package pack = UMLFactory.eINSTANCE.createPackage();
> SendOperationEvent evt = UMLFactory.eINSTANCE.createSendOperationEvent();
> pack.getPackagedElements().add(evt);
>
> Good luck
> Philippe
>
> Jan Reimann wrote:
>> Hello NG,
>> I want to add a SendOperationEvent to a Package. Thought it is trivial
>> but it isn't :( Well now I think I am mixing up "owned" and "owning". At
>> first I thought it's just SendOperationEvent#setPackage(Package) but it
>> wasn't. So I tried this:
>>
>> event.allOwnedElements().add(eventsPack);
>> event.allOwningPackages().add(eventsPack);
>> event.getOwnedElements().add(eventsPack);
>>
>> But I had no success. Do you have some ideas?
>>
>> greets
>> J.R.
Re: How to add a SendOperationEvent to a Package? [message #624090 is a reply to message #474517] Thu, 26 July 2007 10:28 Go to previous message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 90
Registered: July 2009
Member
Kenn Hussey wrote:
> SendOperationEvent evt = (SendOperationEvent) pack.createPackagedElement("My
> event", UMLPackage.Literals.SEND_OPERATION_EVENT);

Thanks for this solution. Indeed it's more convenient :)

greets
J.R.
Previous Topic:No value in upperValue/lowerValue - meaning?
Next Topic:Re: Problem with redefining enum property
Goto Forum:
  


Current Time: Mon Mar 30 22:44:16 GMT 2020

Powered by FUDForum. Page generated in 0.02234 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top