Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Jet2 using Jet2Platform
Jet2 using Jet2Platform [message #59554] Tue, 21 April 2009 10:49 Go to next message
Eclipse UserFriend
Originally posted by: johannes.nel.gmail.com

Hi,

I execute a Jet transform successfully from my plugin, but the files do
not get written to disk.
I execute the the following code from a wizard finish event,

IRunnableWithProgress op = new IRunnableWithProgress()
{
public void run(IProgressMonitor monitor) throws
InvocationTargetException {
try
{
IStatus status =
JET2Platform.runTransformOnString("some.package.SimpleTransform ","<rxml/>",monitor);
System.out.println(status.getMessage());
}
finally
{
monitor.done();
}
}
};
try
{
getContainer().run(true, true, op);
}
catch(Exception e)
{


and I get an "execution successful" status back.

This same transformation works when I run it as a Jet Transformation.
Any hints would be handy, this has become a major hold up for me now.

TIA
JOhan
Re: Jet2 using Jet2Platform [message #59604 is a reply to message #59554] Tue, 21 April 2009 20:44 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Johannes:

You don't say what kind of model your transformation is working with.

The runTransformOnString variant you are using assumes the input is XML,
and tries to parse it as such. If your transformation is the workspace is
loading the model differently (say via EMF serialization/deserialization),
then your XPath expressions may be silently returning nothing, and your
transformation may be silently doing nothing.

Some questions:

1) how did you create the input model/file that works correctly? Is it via
EMF?

2) If unsure of #1, how about pasting the first few lines into a reply -
that will quickly sort things out...

3) thinking ahead. How are you producing the input your are trying to pass
to JET2Platform.runTransformOnString() ? Do you, by any chance, have an
EMF generated API for it? If so, we'll take a look at
runTransformOnObject, where you pass in an emf Resource object containing
your input.


Paul
Re: Jet2 using Jet2Platform [message #59820 is a reply to message #59604] Thu, 23 April 2009 10:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johannes.nel.gmail.com

Hi Paul

Paul Elder wrote:
> Johannes:
>
> You don't say what kind of model your transformation is working with.
>
> The runTransformOnString variant you are using assumes the input is XML,
> and tries to parse it as such. If your transformation is the workspace
> is loading the model differently (say via EMF
> serialization/deserialization), then your XPath expressions may be
> silently returning nothing, and your transformation may be silently
> doing nothing.
>
> Some questions:
>
> 1) how did you create the input model/file that works correctly? Is it
> via EMF?
>
Its xml which I build and is valid.
> 2) If unsure of #1, how about pasting the first few lines into a reply -
> that will quickly sort things out...
>
> 3) thinking ahead. How are you producing the input your are trying to
> pass to JET2Platform.runTransformOnString() ? Do you, by any chance,
> have an EMF generated API for it? If so, we'll take a look at
> runTransformOnObject, where you pass in an emf Resource object
> containing your input.
this is my long term goal, but currently I am linking an existing swt
wizard (create new class type) to output the string (via an adaptor),
which I then pass to the transform.

>
>
> Paul
>

I added all the code that is used already.
Its really weird, but it just does not output any files when I invoke it
from within another plugin, could there be some stupid permissions error?

Johan
Re: Jet2 using Jet2Platform [message #59843 is a reply to message #59820] Thu, 23 April 2009 11:48 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Johannes Nel wrote:

> I added all the code that is used already.
> Its really weird, but it just does not output any files when I invoke it
> from within another plugin, could there be some stupid permissions error?

> Johan

Sounds like its time for some serious debugging. What version of Eclipse
are you using, and what OS are you running on?

Also, the JET new project wizard uses pretty much the same technique. Does
that work for you?

Paul
Re: Jet2 using Jet2Platform [message #59865 is a reply to message #59843] Thu, 23 April 2009 11:52 Go to previous message
Eclipse UserFriend
Originally posted by: johannes.nel.gmail.com

Paul Elder wrote:
> Johannes Nel wrote:
>
>> I added all the code that is used already.
>> Its really weird, but it just does not output any files when I invoke
>> it from within another plugin, could there be some stupid permissions
>> error?
>
>> Johan
>
> Sounds like its time for some serious debugging. What version of Eclipse
> are you using, and what OS are you running on?
>
> Also, the JET new project wizard uses pretty much the same technique.
> Does that work for you?
>
> Paul
>
Yes, running the same file as a JET transform works, I am running OS X
10.5.6 and I have debugged already and the transforms are writing into
JetWriter.
My eclipse build is 3.4 ganymede modeling edition.
Time for a fresh build of that me thinks.
Previous Topic:Generating code from an ecore-model
Next Topic:[MTL] ecore metamodel of MTL
Goto Forum:
  


Current Time: Thu Apr 18 03:34:51 GMT 2024

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

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

Back to the top