Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] - How can I get the result from the amount of abstract classes (ECORE)
[ATL] - How can I get the result from the amount of abstract classes (ECORE) [message #106713] Wed, 17 June 2009 17:57 Go to next message
Lucas Schubert is currently offline Lucas SchubertFriend
Messages: 11
Registered: July 2009
Junior Member
Hey all,

I've one question!
I'm trying to count the amount of abstract classes from one EPackage using
ATL. (ECore)

If I execute the following command line in Interactive OCL, it works:
self.eClassifiers->select(c|c.oclIsTypeOf(EClass)).oclAsType(EClass)- >select(d|
d.abstract = true)->size()

The following code, is the implementation in ATL!

helper context Source!EPackage def: getQtAbstractClasses : Integer =

self.eClassifiers-> select(c|c.oclIsTypeOf(Source!EClass)).oclAsType(Source!ECla ss)- >select(d|
d.abstract = true)->size();

P.S.: Source = ECORE

This implementation is not working, the error msg is shown bellow:

SEVERE: ****** BEGIN Stack Trace
SEVERE: message: ERROR: could not find operation oclAsType on
Sequence(OclAny) having supertypes: [Collection(OclAny)]
SEVERE: A.main() : ??#36 null
SEVERE: local variables = {self=ATL_NOCM : ASMModule}
SEVERE: local stack = []
SEVERE: A.__exec__() : ??#8 null
SEVERE: local variables = {self=ATL_NOCM : ASMModule, e=TransientLink
{rule = 'MainBody', sourceElements = {vs = IN!Airplane}, targetElements =
{vResults = OUT!<unnamed>, vResult2 = OUT!<unnamed>, vResult =
OUT!<unnamed>}, variables = {}}}
SEVERE: local stack = []
SEVERE: A.__applyMainBody(1 : NTransientLink;) : ??#83 25:20-25:41
SEVERE: local variables = {vResults=OUT!<unnamed>,
vResult2=OUT!<unnamed>, vs=IN!Airplane, self=ATL_NOCM : ASMModule,
vResult=OUT!<unnamed>, link=TransientLink {rule = 'MainBody',
sourceElements = {vs = IN!Airplane}, targetElements = {vResults =
OUT!<unnamed>, vResult2 = OUT!<unnamed>, vResult = OUT!<unnamed>},
variables = {}}}
SEVERE: local stack = [OUT!<unnamed>, OUT!<unnamed>, ATL_NOCM : ASMModule]
SEVERE: MSource!EPackage;.__initgetAbstractClasses() : ??#23 10:4-10:86
SEVERE: local variables = {self=IN!Airplane, null=IN!Body}
SEVERE: local stack = [Sequence {}]
SEVERE: ****** END Stack Trace
INFO: Execution terminated due to error (see launch configuration to allow
continuation after errors).
SEVERE: ERROR: could not find operation oclAsType on Sequence(OclAny)
having supertypes: [Collection(OclAny)]
java.lang.RuntimeException: ERROR: could not find operation oclAsType on
Sequence(OclAny) having supertypes: [Collection(OclAny)]
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.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:103)
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.ASMExecEnv.getHelperValue(ASME xecEnv.java:322)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.getHelper( ASMOclAny.java:168)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.get(A SMEMFModelElement.java:138)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:301)
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.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.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:764)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:614)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:865)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlu gin.java:1068)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)



Could some one help me? Or maybe tell me where I can get more information
about it? 8)

Thanks in advance,

