Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Re: [ATL][UML] set stereotyped tagged value
Re: [ATL][UML] set stereotyped tagged value [message #84165] Tue, 10 June 2008 14:45 Go to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Ivano,

From the stack trace it looks like there is an exception coming from the
application of the Stereotype but you mention that the error is from the
setting of the 'type' value; is the problem with the application of the
Stereotype itself? The Element.applyStereotype() will throw
IllegalArgumentExceptions if the stereotype had previously been applied or
if the extension or definition could not be found.

In general, setting a tagged value to a Stereotype is not currently
supported since you could run into problems if the Profile gets updated.
If you are not worried about migration issues, then it should work. I
believe a defect already exists on that issue.

Cheers,

- James.


"Ivano" <ivanomalavolta@yahoo.it> wrote in message
news:g23n7d$cfc$1@build.eclipse.org...
> Hi all,
> I have a strange problem while developing an ATL transformation using
> UML2.
>
> This is a simplified version of a rule:
>
> rule port_SAport2 {
> from
> s_9 : saveccm!Port
> to
> t_15 : UML2!Port (
> name <- s_9.name,
> )
> t_16 : UML2!Component()
> do {
> t_15.applyStereotype(thisModule.SAportStereotype);
> t_16.applyStereotype(thisModule.SAtypeStereotype);
> t_15.setValue(thisModule.SAportStereotype, 'type', t_16);
> }
> }
>
> So, my rule produces a stereotyped UML Port and I want to set
> the value of the 'type' tagged value with t_16.
>
> I tested the helpers and they work, the problem is that if I declare
> the type of the 'SAPort' tagged value as a uml:Component everything works,
> but if I declare it as a SAtype (that is another stereotype) I get an
> exception (listed at the end of this message).
>
> It seems as it does recognize only standard UML elements, and not the
> Stereotypes...
>
> I am sure that someone manages to set tagged values with stereotypes,
> I hope you will help me!
>
> Ivano
>
> this is the Exception:
>
> GRAVE: ****** BEGIN Stack Trace
> GRAVE: message: ERROR: exception during invocation of operation
> applyStereotype on UML2!Component (java method: public
> org.eclipse.emf.ecore.EObject
> org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereoty pe(org.eclipse.uml2.uml.Stereotype))
> GRAVE: exception:
> GRAVE: org.eclipse.uml2.uml.internal.impl.StereotypeImpl@f701e2 (name:
> SAtype, visibility: <unset>) (isLeaf: false, visibility: public,
> isAbstract: false) (isActive: false, isAbstract: false)
> java.lang.IllegalArgumentException:
> org.eclipse.uml2.uml.internal.impl.StereotypeImpl@f701e2 (name: SAtype,
> visibility: <unset>) (isLeaf: false, visibility: public, isAbstract:
> false) (isActive: false, isAbstract: false)
> at
> org.eclipse.uml2.uml.internal.operations.ElementOperations.a pplyStereotype(ElementOperations.java:1410)
> at
> org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereoty pe(ElementImpl.java:501)
> at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModelElement.real Invoke(ASMUMLModelElement.java:614)
> at
> org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModel.applyDelaye dInvocations(ASMUMLModel.java:552)
> at
> org.eclipse.m2m.atl.drivers.uml24atl.AtlUML2ModelHandler.sav eModel(AtlUML2ModelHandler.java:49)
> at
> org.eclipse.m2m.atl.drivers.uml24atl.AtlUML2ModelHandler.sav eModel(AtlUML2ModelHandler.java:37)
> at
> org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:362)
> at
> org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:453)
> at
> org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:425)
> at
> org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:35)
> at
> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:766)
> at
> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:608)
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:899)
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlu gin.java:1102)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> GRAVE: ****** END Stack Trace
> INFO: Execution terminated due to error (see launch configuration to allow
> continuation after errors).
Re: [ATL][UML] set stereotyped tagged value [message #84315 is a reply to message #84165] Wed, 11 June 2008 10:02 Go to previous message
Ivano is currently offline IvanoFriend
Messages: 35
Registered: July 2009
Member
Yes, you are right, but I pasted the wrong stack trace!

Do you have any suggestions on how to work out this problem?

This is the original one:

GRAVE: ****** BEGIN Stack Trace
GRAVE: message: ERROR: exception during invocation of operation
setValue on UML2!Component (java method: public void
org.eclipse.uml2.uml.internal.impl.ElementImpl.setValue(org. eclipse.uml2.uml.Stereotype,java.lang.String,java.lang.Objec t))
GRAVE: exception:
GRAVE: org.eclipse.uml2.uml.internal.impl.ComponentImpl@1ccadea (name:
DataIn, visibility: <unset>) (isLeaf: false, visibility: public,
isAbstract: false) (isActive: false, isAbstract: false)
(isIndirectlyInstantiated: true)
java.lang.IllegalArgumentException:
org.eclipse.uml2.uml.internal.impl.ComponentImpl@1ccadea (name: DataIn,
visibility: <unset>) (isLeaf: false, visibility: public, isAbstract:
false) (isActive: false, isAbstract: false) (isIndirectlyInstantiated: true)
at
org.eclipse.uml2.uml.internal.operations.ElementOperations.s etValue(ElementOperations.java:754)
at
org.eclipse.uml2.uml.internal.impl.ElementImpl.setValue(Elem entImpl.java:306)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModelElement.real Invoke(ASMUMLModelElement.java:631)
at
org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModel.applyDelaye dInvocations(ASMUMLModel.java:569)
at
org.eclipse.m2m.atl.drivers.uml24atl.AtlUML2ModelHandler.sav eModel(AtlUML2ModelHandler.java:61)
at
org.eclipse.m2m.atl.drivers.uml24atl.AtlUML2ModelHandler.sav eModel(AtlUML2ModelHandler.java:49)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:337)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:426)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:398)
at
org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:42)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:759)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:608)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:899)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlu gin.java:1102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
GRAVE: ****** END Stack Trace
INFO: Execution terminated due to error (see launch configuration to
allow continuation after errors).



