Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [atl] problem setting properties of stereotypes
[atl] problem setting properties of stereotypes [message #68311] Thu, 06 December 2007 08:26
Ivano is currently offline IvanoFriend
Messages: 35
Registered: July 2009
Member
Hi, I am developing a transformation between two UML2 models conforming to
two profiles (i.e. profile1 and profile2)

I am able to apply profiles and stereotypes, to get values of stereotype
properties, ecc. but I
have problems in setting the value of a stereotype property.

This is an excerpt of a rule:

rule Component {
from s : UML2!Component (thisModule.inElements->includes(s) and
s.isStereotypeApplied('DAcomponent'))
to
t : UML2!Component mapsTo s (
name <- s.name,

...other mappings...

),
k : UML2!Component (
name <- 'NOME',

...other mappings...

)
do {
-- I use this instruction to put the component k into the same
package of t
t.namespace.packagedElement <- t.namespace.packagedElement->including(k);

k.applyStereotype(thisModule.SAtypeStereotype);
t.applyStereotype(thisModule.SAcomponentStereotype);

t.getValue(t.getAppliedStereotypes().first(),
'type').toString().println(); --this prints OclUndefined (and it is right)

-- the following instruction is making me crazy! It generates an exception
t.setValue(t.getAppliedStereotypes().first(), 'type', k);
}
}

My question is: why I can get the value of the property 'type' and I can't
set it?

I tried both with EMF and UML2 model handler for the UML metamodel -->
same result (IllegalArgumentException)

I even tried to set the property manually using UML tree-editor and it is
ok.

Regards, Ivano

P.S. if I declare the property type as Component, all works fine, this
problem arises only when I try to set
references to other stereotyped elements.

The stack trace of the transformation is:

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@17b03ff (name:
NOME, visibility: <unset>) (isLeaf: false, visibility: public, isAbstract:
false) (isActive: false, isAbstract: false) (isIndirectlyInstantiated:
true)
java.lang.IllegalArgumentException:
org.eclipse.uml2.uml.internal.impl.ComponentImpl@17b03ff (name: NOME,
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.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:686)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:325)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:289)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:161)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:105)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:81)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:351)
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: A.main() : ??#81 null
GRAVE: local variables = {null=UML2Copy : ASMModule}
GRAVE: local stack = []
GRAVE: A.__exec__() : ??#938 null
GRAVE: local variables = {e=TransientLink {rule = 'Component',
sourceElements = {s = IN!ciaociao}, targetElements = {t = OUT!ciaociao, k
= OUT!NOME}, variables = {}}, self=UML2Copy : ASMModule}
GRAVE: local stack = [Sequence {}, OclUndefined, OclUndefined,
OclUndefined, Sequence {}]
GRAVE: A.__applyComponent(1 : NTransientLink;) : ??#474 151:6-151:62
GRAVE: local variables = {t=OUT!ciaociao, s=IN!ciaociao,
link=TransientLink {rule = 'Component', sourceElements = {s =
IN!ciaociao}, targetElements = {t = OUT!ciaociao, k = OUT!NOME}, variables
= {}}, self=UML2Copy : ASMModule, k=OUT!NOME}
GRAVE: local stack = [OUT!<unnamed>, OUT!<unnamed>]
GRAVE: ****** END Stack Trace
INFO: Execution terminated due to error (see launch configuration to allow
continuation after errors).
GRAVE: 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))
java.lang.RuntimeException: 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))
at
org.eclipse.m2m.atl.engine.vm.SimpleDebugger.error(SimpleDeb ugger.java:185)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:85)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:695)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:325)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:289)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:161)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:105)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:81)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:351)
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)
Caused by: java.lang.IllegalArgumentException:
org.eclipse.uml2.uml.internal.impl.ComponentImpl@17b03ff (name: NOME,
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.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:686)
... 24 more
Previous Topic:[ATL] Classe's attribute not visible
Next Topic:[ATL] Launch programmatically + Transformation from UML2 with Profile
Goto Forum:
  


Current Time: Fri May 14 23:25:52 GMT 2021

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

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

Back to the top