Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » [MOFScript] Problem with executing MOFScript programmatically
[MOFScript] Problem with executing MOFScript programmatically [message #385321] Tue, 02 September 2008 13:26 Go to next message
Eclipse User
Originally posted by: Stefan.Warwas.freenet.de

Hello,

I am developing an Eclipse plug-in that executes a MOFScript
transformation on a selected model to generate source code.
Unfortunately, I have the following problem: The transformation
consists of several m2t files that are imported by the main m2t file. If
I start a new instance of Eclipse to test the plug-in, the
transformation sometimes works and sometimes not (without changing
anything). The transformation always executes the main m2t file, but
(sometimes) the imported m2t files can not be resolved. If I export the
plug-in and copy it to another Eclipse's plugin folder, only the main
m2t file is executed (the imported ones never). The error message is:

#Runtime Error in FunctionCallEvaluator:# Unknown function ...

I followed the MOFScript User Guide 0.6 to execute the transformation
programmatically. I checked the compile path etc. but I could not find
the problem. ParserUtil does not complain about the imports. As far as I
understood I just have to invoke the ParserUtil with the main m2t file,
right? The examples I found considered only one m2t file without imports.

Perhaps somebody can give me some hints how to solve this problem. Thanks!

Regards,

Stefan
Re: [MOFScript] Problem with executing MOFScript programmatically [message #385359 is a reply to message #385321] Wed, 10 September 2008 13:11 Go to previous messageGo to next message
Eclipse User
Originally posted by: Stefan.Warwas.freenet.de

Hello,

I think the problem is caused by a wrong compile path. How do I have to
set the compile-path of ParserUtil when I want to load a transformation
that is stored inside a plug-in? Somehow ParserUtil can not resolve the
imports if I determine the compile path with the FileLocator inside the
plug-in. For example:

C:\eclipse\configuration\org.eclipse.osgi\bundles\586\1\.cp\ transformations\jademm2java

If I pass a static path like C:\transformations\jademm2java it works.

Regards,

Stefan




Stefan Warwas schrieb:
> Hello,
>
> I am developing an Eclipse plug-in that executes a MOFScript
> transformation on a selected model to generate source code.
> Unfortunately, I have the following problem: The transformation
> consists of several m2t files that are imported by the main m2t file. If
> I start a new instance of Eclipse to test the plug-in, the
> transformation sometimes works and sometimes not (without changing
> anything). The transformation always executes the main m2t file, but
> (sometimes) the imported m2t files can not be resolved. If I export the
> plug-in and copy it to another Eclipse's plugin folder, only the main
> m2t file is executed (the imported ones never). The error message is:
>
> #Runtime Error in FunctionCallEvaluator:# Unknown function ...
>
> I followed the MOFScript User Guide 0.6 to execute the transformation
> programmatically. I checked the compile path etc. but I could not find
> the problem. ParserUtil does not complain about the imports. As far as I
> understood I just have to invoke the ParserUtil with the main m2t file,
> right? The examples I found considered only one m2t file without imports.
>
> Perhaps somebody can give me some hints how to solve this problem. Thanks!
>
> Regards,
>
> Stefan
Re: [MOFScript] Problem with executing MOFScript programmatically [message #621769 is a reply to message #385321] Wed, 10 September 2008 13:11 Go to previous messageGo to next message
Eclipse User
Originally posted by: Stefan.Warwas.freenet.de

Hello,

I think the problem is caused by a wrong compile path. How do I have to
set the compile-path of ParserUtil when I want to load a transformation
that is stored inside a plug-in? Somehow ParserUtil can not resolve the
imports if I determine the compile path with the FileLocator inside the
plug-in. For example:

C:\eclipse\configuration\org.eclipse.osgi\bundles\586\1\.cp\ transformations\jademm2java

If I pass a static path like C:\transformations\jademm2java it works.

Regards,

Stefan




Stefan Warwas schrieb:
> Hello,
>
> I am developing an Eclipse plug-in that executes a MOFScript
> transformation on a selected model to generate source code.
> Unfortunately, I have the following problem: The transformation
> consists of several m2t files that are imported by the main m2t file. If
> I start a new instance of Eclipse to test the plug-in, the
> transformation sometimes works and sometimes not (without changing
> anything). The transformation always executes the main m2t file, but
> (sometimes) the imported m2t files can not be resolved. If I export the
> plug-in and copy it to another Eclipse's plugin folder, only the main
> m2t file is executed (the imported ones never). The error message is:
>
> #Runtime Error in FunctionCallEvaluator:# Unknown function ...
>
> I followed the MOFScript User Guide 0.6 to execute the transformation
> programmatically. I checked the compile path etc. but I could not find
> the problem. ParserUtil does not complain about the imports. As far as I
> understood I just have to invoke the ParserUtil with the main m2t file,
> right? The examples I found considered only one m2t file without imports.
>
> Perhaps somebody can give me some hints how to solve this problem. Thanks!
>
> Regards,
>
> Stefan
Re: [MOFScript] Problem with executing MOFScript programmatically [message #633720 is a reply to message #621769] Tue, 19 October 2010 06:24 Go to previous message
Adrian Noguero is currently offline Adrian Noguero
Messages: 18
Registered: July 2009
Junior Member
Dear Stefan,

Indeed you need to set-up correctly the compile path as you suggested in your previous message.

In order to locate files stored inside a Plugin you have to make sure that those files are included in the plug-in bundle, by including them in the build tab of your plugin.

Then you can access files in plugins using the FileLocator class in Eclipse.

I hope this helps!

Regards,

Adrian
Previous Topic:[Epsilon] Using ETL transform models which are based on UML Profiles
Next Topic:Re: oaw: Error in xtend-Editor
Goto Forum:
  


Current Time: Wed Oct 22 22:00:12 GMT 2014

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

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