[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] Re: [ATL] allInstances() fails with error "could not find operation From on MOF!EClass"

Hi Goetz,

Goetz Botterweck a écrit :
You are right, Hugo, but that did not solve the problem.

Hugo Bruneliere wrote:
You have to do
    SETTINGSMETA!Setting.allInstancesFrom('settingsIn')
instead of
    SETTINGSMETA!Setting -> allInstancesFrom('settingsIn')


I am now using -> again.


You cannot use "->" because it is only for collections: - "COMPONENTMETA!Component" is not a collection, it is a single element which represents the COMPONENTMETA!Component type - allInstances & allInstancesFrom are not operations on collections

You must write:
  COMPONENTMETA!Component.allInstances()
  COMPONENTMETA!Component.allInstancesFrom('InputModelName')


However, I still have a problem: To use the latest version of ATL (including potential bug fixes) I switched to the latest version from CVS.

Now executing the ATL transformation (See [1] below) fails with the error message "could not find operation From on MOF!EClass having supertypes: [MOF!EClassifier, OclType, OclAny]". However, the ATL transformation does not contain a reference to From(). Could this be caused by the implementation of allInstances()?
(see [2] for a full stack trace).



Are you using the standard VM or the new EMF VM?


Best regards,

Hugo


ADDITIONAL INFO
- COMPONENTMETA and SETTINGSMETA are independent ecore meta-models, where SCMMETA is referencing the other two meta-models.
- Also switching on "Allow intermodel references" did not solve the problem.



Thanks for any hints, Goetz

---- [1] ATL file -----------------------------------------

module generateComponentModel;
create componentOut : COMPONENTMETA from settingsIn : SETTINGSMETA, componentIn : COMPONENTMETA, scm : SCMMETA;


helper context COMPONENTMETA!ComponentsModel def : isVisible() : Boolean =
    true
    ;

helper context COMPONENTMETA!Component def : isVisible() : Boolean =
let allComponents : Sequence(COMPONENTMETA!Component) =
COMPONENTMETA!Component -> allInstances() in
let allSettings : Sequence(SETTINGSMETA!Setting) =
SETTINGSMETA!Setting -> allInstances() in
let allSettingComponentMappings : Sequence(SCMMETA!SettingComponentMapping) =
SCMMETA!SettingComponentMapping -> allInstances() in


-- here I would like to define the isVisible() function based on the helper variables
-- allComponents, allSettings, and allSettingComponentMappings
-- however these are all empty
true
;



rule componentsModel { from s : COMPONENTMETA!ComponentsModel ( s.isVisible() ) to t : COMPONENTMETA!ComponentsModel mapsTo s ( name <- s.name, components <- s.components ) }

rule component {
    from s : COMPONENTMETA!Component (
        s.isVisible()
        )
    to t : COMPONENTMETA!Component mapsTo s (
        name <- s.name
        )
}

-----------------------------------------------------------
---- [2] stack trace --------------------------------------
-----------------------------------------------------------

SEVERE: ****** BEGIN Stack Trace
SEVERE: message: ERROR: could not find operation From on MOF!EClass having supertypes: [MOF!EClassifier, OclType, OclAny] (including Java operations)
SEVERE: A.main() : ??#22 null
SEVERE: local variables = {self=generateComponentModel : ASMModule}
SEVERE: local stack = []
SEVERE: A.__matcher__() : ??#3 null
SEVERE: local variables = {self=generateComponentModel : ASMModule}
SEVERE: local stack = []
SEVERE: A.__matchcomponent() : ??#26 44:9-44:22
SEVERE: local variables = {s=componentIn!C1, self=generateComponentModel : ASMModule}
SEVERE: local stack = []
SEVERE: MCOMPONENTMETA!Component;.isVisible() : ??#4 14:3-14:50
SEVERE: local variables = {self=componentIn!C1}
SEVERE: local stack = []
SEVERE: ****** END Stack Trace
INFO: Execution terminated due to error (see launch configuration to allow continuation after errors).
SEVERE: ERROR: could not find operation From on MOF!EClass having supertypes: [MOF!EClassifier, OclType, OclAny] (including Java operations)
java.lang.RuntimeException: ERROR: could not find operation From on MOF!EClass having supertypes: [MOF!EClassifier, OclType, OclAny] (including Java operations)
at org.eclipse.m2m.atl.engine.vm.SimpleDebugger.error(SimpleDebugger.java:195)
at org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(StackFrame.java:95)


at org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(StackFrame.java:91)

at org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invoke(ASMEMFModelElement.java:700)

at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation.java:171)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java:143)


at org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invoke(ASMEMFModelElement.java:683)

at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:338)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation.java:171)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java:143)


at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java:101)

at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation.java:171)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java:143)


at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java:101)

at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation.java:171)
at org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:299)


at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.java:169)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.java:111)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.java:87)
at org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLauncher(AtlRegularVM.java:326)


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)
INFO: /ATL Experiments/transformations/generateComponentModel.atl






--
--------------------------------------------------------
Hugo Bruneliere - R&D Engineer
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssiniere
44322 Nantes Cedex 3 - France
office +33 2 51 12 58 10 /\ cell.+33 6 07 42 45 30
EMail: Hugo.Bruneliere@xxxxxxxxxxxxxx
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------