Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] allInstances() not delivering expected results, returns empty set instead
[ATL] allInstances() not delivering expected results, returns empty set instead [message #79662] Mon, 21 April 2008 10:42 Go to next message
Eclipse UserFriend
Originally posted by: goetz.botterweck.lero.ie

WHAT I WANT TO DO

I want to define a helper function isVisible() based on allInstances().


PROBLEM

allInstances() and allInstancesFrom('modelname') do not return the
expected results, they return empty sets instead.

Or to be more specific: When I use the debugger to step to this
particular point in the ATL file, the watch variables are empty.


ADDITIONAL INFO

I tried both allInstances() and allInstancesFrom('modelname').

The models referenced by settingsIn, componentIn and scm are NOT empty
and DO contain instances of Setting, Component and SettingComponentMapping.

With other rules in the ATL file, the contents of the component model
are copied as expected (see rule "component"). So it look like the
settings in the launch config and filenames etc. are correct.

I assume that I made some simple mistake, but can't spot the problem.
Maybe is there some special behaviour of allInstances() that I have to
take into account?

Thanks for any hints,
Goetz



----------- ATL FILE ------------------

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

-- ---------------------------
-- Definition of visibility
-- ---------------------------

helper context COMPONENTMETA!Component def : isVisible() : Boolean =
let allComponents : Sequence(COMPONENTMETA!Component) =
COMPONENTMETA!Component -> From('componentIn') in

let allSettings : Sequence(SETTINGSMETA!Setting) =
SETTINGSMETA!Setting -> allInstancesFrom('settingsIn') in

let allSettingComponentMappings
:Sequence(SCMMETA!SettingComponentMapping) =
SCMMETA!SettingComponentMapping -> allInstancesFrom('scm') in

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

true
;

-- ---------------------------
-- Copy Rules
-- ---------------------------

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
)
}
Re: [ATL] allInstances() not delivering expected results, returns empty set instead [message #79756 is a reply to message #79662] Tue, 22 April 2008 09:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Hugo.Bruneliere.univ-nantes.fr

Hi Goetz,

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

Best regards,

Hugo

Goetz Botterweck a écrit :
> WHAT I WANT TO DO
>
> I want to define a helper function isVisible() based on allInstances().
>
>
> PROBLEM
>
> allInstances() and allInstancesFrom('modelname') do not return the
> expected results, they return empty sets instead.
>
> Or to be more specific: When I use the debugger to step to this
> particular point in the ATL file, the watch variables are empty.
>
>
> ADDITIONAL INFO
>
> I tried both allInstances() and allInstancesFrom('modelname').
>
> The models referenced by settingsIn, componentIn and scm are NOT empty
> and DO contain instances of Setting, Component and SettingComponentMapping.
>
> With other rules in the ATL file, the contents of the component model
> are copied as expected (see rule "component"). So it look like the
> settings in the launch config and filenames etc. are correct.
>
> I assume that I made some simple mistake, but can't spot the problem.
> Maybe is there some special behaviour of allInstances() that I have to
> take into account?
>
> Thanks for any hints,
> Goetz
>
>
>
> ----------- ATL FILE ------------------
>
> module generateComponentModel;
> create componentOut : COMPONENTMETA from settingsIn : SETTINGSMETA,
> componentIn : COMPONENTMETA, scm : SCMMETA;
>
> -- ---------------------------
> -- Definition of visibility
> -- ---------------------------
>
> helper context COMPONENTMETA!Component def : isVisible() : Boolean =
> let allComponents : Sequence(COMPONENTMETA!Component) =
> COMPONENTMETA!Component -> From('componentIn') in
>
> let allSettings : Sequence(SETTINGSMETA!Setting) =
> SETTINGSMETA!Setting -> allInstancesFrom('settingsIn') in
>
> let allSettingComponentMappings
> :Sequence(SCMMETA!SettingComponentMapping) =
> SCMMETA!SettingComponentMapping -> allInstancesFrom('scm') in
>
> -- ***** HERE ***********
> -- Here I would like to define the isVisible() function based
> -- on the helper variables allComponents, allSettings, and
> -- allSettingComponentMappings
> -- however these are all empty
>
> true
> ;
>
> -- ---------------------------
> -- Copy Rules
> -- ---------------------------
>
> 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
> )
> }


