Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [ETL] Accessing packages
[ETL] Accessing packages [message #632934] Thu, 14 October 2010 13:26 Go to next message
Henning is currently offline Henning
Messages: 32
Registered: October 2010
Member
Hi,

I'm working on a transformation that uses an ecore metamodel with several packages. Right now I'm able to use all types of the top level, but I cannot access any types from the packages.
I used the syntax from the reference

Metamodel!package::type


But I always get a type-not-found-exception. I don't think it is a registering issue because I can see the ecore structure just fine in the EPackage Registry View.

Any ideas why I'm not able to use the types of the packages? Are different namespaces of the packages any problem?

Thanks for your help!

Henning

[Updated on: Thu, 14 October 2010 15:30]

Report message to a moderator

Re: [ETL] Accessing packages [message #632967 is a reply to message #632934] Thu, 14 October 2010 16:03 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Are you including the root package name in your x::y::z paths?

Cheers,
Dimitris

Henning <Hager.Henning@gmail.com> wrote:
> Hi,
>
> I'm working on a transformation that uses an ecore metamodel with
> several packages. Right now I'm able to use all types of the top
> level, but I cannot access any types from the packages.
> I used the syntax from the reference
> Metamodel!package::type
>
> But I always get a type-not-found-exception. I don't think it is a
> registering issue because I can see the ecore structure just fine in
> the EPackage Registry View.
>
> Any ideas why I'm not able to use the types of the packages? Are
> different namespaces of the packages any problem?
>
> Thanks for your help!
>
> Henning
>
Re: [ETL] Accessing packages [message #633130 is a reply to message #632967] Fri, 15 October 2010 09:18 Go to previous messageGo to next message
Henning is currently offline Henning
Messages: 32
Registered: October 2010
Member
Hi Dimitris,

I think I got it to work but I don't understand the way it works. The following picture shows the structure of my ecore model.

http://cl.ly/8e0e273eb16426e23431
http://cl.ly/8e0e273eb16426e23431

It's no problem to use the top most level elements (like Domain) of "suppresswarnings" in the following manner:

suppresswarnings!Domain

However, I would expect to use type "Element2" with the following command:

suppresswarnings!SubDomain2::Element2

Instead I need to use

suppresswarinings!Element2

Another peculiar fact is that the EPackage Registry View shows all packages of suppresswarnings aligned on the same level - the hierarchal structure of the packages is not reflected at all.

I hope this small example clarifies my problem.
Re: [ETL] Accessing packages [message #633140 is a reply to message #633130] Fri, 15 October 2010 09:33 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Henning,

If M is the name of your model you can use either the complete path
(M!suppresswarnings::SubDomain2::Element2) or the flattened path which
is handy if you don't have classes with the same names in your
sub-packages (M!Element2).

Regarding the EPackage Registry View, it reflects the structure of the
EMF EPackage Registry which is also flat. Sub-packages are generally a
sad story in EMF and even Ed suggests not using them (see
http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg4 1800.html).

Cheers,
Dimitris

Henning wrote:
> Hi Dimitris,
>
> I think I got it to work but I don't understand the way it works. The
> following picture shows the structure of my ecore model.
>
>
> http://cl.ly/8e0e273eb16426e23431
>
> It's no problem to use the top most level elements (like Domain) of
> "suppresswarnings" in the following manner:
>
> suppresswarnings!Domain
>
> However, I would expect to use type "Element2" with the following command:
>
> suppresswarnings!SubDomain2::Element2
>
> Instead I need to use
> suppresswarinings!Element2
>
> Another peculiar fact is that the EPackage Registry View shows all
> packages of suppresswarnings aligned on the same level - the hierarchal
> structure of the packages is not reflected at all.
>
> I hope this small example clarifies my problem.
>
Re: [ETL] Accessing packages [message #633358 is a reply to message #633140] Sat, 16 October 2010 16:07 Go to previous messageGo to next message
Henning is currently offline Henning
Messages: 32
Registered: October 2010
Member
Hi Dimitiris,

I didn't know about the flatten path - so that is the explanation why it works that way. However, I was not able to use the full qualified path to reach my subpackages. For demonstration purposes I put together a minimalistic example and uploaded the whole project to my Dropbox folder "epsilon". You can it get here. Please take a look and tell where I'm mistaken. The ETL looks like this:
rule exampleTrafo
	transform d : Source!Domain
	to d : Target!Domain{
		
	new Target!Element2;
	--new Target!SubDomain2::Element2;
	
}

This ETL works just fine but when you use the commented statement (the qualified path to Element2) you get this error:


Buildfile: /Users/henning/Documents/workspaces/diplom/my.example/launch .xml

loadModels:

main:
[epsilon.etl - exampleTrafo.etl] EXCEPTION: Type 'Target!SubDomain2::Element2' not found (/Users/henning/Documents/workspaces/diplom/my.example/exampleTrafo.etl@6:19)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.epsilon.eol.execute.TypeExecutor.execute(TypeExe cutor.java:96)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E xecutorFactory.java:179)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.epsilon.eol.execute.NewExecutor.execute(NewExecu tor.java:26)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E xecutorFactory.java:179)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.epsilon.eol.execute.StatementBlockExecutor.execu te(StatementBlockExecutor.java:33)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E xecutorFactory.java:179)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.epsilon.etl.TransformRule.executeSuperRulesAndBo dy(TransformRule.java:254)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.epsilon.etl.TransformRule.transform(TransformRul e.java:197)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.epsilon.etl.strategy.FastTransformationStrategy. executeTransformations(FastTransformationStrategy.java:165)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.epsilon.etl.strategy.FastTransformationStrategy. transformModels(FastTransformationStrategy.java:157)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.epsilon.etl.EtlModule.execute(EtlModule.java:186 )
[epsilon.etl - exampleTrafo.etl] at org.eclipse.epsilon.workflow.tasks.ExecutableModuleTask.exec uteImpl(ExecutableModuleTask.java:115)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.epsilon.workflow.tasks.EpsilonTask.execute(Epsil onTask.java:41)
[epsilon.etl - exampleTrafo.etl] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:288)
[epsilon.etl - exampleTrafo.etl] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[epsilon.etl - exampleTrafo.etl] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
[epsilon.etl - exampleTrafo.etl] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
[epsilon.etl - exampleTrafo.etl] at java.lang.reflect.Method.invoke(Method.java:597)
[epsilon.etl - exampleTrafo.etl] at org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch Utils.java:106)
[epsilon.etl - exampleTrafo.etl] at org.apache.tools.ant.Task.perform(Task.java:348)
[epsilon.etl - exampleTrafo.etl] at org.apache.tools.ant.Target.execute(Target.java:357)
[epsilon.etl - exampleTrafo.etl] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[epsilon.etl - exampleTrafo.etl] at org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1337)
[epsilon.etl - exampleTrafo.etl] at org.apache.tools.ant.Project.executeTarget(Project.java:1306 )
[epsilon.etl - exampleTrafo.etl] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D efaultExecutor.java:41)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.exe cuteTargets(EclipseDefaultExecutor.java:32)
[epsilon.etl - exampleTrafo.etl] at org.apache.tools.ant.Project.executeTargets(Project.java:118 9)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:662)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:495)
[epsilon.etl - exampleTrafo.etl] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[epsilon.etl - exampleTrafo.etl] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
[epsilon.etl - exampleTrafo.etl] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
[epsilon.etl - exampleTrafo.etl] at java.lang.reflect.Method.invoke(Method.java:597)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:378)
[epsilon.etl - exampleTrafo.etl] at org.eclipse.ant.internal.launching.launchConfigurations.AntL aunchDelegate$1.run(AntLaunchDelegate.java:298)
[epsilon.etl - exampleTrafo.etl] at java.lang.Thread.run(Thread.java:637)

