Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Epackage Import Example - Domainmodel to SecretCompartment(Why do I fail to import the sample DSL statemachine into sample DSL SecretCompartments. They are both included in Xtext Documentation.)
icon5.gif  Epackage Import Example - Domainmodel to SecretCompartment [message #1009042] Thu, 14 February 2013 10:31 Go to next message
Ozan Aksoy is currently offline Ozan AksoyFriend
Messages: 5
Registered: June 2012
Junior Member
Hi! I had a problem in Epackage Imports.

Actually I tried this issue on more complex projects. But, to be more clear on the forum, I used example projects State-Machine and Domain-Model.

I follow thought the Xtext Documentation. Under //The Grammar Language/The Syntax/Epackage Declarations/Epackage Imports, it explains how to import an existing Epackage. I wanted to give it a try and I tried to import Domainmodel grammar to Statemachine. From there on I follow what I understood from the documentation for Epackage imports.

I typed the nsURI of DomainModel.ecore to StateMachine.xtext as import

[...] => I typed this to avoid "You can only use links to eclipse.org sites while you have fewer than 5 messages." But I can assure you that nsURI's and links are working.
grammar org.eclipse.xtext.example.fowlerdsl.Statemachine with org.eclipse.xtext.common.Terminals

generate statemachine "[...]/xtext/example/fowlerdsl/Statemachine"
//added code
import "[...]/xtext.org/example/Domainmodel" as dmodel


and I changed the Standalone attributes and added

   bean = StandaloneSetup {
	   platformUri = "${runtimeProject}/.."
	   scanClassPath = true
//added code
	   registerGeneratedEPackage = 
	    "org.eclipse.xtext.example.domainmodel.domainmodel.DomainmodelPackage"
	   registerGenModelFile = 
	    "platform:/resource/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/domainmodel/Domainmodel.genmodel"
 }


There were no complains from the editor. Then I tried to run the workflow, and it gives:

0    [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering platform uri 'C:\PgEc\WS\Jn'
10108 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - Problems instantiating module org.eclipse.xtext.example.fowlerdsl.GenerateStatemachine: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: Problems instantiating module org.eclipse.xtext.example.fowlerdsl.GenerateStatemachine: java.lang.reflect.InvocationTargetException
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:95)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
...



I also tried other suggested methods on the same documentation section. And no luck. It seems somehow I cannot import the Epackage via
import "[...]xtext.org/example/Domainmodel" as dmodel

statement I checked the net but I couldn't find what I am doing wrong.

Your guidance is appreciated. Smile
Re: Epackage Import Example - Domainmodel to SecretCompartment [message #1009277 is a reply to message #1009042] Thu, 14 February 2013 20:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6485
Registered: July 2009
Senior Member
Hi,

a bit more stacktrace would be helpful.
never the less i blogged on something similar here http://christiandietrich.wordpress.com/2012/08/07/xtext-referencing-elements-of-one-dsl-from-another-dsl/

~Christian
Re: Epackage Import Example - Domainmodel to SecretCompartment [message #1009433 is a reply to message #1009277] Fri, 15 February 2013 06:18 Go to previous message
Ozan Aksoy is currently offline Ozan AksoyFriend
Messages: 5
Registered: June 2012
Junior Member
Thanks Christian. Your blog tutorial made me understand where I was lacking.
Previous Topic:Command line use of Xtext
Next Topic:@Check validations not being executed
Goto Forum:
  


Current Time: Sun Nov 23 05:02:26 GMT 2014

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

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