Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [Epsilon] Standalone: imported sources(How to reference imported sources for standalone execution)
[Epsilon] Standalone: imported sources [message #669283] Mon, 09 May 2011 17:56 Go to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 155
Registered: October 2009
Senior Member

Hello,

I am running Epsilon standalone with a set of classes based on the exampled found in the repository. I have successfully ran eol, evl and egl sources. However when running a etl source something went wrong. I get no parsing errors and no execution errors, but the generated models are empty. I have ran this etl not in standalone and it works fine, i.e. models are generated ok. The only reason I can think of is the use of an import statement in my etl source:

/// 
/// This file contains the transformation rules to transform the structural
/// part of the SysML model to its representation in HiLeS. 

import "SysMLModelQueries.eol"; 		// SysML model queries 
...


When running the etl source from eclipse, the eol file is in the same location as my etl file.

My standalone application is a set of eclipse plugins. One plugin holds all the epsilon stand alone classes, and other plugins reference it for specific model operations. Since the etl, eol, egl, etc., sources are packaged with the latter set of plugin, I use the platform:plugin URI scheme to locate them and load them to the epsilon respective module. This can be seen next:

...
    EtlExecutor etlExecutor;
    try {
        etlExecutor = new EtlExecutor("platform:plugin/co.edu.uniandes.hiles.sysml/src/co/edu/uniandes/hiles/sysml/SysML2HilesStructure.etl");
    } catch (URISyntaxException e) {
        console.errln("GRAVE Error: Loading SysML to HiLeS transformation source failed. Please verify plugin instalation.");
	e.printStackTrace();
	return this;
    }


So my questions are: In this case, where does the etl(eol) module expect to find the imported resources? Is there a mechanism to load the imported resources to the module? Should I change the import string to a complete URI?

Regards,

Horacio Hoyos


Horacio Hoyos Rodriguez
EngD Student
University Of York
Re: [Epsilon] Standalone: imported sources [message #669538 is a reply to message #669283] Tue, 10 May 2011 16:13 Go to previous messageGo to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 155
Registered: October 2009
Senior Member

So,

First I was loading the wrong type of module, so my etl source was not even getting parsed. After I fixed this, I started getting errors regarding my imported eol file could not be found. From the module.getParseProblems() I get:

Parse errors occured:Line: 5, Reason: File SysMLModelQueries.eol not found


However, when looking earlier into the stack trace I saw this error:

java.io.FileNotFoundException: /src/co/edu/uniandes/hiles/sysml/SysML2HilesStructure.etlSysMLModelQueries.eol
	at org.eclipse.osgi.framework.internal.protocol.bundleentry.Handler.findBundleEntry(Handler.java:44)
	at org.eclipse.osgi.framework.internal.core.BundleResourceHandler.openConnection(BundleResourceHandler.java:175)
	at java.net.URL.openConnection(Unknown Source)
	at org.eclipse.core.internal.boot.PlatformURLConnection.connect(PlatformURLConnection.java:110)
	at org.eclipse.core.internal.boot.PlatformURLConnection.connect(PlatformURLConnection.java:91)
	at org.eclipse.core.internal.boot.PlatformURLConnection.getInputStream(PlatformURLConnection.java:229)
	at java.net.URL.openStream(Unknown Source)
	at org.eclipse.epsilon.eol.AbstractModule.parse(AbstractModule.java:103)
	at org.eclipse.epsilon.eol.EolImport.load(EolImport.java:46)


So, I guess the current etl file "full path" (in the case of standalone, cause this works fine elsewhere) is used as the based URi to locate the imported file. To fix it I changed the import statement to:

import "/../SysMLModelQueries.eol"; 


The etl editor gives me a "file not found error", but I guess I can live with it.

Is there a different approach so I could use the "normal" import statement and don't get the editor error and so that I could run the transformations during development and not having to change it between tests/deployment?

The reason could be that I load the etl source by uri and parse it as such (module.parse(URI uri))?


Horacio Hoyos Rodriguez
EngD Student
University Of York
Re: [Epsilon] Standalone: imported sources [message #669575 is a reply to message #669538] Tue, 10 May 2011 19:14 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 309
Registered: January 2010
Senior Member
Yes, the source URI is used to resolve the imports, if they are expressed as relative paths. If parse(File) is used, the full path to the source file will be used.

I noticed that you used:
platform:plugin/co.edu.uniandes.hiles.sysml/src/co/edu/uniandes/hiles/sysml/SysML2HilesStructure.et


Valid "platform" URLs should have a slash right after "platform:", as in:
platform:/plugin/co.edu.uniandes.hiles.sysml/src/co/edu/uniandes/hiles/sysml/SysML2HilesStructure.et


Did that change anything?

[Updated on: Tue, 10 May 2011 19:15]

Report message to a moderator

Re: [Epsilon] Standalone: imported sources [message #669817 is a reply to message #669575] Wed, 11 May 2011 15:57 Go to previous message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 155
Registered: October 2009
Senior Member

Antonio,

Your observation was correct! Thanks very much, now I use the "normal" import statement and everything works.


Best regards,

Horacio

P.D. Next test is with ECL and EML... I think passing the ECL trace into the EML module will definitely bring me back to the forums.


Horacio Hoyos Rodriguez
EngD Student
University Of York
Previous Topic:[EVL] Validation always fails due to a NullPointerException...
Next Topic:[Epsilon] Standalone: interactive transformations
Goto Forum:
  


Current Time: Fri Nov 28 00:39:42 GMT 2014

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

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