BUILD FAILED
/Users/henning/Documents/workspaces/diplom/my.example/launch .xml:36: Type 'Target!SubDomain2::Element2' not found (/Users/henning/Documents/workspaces/diplom/my.example/exampleTrafo.etl@6:19)

Total time: 263 milliseconds

I'm grateful for any hints!

Henning

[Updated on: Sat, 16 October 2010 16:10]

Report message to a moderator

Re: [ETL] Accessing packages [message #633384 is a reply to message #633358] Sun, 17 October 2010 05:32 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Henning,

The commented out line should be

new Target!suppresswarnings::SubDomain2::Element2;

instead of

new Target!SubDomain2::Element2;

Cheers,
Dimitris

Henning wrote:
> Hi Dimitiris,
>
> I didn't know about the flatten path - so that is the explanation why it
> works that way. However, I was not able to use the full qualified path
> to reach my subpackages. For demonstration purposes I put together a
> minimalistic example and uploaded the whole project to my Dropbox folder
> "epsilon". You can get
> http://dl.dropbox.com/u/4358814/epsilon/my.example.zip Please take a
> look and tell where I'm mistaken. The ETL looks like this:
> rule exampleTrafo
> transform d : Source!Domain
> to d : Target!Domain{
>
> new Target!Element2;
> --new Target!SubDomain2::Element2;
>
> }
> This ETL works just fine but when you use the commented statement (the
> qualified path to Element2) you get this error:
>
>
> Buildfile: /Users/henning/Documents/workspaces/diplom/my.example/launch
> .xml
>
> loadModels:
>
> main:
> [epsilon.etl - exampleTrafo.etl] EXCEPTION: Type
> 'Target!SubDomain2::Element2' not found
> (/Users/henning/Documents/workspaces/diplom/my.example/mailt o:exampleTrafo.etl@6:19)
>
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.epsilon.eol.execute.TypeExecutor.execute(TypeExe cutor.java:96)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E
> xecutorFactory.java:179)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.epsilon.eol.execute.NewExecutor.execute(NewExecu tor.java:26)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E
> xecutorFactory.java:179)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.epsilon.eol.execute.StatementBlockExecutor.execu
> te(StatementBlockExecutor.java:33)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E
> xecutorFactory.java:179)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.epsilon.etl.TransformRule.executeSuperRulesAndBo
> dy(TransformRule.java:254)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.epsilon.etl.TransformRule.transform(TransformRul e.java:197)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.epsilon.etl.strategy.FastTransformationStrategy.
> executeTransformations(FastTransformationStrategy.java:165)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.epsilon.etl.strategy.FastTransformationStrategy.
> transformModels(FastTransformationStrategy.java:157)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.epsilon.etl.EtlModule.execute(EtlModule.java:186 )
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.epsilon.workflow.tasks.ExecutableModuleTask.exec
> uteImpl(ExecutableModuleTask.java:115)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.epsilon.workflow.tasks.EpsilonTask.execute(Epsil
> onTask.java:41)
> [epsilon.etl - exampleTrafo.etl] at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:288)
> [epsilon.etl - exampleTrafo.etl] at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [epsilon.etl - exampleTrafo.etl] at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
> ssorImpl.java:39)
> [epsilon.etl - exampleTrafo.etl] at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
> thodAccessorImpl.java:25)
> [epsilon.etl - exampleTrafo.etl] at
> java.lang.reflect.Method.invoke(Method.java:597)
> [epsilon.etl - exampleTrafo.etl] at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch
> Utils.java:106)
> [epsilon.etl - exampleTrafo.etl] at
> org.apache.tools.ant.Task.perform(Task.java:348)
> [epsilon.etl - exampleTrafo.etl] at
> org.apache.tools.ant.Target.execute(Target.java:357)
> [epsilon.etl - exampleTrafo.etl] at
> org.apache.tools.ant.Target.performTasks(Target.java:385)
> [epsilon.etl - exampleTrafo.etl] at
> org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1337)
> [epsilon.etl - exampleTrafo.etl] at
> org.apache.tools.ant.Project.executeTarget(Project.java:1306 )
> [epsilon.etl - exampleTrafo.etl] at
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D
> efaultExecutor.java:41)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.exe
> cuteTargets(EclipseDefaultExecutor.java:32)
> [epsilon.etl - exampleTrafo.etl] at
> org.apache.tools.ant.Project.executeTargets(Project.java:118 9)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte
> rnalAntRunner.java:662)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte
> rnalAntRunner.java:495)
> [epsilon.etl - exampleTrafo.etl] at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [epsilon.etl - exampleTrafo.etl] at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
> ssorImpl.java:39)
> [epsilon.etl - exampleTrafo.etl] at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
> thodAccessorImpl.java:25)
> [epsilon.etl - exampleTrafo.etl] at
> java.lang.reflect.Method.invoke(Method.java:597)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.ant.core.AntRunner.run(AntRunner.java:378)
> [epsilon.etl - exampleTrafo.etl] at
> org.eclipse.ant.internal.launching.launchConfigurations.AntL
> aunchDelegate$1.run(AntLaunchDelegate.java:298)
> [epsilon.etl - exampleTrafo.etl] at
> java.lang.Thread.run(Thread.java:637)
>
> BUILD FAILED
> /Users/henning/Documents/workspaces/diplom/my.example/launch .xml:36:
> Type 'Target!SubDomain2::Element2' not found
> (/Users/henning/Documents/workspaces/diplom/my.example/mailt o:exampleTrafo.etl@6:19)
>
>
> Total time: 263 milliseconds
>
> I grateful for any hints!
>
> Henning
>
Re: [ETL] Accessing packages [message #633387 is a reply to message #633384] Sun, 17 October 2010 06:26 Go to previous message
Henning is currently offline Henning
Messages: 32
Registered: October 2010
Member
Hi Dimitris,

thanks for straightening this out for me - I hope I finally got your point Wink
Previous Topic:accessing eContainer and other e* properties
Next Topic:Switch-case Return
Goto Forum:
  


Current Time: Wed Aug 27 23:13:17 EDT 2014

Powered by FUDForum. Page generated in 0.02116 seconds