Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Re: Stereotype creation
Re: Stereotype creation [message #476226] Thu, 27 September 2007 13:41 Go to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33143
Registered: July 2009
Senior Member
Elguenbri,

I'll redirect you to the UML2 newsgroup, which I've added to the "to"
list of the reply, so you don't need to repost.


elguenbri foued wrote:
> hi
> i have create an UML profile to BPMN and im trying to integrate it into a activity diagam.
> i have made stereotype for each UML component, some stereotype have property witch type is Enumeration but when i tryed to apply this stereotype to UML component i had an exception
> java.lang.IllegalArgumentException: Trigger
>
> Trigger is the stereotype's property to witch i want to set a value choosed from a set of value.
>
> this is the methode:
> element.setValue( stereotype, property, ownedLiteral );
>
> the exception is in the property variable. Are they some constrainte on this field???
>
> some one can help me please
> thanks
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Stereotype creation [message #476254 is a reply to message #476226] Wed, 03 October 2007 00:51 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
There could be many reasons for such an error. Is it possible that the
property name is not set ( the second parameter ), or the stereotype is not
applied properly?

Do you have a more detailed stack trace with a line number perhaps?

- James.



"Ed Merks" <merks@ca.ibm.com> wrote in message
news:fdgbuq$76p$2@build.eclipse.org...
> Elguenbri,
>
> I'll redirect you to the UML2 newsgroup, which I've added to the "to" list
> of the reply, so you don't need to repost.
>
>
> elguenbri foued wrote:
>> hi
>> i have create an UML profile to BPMN and im trying to integrate it into a
>> activity diagam.
>> i have made stereotype for each UML component, some stereotype have
>> property witch type is Enumeration but when i tryed to apply this
>> stereotype to UML component i had an exception
>> java.lang.IllegalArgumentException: Trigger
>>
>> Trigger is the stereotype's property to witch i want to set a value
>> choosed from a set of value.
>>
>> this is the methode:
>> element.setValue( stereotype, property, ownedLiteral );
>> the exception is in the property variable. Are they some constrainte on
>> this field???
>>
>> some one can help me please
>> thanks
>>
Re: Stereotype creation [message #476255 is a reply to message #476254] Wed, 03 October 2007 13:29 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33143
Registered: July 2009
Senior Member
If you don't reply with the UML2 newsgroup on the "to" list they will
not see your question and you won't get an answer.

In general, you'd get a list value if the upper bound of the attribute
is > 1...


elguenbri foued wrote:
> forget that :)
> how can i create an attribute to a stereotype with a list of values??
> so that a user can chose one of them!!!
> thanks
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Stereotype creation [message #476257 is a reply to message #476255] Wed, 03 October 2007 14:44 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
The types of objects you can pass to Element#setValue() include lists of
items. So if your property on your stereotype boild down to an
eStructuralFeature with isMany() == true, then you can pass something of
type List to setValue().

Also, if your property is an enumeration, then you can pass an
EnumerationLiteral as the parameter to setValue(), or a String and an
attempt will be made to create the corresponding data type instance from the
specified string.

If something is going wrong because of how your stereotype is defined or how
data is passed then you need to set a breakpoint on
ElementOperations#setValue().

- James.


"Ed Merks" <merks@ca.ibm.com> wrote in message
news:fe05fh$c23$4@build.eclipse.org...
> If you don't reply with the UML2 newsgroup on the "to" list they will
> not see your question and you won't get an answer.
>
> In general, you'd get a list value if the upper bound of the attribute
> is > 1...
>
>
> elguenbri foued wrote:
> > forget that :)
> > how can i create an attribute to a stereotype with a list of values??
> > so that a user can chose one of them!!!
> > thanks
> >
Re: Stereotype creation [message #625066 is a reply to message #476226] Wed, 03 October 2007 00:51 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
There could be many reasons for such an error. Is it possible that the
property name is not set ( the second parameter ), or the stereotype is not
applied properly?

Do you have a more detailed stack trace with a line number perhaps?

- James.



"Ed Merks" <merks@ca.ibm.com> wrote in message
news:fdgbuq$76p$2@build.eclipse.org...
> Elguenbri,
>
> I'll redirect you to the UML2 newsgroup, which I've added to the "to" list
> of the reply, so you don't need to repost.
>
>
> elguenbri foued wrote:
>> hi
>> i have create an UML profile to BPMN and im trying to integrate it into a
>> activity diagam.
>> i have made stereotype for each UML component, some stereotype have
>> property witch type is Enumeration but when i tryed to apply this
>> stereotype to UML component i had an exception
>> java.lang.IllegalArgumentException: Trigger
>>
>> Trigger is the stereotype's property to witch i want to set a value
>> choosed from a set of value.
>>
>> this is the methode:
>> element.setValue( stereotype, property, ownedLiteral );
>> the exception is in the property variable. Are they some constrainte on
>> this field???
>>
>> some one can help me please
>> thanks
>>
Re: Stereotype creation [message #625067 is a reply to message #476254] Wed, 03 October 2007 13:29 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33143
Registered: July 2009
Senior Member
If you don't reply with the UML2 newsgroup on the "to" list they will
not see your question and you won't get an answer.

In general, you'd get a list value if the upper bound of the attribute
is > 1...


elguenbri foued wrote:
> forget that :)
> how can i create an attribute to a stereotype with a list of values??
> so that a user can chose one of them!!!
> thanks
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Stereotype creation [message #625069 is a reply to message #476255] Wed, 03 October 2007 14:44 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
The types of objects you can pass to Element#setValue() include lists of
items. So if your property on your stereotype boild down to an
eStructuralFeature with isMany() == true, then you can pass something of
type List to setValue().

Also, if your property is an enumeration, then you can pass an
EnumerationLiteral as the parameter to setValue(), or a String and an
attempt will be made to create the corresponding data type instance from the
specified string.

If something is going wrong because of how your stereotype is defined or how
data is passed then you need to set a breakpoint on
ElementOperations#setValue().

- James.


"Ed Merks" <merks@ca.ibm.com> wrote in message
news:fe05fh$c23$4@build.eclipse.org...
> If you don't reply with the UML2 newsgroup on the "to" list they will
> not see your question and you won't get an answer.
>
> In general, you'd get a list value if the upper bound of the attribute
> is > 1...
>
>
> elguenbri foued wrote:
> > forget that :)
> > how can i create an attribute to a stereotype with a list of values??
> > so that a user can chose one of them!!!
> > thanks
> >
Previous Topic:UML2 -> XML artifacts
Next Topic:[Announce] MDT UML2 2.2.0 2.2M2 is available
Goto Forum:
  


Current Time: Wed May 01 21:56:08 GMT 2024

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

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

Back to the top