James Bruck ha scritto:
> Hi Ivano,
>
> From the stack trace it looks like there is an exception coming from the
> application of the Stereotype but you mention that the error is from the
> setting of the 'type' value; is the problem with the application of the
> Stereotype itself? The Element.applyStereotype() will throw
> IllegalArgumentExceptions if the stereotype had previously been applied or
> if the extension or definition could not be found.
>
> In general, setting a tagged value to a Stereotype is not currently
> supported since you could run into problems if the Profile gets updated.
> If you are not worried about migration issues, then it should work. I
> believe a defect already exists on that issue.
>
> Cheers,
>
> - James.
>
>
> "Ivano" <ivanomalavolta@yahoo.it> wrote in message
> news:g23n7d$cfc$1@build.eclipse.org...
>> Hi all,
>> I have a strange problem while developing an ATL transformation using
>> UML2.
>>
>> This is a simplified version of a rule:
>>
>> rule port_SAport2 {
>> from
>> s_9 : saveccm!Port
>> to
>> t_15 : UML2!Port (
>> name <- s_9.name,
>> )
>> t_16 : UML2!Component()
>> do {
>> t_15.applyStereotype(thisModule.SAportStereotype);
>> t_16.applyStereotype(thisModule.SAtypeStereotype);
>> t_15.setValue(thisModule.SAportStereotype, 'type', t_16);
>> }
>> }
>>
>> So, my rule produces a stereotyped UML Port and I want to set
>> the value of the 'type' tagged value with t_16.
>>
>> I tested the helpers and they work, the problem is that if I declare
>> the type of the 'SAPort' tagged value as a uml:Component everything works,
>> but if I declare it as a SAtype (that is another stereotype) I get an
>> exception (listed at the end of this message).
>>
>> It seems as it does recognize only standard UML elements, and not the
>> Stereotypes...
>>
>> I am sure that someone manages to set tagged values with stereotypes,
>> I hope you will help me!
>>
>> Ivano
>>
>> this is the Exception:
>>
>> GRAVE: ****** BEGIN Stack Trace
>> GRAVE: message: ERROR: exception during invocation of operation
>> applyStereotype on UML2!Component (java method: public
>> org.eclipse.emf.ecore.EObject
>> org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereoty pe(org.eclipse.uml2.uml.Stereotype))
>> GRAVE: exception:
>> GRAVE: org.eclipse.uml2.uml.internal.impl.StereotypeImpl@f701e2 (name:
>> SAtype, visibility: <unset>) (isLeaf: false, visibility: public,
>> isAbstract: false) (isActive: false, isAbstract: false)
>> java.lang.IllegalArgumentException:
>> org.eclipse.uml2.uml.internal.impl.StereotypeImpl@f701e2 (name: SAtype,
>> visibility: <unset>) (isLeaf: false, visibility: public, isAbstract:
>> false) (isActive: false, isAbstract: false)
>> at
>> org.eclipse.uml2.uml.internal.operations.ElementOperations.a pplyStereotype(ElementOperations.java:1410)
>> at
>> org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereoty pe(ElementImpl.java:501)
>> at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModelElement.real Invoke(ASMUMLModelElement.java:614)
>> at
>> org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModel.applyDelaye dInvocations(ASMUMLModel.java:552)
>> at
>> org.eclipse.m2m.atl.drivers.uml24atl.AtlUML2ModelHandler.sav eModel(AtlUML2ModelHandler.java:49)
>> at
>> org.eclipse.m2m.atl.drivers.uml24atl.AtlUML2ModelHandler.sav eModel(AtlUML2ModelHandler.java:37)
>> at
>> org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:362)
>> at
>> org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:453)
>> at
>> org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:425)
>> at
>> org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:35)
>> at
>> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:766)
>> at
>> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:608)
>> at
>> org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:899)
>> at
>> org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlu gin.java:1102)
>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>> GRAVE: ****** END Stack Trace
>> INFO: Execution terminated due to error (see launch configuration to allow
>> continuation after errors).
>
>
Previous Topic:ATL formal description
Next Topic:[ATL] Programmaticaly launch transformation involving UML models
Goto Forum:
  


Current Time: Sat Aug 24 04:43:26 GMT 2019

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

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

Back to the top