[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] Re: [ATL][UML] set stereotyped tagged value

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.Object))
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.setValue(ElementOperations.java:754)
at org.eclipse.uml2.uml.internal.impl.ElementImpl.setValue(ElementImpl.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.realInvoke(ASMUMLModelElement.java:631)
at org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModel.applyDelayedInvocations(ASMUMLModel.java:569)
at org.eclipse.m2m.atl.drivers.uml24atl.AtlUML2ModelHandler.saveModel(AtlUML2ModelHandler.java:61)
at org.eclipse.m2m.atl.drivers.uml24atl.AtlUML2ModelHandler.saveModel(AtlUML2ModelHandler.java:49)
at org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLauncher(AtlRegularVM.java:337)
at org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLauncher(AtlRegularVM.java:426)
at org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlRegularVM.java:398)
at org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDelegate.launch(AtlLaunchConfigurationDelegate.java:42)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:759)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:608)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:899)
at org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlugin.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@xxxxxxxx> wrote in message news:g23n7d$cfc$1@xxxxxxxxxxxxxxxxxxxx
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.applyStereotype(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.applyStereotype(ElementOperations.java:1410)
at org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereotype(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.realInvoke(ASMUMLModelElement.java:614)
at org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModel.applyDelayedInvocations(ASMUMLModel.java:552)
at org.eclipse.m2m.atl.drivers.uml24atl.AtlUML2ModelHandler.saveModel(AtlUML2ModelHandler.java:49)
at org.eclipse.m2m.atl.drivers.uml24atl.AtlUML2ModelHandler.saveModel(AtlUML2ModelHandler.java:37)
at org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLauncher(AtlRegularVM.java:362)
at org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLauncher(AtlRegularVM.java:453)
at org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlRegularVM.java:425)
at org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDelegate.launch(AtlLaunchConfigurationDelegate.java:35)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:766)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:608)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:899)
at org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlugin.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).