Lucas
Re: [ATL] - How can I get the result from the amount of abstract classes (ECORE) [message #106757 is a reply to message #106713] Thu, 18 June 2009 06:38 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hi,

According to the doc
(http://wiki.eclipse.org/ATL/User_Guide#OclAny_operations), oclAsType
isn't implemented in ATL.

Here is a previous question similar to yours:
http://dev.eclipse.org/mhonarc/newsLists/news.eclipse.modeli ng.m2m/msg01963.html

In your case, as you previously did a "select", I think the "oclAsType"
is not mandatory.

Best regards,

William

Lucas a écrit :
> Hey all,
>
> I've one question! I'm trying to count the amount of abstract classes
> from one EPackage using ATL. (ECore)
>
> If I execute the following command line in Interactive OCL, it works:
> self.eClassifiers->select(c|c.oclIsTypeOf(EClass)).oclAsType(EClass)- >select(d|
> d.abstract = true)->size()
>
> The following code, is the implementation in ATL!
> helper context Source!EPackage def: getQtAbstractClasses : Integer =
>
> self.eClassifiers-> select(c|c.oclIsTypeOf(Source!EClass)).oclAsType(Source!ECla ss)- >select(d|
> d.abstract = true)->size();
>
> P.S.: Source = ECORE
>
> This implementation is not working, the error msg is shown bellow:
>
> SEVERE: ****** BEGIN Stack Trace
> SEVERE: message: ERROR: could not find operation oclAsType on
> Sequence(OclAny) having supertypes: [Collection(OclAny)]
> SEVERE: A.main() : ??#36 null
> SEVERE: local variables = {self=ATL_NOCM : ASMModule}
> SEVERE: local stack = []
> SEVERE: A.__exec__() : ??#8 null
> SEVERE: local variables = {self=ATL_NOCM : ASMModule,
> e=TransientLink {rule = 'MainBody', sourceElements = {vs = IN!Airplane},
> targetElements = {vResults = OUT!<unnamed>, vResult2 = OUT!<unnamed>,
> vResult = OUT!<unnamed>}, variables = {}}}
> SEVERE: local stack = []
> SEVERE: A.__applyMainBody(1 : NTransientLink;) : ??#83 25:20-25:41
> SEVERE: local variables = {vResults=OUT!<unnamed>,
> vResult2=OUT!<unnamed>, vs=IN!Airplane, self=ATL_NOCM : ASMModule,
> vResult=OUT!<unnamed>, link=TransientLink {rule = 'MainBody',
> sourceElements = {vs = IN!Airplane}, targetElements = {vResults =
> OUT!<unnamed>, vResult2 = OUT!<unnamed>, vResult = OUT!<unnamed>},
> variables = {}}}
> SEVERE: local stack = [OUT!<unnamed>, OUT!<unnamed>, ATL_NOCM :
> ASMModule]
> SEVERE: MSource!EPackage;.__initgetAbstractClasses() : ??#23 10:4-10:86
> SEVERE: local variables = {self=IN!Airplane, null=IN!Body}
> SEVERE: local stack = [Sequence {}]
> SEVERE: ****** END Stack Trace
> INFO: Execution terminated due to error (see launch configuration to
> allow continuation after errors).
> SEVERE: ERROR: could not find operation oclAsType on Sequence(OclAny)
> having supertypes: [Collection(OclAny)]
> java.lang.RuntimeException: ERROR: could not find operation oclAsType on
> Sequence(OclAny) having supertypes: [Collection(OclAny)]
> 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.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:103)
>
> 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.ASMExecEnv.getHelperValue(ASME xecEnv.java:322)
>
> at
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.getHelper( ASMOclAny.java:168)
>
> at
> org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.get(A SMEMFModelElement.java:138)
>
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:301)
> 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.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.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:764)
>
> at
> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:614)
>
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:865)
>
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlu gin.java:1068)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>
>
>
> Could some one help me? Or maybe tell me where I can get more
> information about it? 8)
>
> Thanks in advance,
>
> Lucas
>
Re: [ATL] - How can I get the result from the amount of abstract classes (ECORE) [message #106826 is a reply to message #106757] Thu, 18 June 2009 14:43 Go to previous message
Lucas Schubert is currently offline Lucas SchubertFriend
Messages: 11
Registered: July 2009
Junior Member
Hi William!

Thanks a lot for your help! :)

Lucas
Previous Topic:Extract ATL model to ATL text - reloaded
Next Topic:[ATL} It is possible to have several rules with the same source type?
Goto Forum:
  


Current Time: Fri Mar 29 15:08:21 GMT 2024

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

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

Back to the top