--
--------------------------------------------------------
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@univ-nantes.fr
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------
Re: [ATL] allInstances() fails with error "could not find operation From on MOF!EClass" [message #79813 is a reply to message #79756] Tue, 22 April 2008 20:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: goetz.botterweck.lero.ie

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.

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).


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(SimpleDeb ugger.java:195)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:95)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:91)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:700)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:683)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:338)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.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.ja va:169)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:111)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:87)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:326)
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)
INFO: /ATL Experiments/transformations/generateComponentModel.atl
Re: [ATL] allInstances() fails with error "could not find operation From on MOF!EClass" [message #79860 is a reply to message #79813] Wed, 23 April 2008 11:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Hugo.Bruneliere.univ-nantes.fr

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(SimpleDeb ugger.java:195)
> at
> org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:95)
>
> at
> org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:91)
>
> at
> org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:700)
>
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
> at
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
>
> at
> org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:683)
>
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:338)
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
> at
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
>
> at
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
>
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
> at
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
>
> at
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
>
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.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.ja va:169)
> at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:111)
> at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:87)
> at
> org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:326)
>
> 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)
> 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@univ-nantes.fr
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------
Re: [ATL] allInstances() fails with error "could not find operation From on MOF!EClass" [message #79875 is a reply to message #79860] Wed, 23 April 2008 13:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: goetz.botterweck.lero.ie

Hugo Bruneliere wrote:
> 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')

D'oh! Yes of course. Fixed that. However, that does not solve the problem.

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

I assume you are referring to the run dialog setting
ATL Virtual Machine = (Regular VM | EMF specific VM)
I tried both. Does not solve the problem.

In both cases I get something like
An internal error occurred during: "Launching generateComponentModel".
operation not found: COMPONENTMETA!Component.From

Any hints?

Would it help if I attach some files from my project?

Thanks for your help,
Goetz

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

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


-- Definition of visibility


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
;



-- Copy Rules


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(SimpleDeb ugger.java:195)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:95)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:91)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:700)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:683)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:338)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.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.ja va:169)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:111)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:87)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:326)
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)
INFO: /ATL Experiments/transformations/generateComponentModel.atl
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(SimpleDeb ugger.java:195)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:95)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:91)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:700)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:683)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:338)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.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.ja va:169)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:111)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:87)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:326)
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)
INFO: /ATL Experiments/transformations/generateComponentModel.atl
Re: [ATL] allInstances() not delivering expected results, returns empty set instead [message #80221 is a reply to message #79662] Tue, 29 April 2008 07:17 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello,


There was a bug in the debugger: contents of OrderedSet was not shown.
It is now corrected on branch R2_1_0_dev.

This problem does not impact normal execution though.

Note that you can also get the value of the OrderedSet using debug:

SETTINGSMETA!Setting.allInstancesFrom('settingsIn').debug('R esult of
allInstancesFrom')

This will display the value in the console during the execution.


Regards,

Frédéric Jouault



Goetz Botterweck a écrit :
> WHAT I WANT TO DO
>
> I want to define a helper function isVisible() based on allInstances().
>
>
> PROBLEM
>
> allInstances() and allInstancesFrom('modelname') do not return the
> expected results, they return empty sets instead.
>
> Or to be more specific: When I use the debugger to step to this
> particular point in the ATL file, the watch variables are empty.
>
>
> ADDITIONAL INFO
>
> I tried both allInstances() and allInstancesFrom('modelname').
>
> The models referenced by settingsIn, componentIn and scm are NOT empty
> and DO contain instances of Setting, Component and SettingComponentMapping.
>
> With other rules in the ATL file, the contents of the component model
> are copied as expected (see rule "component"). So it look like the
> settings in the launch config and filenames etc. are correct.
>
> I assume that I made some simple mistake, but can't spot the problem.
> Maybe is there some special behaviour of allInstances() that I have to
> take into account?
>
> Thanks for any hints,
> Goetz
>
>
>
> ----------- ATL FILE ------------------
>
> module generateComponentModel;
> create componentOut : COMPONENTMETA from settingsIn : SETTINGSMETA,
> componentIn : COMPONENTMETA, scm : SCMMETA;
>
> -- ---------------------------
> -- Definition of visibility
> -- ---------------------------
>
> helper context COMPONENTMETA!Component def : isVisible() : Boolean =
> let allComponents : Sequence(COMPONENTMETA!Component) =
> COMPONENTMETA!Component -> From('componentIn') in
>
> let allSettings : Sequence(SETTINGSMETA!Setting) =
> SETTINGSMETA!Setting -> allInstancesFrom('settingsIn') in
>
> let allSettingComponentMappings
> :Sequence(SCMMETA!SettingComponentMapping) =
> SCMMETA!SettingComponentMapping -> allInstancesFrom('scm') in
>
> -- ***** HERE ***********
> -- Here I would like to define the isVisible() function based
> -- on the helper variables allComponents, allSettings, and
> -- allSettingComponentMappings
> -- however these are all empty
>
> true
> ;
>
> -- ---------------------------
> -- Copy Rules
> -- ---------------------------
>
> 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
> )
> }
Re: [ATL] allInstances() not delivering expected results, returns empty set instead [message #80265 is a reply to message #80221] Tue, 29 April 2008 07:55 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hello,

Frédéric Jouault a écrit :
> Hello,
>
>
> There was a bug in the debugger: contents of OrderedSet was not shown.
> It is now corrected on branch R2_1_0_dev.
>

Now the bug has also been corrected on HEAD, so it will be fixed for
next ATL releases.

> This problem does not impact normal execution though.
>
> Note that you can also get the value of the OrderedSet using debug:
>
> SETTINGSMETA!Setting.allInstancesFrom('settingsIn').debug('R esult of
> allInstancesFrom')
>
> This will display the value in the console during the execution.
>
>
> Regards,
>
> Frédéric Jouault
>
>
>
> Goetz Botterweck a écrit :
>> WHAT I WANT TO DO
>>
>> I want to define a helper function isVisible() based on allInstances().
>>
>>
>> PROBLEM
>>
>> allInstances() and allInstancesFrom('modelname') do not return the
>> expected results, they return empty sets instead.
>>
>> Or to be more specific: When I use the debugger to step to this
>> particular point in the ATL file, the watch variables are empty.
>>
>>
>> ADDITIONAL INFO
>>
>> I tried both allInstances() and allInstancesFrom('modelname').
>>
>> The models referenced by settingsIn, componentIn and scm are NOT empty
>> and DO contain instances of Setting, Component and
>> SettingComponentMapping.
>>
>> With other rules in the ATL file, the contents of the component model
>> are copied as expected (see rule "component"). So it look like the
>> settings in the launch config and filenames etc. are correct.
>>
>> I assume that I made some simple mistake, but can't spot the problem.
>> Maybe is there some special behaviour of allInstances() that I have to
>> take into account?
>>
>> Thanks for any hints,
>> Goetz
>>
>>
>>
>> ----------- ATL FILE ------------------
>>
>> module generateComponentModel;
>> create componentOut : COMPONENTMETA from settingsIn : SETTINGSMETA,
>> componentIn : COMPONENTMETA, scm : SCMMETA;
>>
>> -- ---------------------------
>> -- Definition of visibility
>> -- ---------------------------
>>
>> helper context COMPONENTMETA!Component def : isVisible() : Boolean =
>> let allComponents : Sequence(COMPONENTMETA!Component) =
>> COMPONENTMETA!Component -> From('componentIn') in
>>
>> let allSettings : Sequence(SETTINGSMETA!Setting) =
>> SETTINGSMETA!Setting -> allInstancesFrom('settingsIn') in
>>
>> let allSettingComponentMappings
>> :Sequence(SCMMETA!SettingComponentMapping) =
>> SCMMETA!SettingComponentMapping -> allInstancesFrom('scm') in
>>
>> -- ***** HERE ***********
>> -- Here I would like to define the isVisible() function based
>> -- on the helper variables allComponents, allSettings, and
>> -- allSettingComponentMappings
>> -- however these are all empty
>> true
>> ;
>>
>> -- ---------------------------
>> -- Copy Rules
>> -- ---------------------------
>>
>> 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
>> )
>> }
Re: [ATL] allInstances() not delivering expected results (Problem solved) [message #80462 is a reply to message #80265] Tue, 29 April 2008 19:34 Go to previous message
Eclipse UserFriend
Originally posted by: goetz.botterweck.lero.ie

Frédéric Jouault a écrit :
> There was a bug in the debugger: contents of OrderedSet was not shown.
> It is now corrected on branch R2_1_0_dev.

William Piers wrote:
> Now the bug has also been corrected on HEAD, so it will be fixed for ...

I updated org.eclipse.m2m.atl.* from CVS.

The debugger now works as expected.

Thanks for the quick response,
Goetz
Previous Topic:[ATL] Multiple source patterns
Next Topic:Generate UML2 model using api
Goto Forum:
  


Current Time: Wed Apr 24 16:38:03 GMT 2024

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

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

Back to the top