[Epsilon] Standalone: imported sources [message #669283] |
Mon, 09 May 2011 17:56 |
|
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
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
|
|
|
Re: [Epsilon] Standalone: imported sources [message #669538 is a reply to message #669283] |
Tue, 10 May 2011 16:13 |
|
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
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
|
|
|
Re: [Epsilon] Standalone: imported sources [message #669575 is a reply to message #669538] |
Tue, 10 May 2011 19:14 |
|
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 |
|
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
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
|
|
|
Powered by
FUDForum. Page generated in 0.03155 seconds