Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [qvto]how to run qvto stand-along(how to run qvto stand-along)
[qvto]how to run qvto stand-along [message #846525] Mon, 16 April 2012 06:21 Go to next message
Allen Zhang is currently offline Allen ZhangFriend
Messages: 14
Registered: February 2012
Junior Member
Hi, now I do my transformation within eclipse. How can I write a stand along Java project, the input is the source model and the output is the target model?Is there a jar library or else?Is there a sample project?
Thank you very much.
Re: [qvto]how to run qvto stand-along [message #846700 is a reply to message #846525] Mon, 16 April 2012 08:57 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

See http://www.eclipse.org/forums/index.php/mv/msg/299364/807941/#msg_807941

Regards

Ed Willink


On 16/04/2012 07:21, Allen Zhang wrote:
> Hi, now I do my transformation within eclipse. How can I write a stand
> along Java project, the input is the source model and the output is
> the target model?Is there a jar library or else?Is there a sample
> project?
> Thank you very much.
Re: [qvto]how to run qvto stand-along [message #853264 is a reply to message #846700] Sun, 22 April 2012 22:14 Go to previous messageGo to next message
Allen Zhang is currently offline Allen ZhangFriend
Messages: 14
Registered: February 2012
Junior Member
Hi, thank you very much.

Where can I find the latest codes of qvto?I download from eclipse website, but there is no plugin.xml for qvto.I want to read the codes after I select the source, target in the UI and before you call the executer.


Edward Willink wrote on Mon, 16 April 2012 04:57
Hi

See ...

Regards

Ed Willink


On 16/04/2012 07:21, Allen Zhang wrote:
> Hi, now I do my transformation within eclipse. How can I write a stand
> along Java project, the input is the source model and the output is
> the target model?Is there a jar library or else?Is there a sample
> project?
> Thank you very much.
Re: [qvto]how to run qvto stand-along [message #853584 is a reply to message #853264] Mon, 23 April 2012 06:28 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Your questions make little sense.

There are many QVTo plugins, not all of which need plugin.xml.

Your last sentence has a bewildering mix of concepts.

Regards

Ed Willink


On 22/04/2012 23:14, Allen Zhang wrote:
> Hi, thank you very much.
>
> Where can I find the latest codes of qvto?I download from eclipse
> website, but there is no plugin.xml for qvto.I want to read the codes
> after I select the source, target in the UI and before you call the
> executer.
>
>
> Edward Willink wrote on Mon, 16 April 2012 04:57
>> Hi
>>
>> See ...
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 16/04/2012 07:21, Allen Zhang wrote:
>> > Hi, now I do my transformation within eclipse. How can I write a
>> stand > along Java project, the input is the source model and the
>> output is > the target model?Is there a jar library or else?Is there
>> a sample > project?
>> > Thank you very much.
>
Re: [qvto]how to run qvto stand-along [message #855227 is a reply to message #853584] Tue, 24 April 2012 16:16 Go to previous messageGo to next message
Allen Zhang is currently offline Allen ZhangFriend
Messages: 14
Registered: February 2012
Junior Member
Hi, sorry for my silly question, as I have no experience on developing EMF or Eclipse Plug-in project before.
Now I come into another problem, I got an exception:
java.lang.IllegalArgumentException: resolve against non-hierarchical or relative base
at org.eclipse.emf.common.util.URI.resolve(URI.java:1950)
at org.eclipse.emf.common.util.URI.resolve(URI.java:1923)
at org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.doResolveUnit(URIUnitResolver.java:105)
at org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.doResolveUnit(URIUnitResolver.java:87)
at org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.getUnit(URIUnitResolver.java:127)
at org.eclipse.m2m.internal.qvt.oml.compiler.UnitResolverFactory$BasicRegistry$1.findUnit(UnitResolverFactory.java:89)
at org.eclipse.m2m.internal.qvt.oml.compiler.UnitResolverFactory$BasicRegistry.getUnit(UnitResolverFactory.java:120)
at org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.doLoad(InternalTransformationExecutor.java:231)
at org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.loadTransformation(InternalTransformationExecutor.java:119)
at org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.execute(InternalTransformationExecutor.java:163)
at org.eclipse.m2m.qvt.oml.TransformationExecutor.execute(TransformationExecutor.java:88)

Do you have any suggestions about this exception?

Really thank you very much.

Edward Willink wrote on Mon, 23 April 2012 02:28
Hi

Your questions make little sense.

There are many QVTo plugins, not all of which need plugin.xml.

Your last sentence has a bewildering mix of concepts.

Regards

Ed Willink


On 22/04/2012 23:14, Allen Zhang wrote:
> Hi, thank you very much.
>
> Where can I find the latest codes of qvto?I download from eclipse
> website, but there is no plugin.xml for qvto.I want to read the codes
> after I select the source, target in the UI and before you call the
> executer.
>
>
> Edward Willink wrote on Mon, 16 April 2012 04:57
>> Hi
>>
>> See ...
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 16/04/2012 07:21, Allen Zhang wrote:
>> > Hi, now I do my transformation within eclipse. How can I write a
>> stand > along Java project, the input is the source model and the
>> output is > the target model?Is there a jar library or else?Is there
>> a sample > project?
>> > Thank you very much.
>
Re: [qvto]how to run qvto stand-along [message #855239 is a reply to message #855227] Tue, 24 April 2012 16:22 Go to previous messageGo to next message
Alan McMorran is currently offline Alan McMorranFriend
Messages: 55
Registered: July 2009
Member
If you have no experience doing EMF or Eclipse Plug-in project you're
really diving into the deepend trying to do standalone headless QVTo
then… The error below tells us very little other than your URI is
incorrect. What is the URI you are putting in and how are you creating
it? Without even basic information like that it's very hard to provide
any meaningful help.

On 2012-04-24 16:16:48 +0000, Allen Zhang said:

> Hi, sorry for my silly question, as I have no experience on developing
> EMF or Eclipse Plug-in project before.
> Now I come into another problem, I got an exception:
> java.lang.IllegalArgumentException: resolve against non-hierarchical or
> relative base
> at org.eclipse.emf.common.util.URI.resolve(URI.java:1950)
> at org.eclipse.emf.common.util.URI.resolve(URI.java:1923)
> at
> org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.doResolveUnit(URIUnitResolver.java:105)
>
> at
> org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.doResolveUnit(URIUnitResolver.java:87)
>
> at
> org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.getUnit(URIUnitResolver.java:127)
>
> at
> org.eclipse.m2m.internal.qvt.oml.compiler.UnitResolverFactory$BasicRegistry$1.findUnit(UnitResolverFactory.java:89)
>
> at
> org.eclipse.m2m.internal.qvt.oml.compiler.UnitResolverFactory$BasicRegistry.getUnit(UnitResolverFactory.java:120)
>
> at
> org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.doLoad(InternalTransformationExecutor.java:231)
>
> at
> org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.loadTransformation(InternalTransformationExecutor.java:119)
>
> at
> org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.execute(InternalTransformationExecutor.java:163)
>
> at
> org.eclipse.m2m.qvt.oml.TransformationExecutor.execute(TransformationExecutor.java:88)
>
>
> Do you have any suggestions about this exception?
> Really thank you very much.
>
> Edward Willink wrote on Mon, 23 April 2012 02:28
>> Hi
>>
>> Your questions make little sense.
>>
>> There are many QVTo plugins, not all of which need plugin.xml.
>>
>> Your last sentence has a bewildering mix of concepts.
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 22/04/2012 23:14, Allen Zhang wrote:
>>> Hi, thank you very much.
>>>
>>> Where can I find the latest codes of qvto?I download from eclipse
>>> website, but there is no plugin.xml for qvto.I want to read the codes
>>> after I select the source, target in the UI and before you call the
>>> executer.
>>>
>>>
>>> Edward Willink wrote on Mon, 16 April 2012 04:57
>>>> Hi
>>>>
>>>> See ...
>>>>
>>>> Regards
>>>>
>>>> Ed Willink
>>>>
>>>>
>>>> On 16/04/2012 07:21, Allen Zhang wrote:
>>>>> Hi, now I do my transformation within eclipse. How can I write a
>>>> stand > along Java project, the input is the source model and the
>>>> output is > the target model?Is there a jar library or else?Is there a
>>>> sample > project?
>>>>> Thank you very much.
Re: [qvto]how to run qvto stand-along [message #855246 is a reply to message #855239] Tue, 24 April 2012 16:29 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

To gain some relevant experience, you might try to write a tiny Java
transformation that loads your input file, resolving URIs correctly,
traverses the model tree converting all "name" attributes to upper case,
then saves the resulting resource to a distinct URI; again, verifying
the utility of your output file names.

Regards

Ed Willink

On 24/04/2012 17:22, Alan McMorran wrote:
> If you have no experience doing EMF or Eclipse Plug-in project you're
> really diving into the deepend trying to do standalone headless QVTo
> then… The error below tells us very little other than your URI is
> incorrect. What is the URI you are putting in and how are you creating
> it? Without even basic information like that it's very hard to provide
> any meaningful help.
>
> On 2012-04-24 16:16:48 +0000, Allen Zhang said:
>
>> Hi, sorry for my silly question, as I have no experience on
>> developing EMF or Eclipse Plug-in project before.
>> Now I come into another problem, I got an exception:
>> java.lang.IllegalArgumentException: resolve against non-hierarchical
>> or relative base
>> at org.eclipse.emf.common.util.URI.resolve(URI.java:1950)
>> at org.eclipse.emf.common.util.URI.resolve(URI.java:1923)
>> at
>> org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.doResolveUnit(URIUnitResolver.java:105)
>>
>> at
>> org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.doResolveUnit(URIUnitResolver.java:87)
>>
>> at
>> org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.getUnit(URIUnitResolver.java:127)
>>
>> at
>> org.eclipse.m2m.internal.qvt.oml.compiler.UnitResolverFactory$BasicRegistry$1.findUnit(UnitResolverFactory.java:89)
>>
>> at
>> org.eclipse.m2m.internal.qvt.oml.compiler.UnitResolverFactory$BasicRegistry.getUnit(UnitResolverFactory.java:120)
>>
>> at
>> org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.doLoad(InternalTransformationExecutor.java:231)
>>
>> at
>> org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.loadTransformation(InternalTransformationExecutor.java:119)
>>
>> at
>> org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.execute(InternalTransformationExecutor.java:163)
>>
>> at
>> org.eclipse.m2m.qvt.oml.TransformationExecutor.execute(TransformationExecutor.java:88)
>>
>>
>> Do you have any suggestions about this exception?
>> Really thank you very much.
>>
>> Edward Willink wrote on Mon, 23 April 2012 02:28
>>> Hi
>>>
>>> Your questions make little sense.
>>>
>>> There are many QVTo plugins, not all of which need plugin.xml.
>>>
>>> Your last sentence has a bewildering mix of concepts.
>>>
>>> Regards
>>>
>>> Ed Willink
>>>
>>>
>>> On 22/04/2012 23:14, Allen Zhang wrote:
>>>> Hi, thank you very much.
>>>>
>>>> Where can I find the latest codes of qvto?I download from eclipse
>>>> website, but there is no plugin.xml for qvto.I want to read the
>>>> codes after I select the source, target in the UI and before you
>>>> call the executer.
>>>>
>>>>
>>>> Edward Willink wrote on Mon, 16 April 2012 04:57
>>>>> Hi
>>>>>
>>>>> See ...
>>>>>
>>>>> Regards
>>>>>
>>>>> Ed Willink
>>>>>
>>>>>
>>>>> On 16/04/2012 07:21, Allen Zhang wrote:
>>>>>> Hi, now I do my transformation within eclipse. How can I write a
>>>>> stand > along Java project, the input is the source model and the
>>>>> output is > the target model?Is there a jar library or else?Is
>>>>> there a sample > project?
>>>>>> Thank you very much.
>
>
>
Re: [qvto]how to run qvto stand-along [message #856183 is a reply to message #855239] Wed, 25 April 2012 12:50 Go to previous messageGo to next message
Allen Zhang is currently offline Allen ZhangFriend
Messages: 14
Registered: February 2012
Junior Member
Hi, thanks for your reply.
I tried a demo plug-in project and it works OK, because I don't need to register the EMF model myself.
I get source model resource by:
URI bpel = URI.createPlatformResourceURI("/ModelTransformation/source/searchProcess.bpel", true);
Resource bpelResource = new ResourceSetImpl().getResource(bpel, true);
"ModelTransformation" is a project under the run-time workspace

I get qvto file by:
String pluginURIPrefix = "/" + Activator.PLUGIN_ID;
URI transformationURI = URI.createPlatformPluginURI(pluginURIPrefix + "/m/transformation1.qvto", true);

For transformationURI, I tried createPlatformResourceURI like before and createURI by absolute path, but not work. I'm sure the path is right. I don't understand why it doesn't work.

For me, it's good enough to run it in a plug-in project. But I still want to get it work standalone.
I tried this:
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bpel", new BPELResourceFactoryImpl());
resourceSet.getPackageRegistry().put(BPELPackage.eINSTANCE.getNsURI(), BPELPackage.eINSTANCE);
URI bpelURI = URI.createURI("/Users/Allen/Documents/workspace/Test/test.bpel");
URI transformationURI = URI.createURI("/Users/Allen/Documents/workspace/Test/BpelTest.qvto", true);
TransformationExecutor executor = new TransformationExecutor(transformationURI);

But exception: java.lang.IllegalArgumentException: resolve against non-hierarchical or relative base
I tried createPlatformResourceURI or some else, but none worked.


Alan McMorran wrote on Tue, 24 April 2012 12:22
If you have no experience doing EMF or Eclipse Plug-in project you're
really diving into the deepend trying to do standalone headless QVTo
then... The error below tells us very little other than your URI is
incorrect. What is the URI you are putting in and how are you creating
it? Without even basic information like that it's very hard to provide
any meaningful help.

[Updated on: Wed, 25 April 2012 12:51]

Report message to a moderator

Re: [qvto]how to run qvto stand-along [message #856187 is a reply to message #855246] Wed, 25 April 2012 12:56 Go to previous messageGo to next message
Allen Zhang is currently offline Allen ZhangFriend
Messages: 14
Registered: February 2012
Junior Member
Hi, thanks for your reply.
I tried a demo plug-in project and it works ok. After that I also tried standalone project, but still not work.
Please read my last reply to Alan McMorran.
Thank you very much.


Edward Willink wrote on Tue, 24 April 2012 12:29
Hi

To gain some relevant experience, you might try to write a tiny Java
transformation that loads your input file, resolving URIs correctly,
traverses the model tree converting all "name" attributes to upper case,
then saves the resulting resource to a distinct URI; again, verifying
the utility of your output file names.

Regards

Ed Willink

On 24/04/2012 17:22, Alan McMorran wrote:
> If you have no experience doing EMF or Eclipse Plug-in project you're
> really diving into the deepend trying to do standalone headless QVTo
> then... The error below tells us very little other than your URI is
> incorrect. What is the URI you are putting in and how are you creating
> it? Without even basic information like that it's very hard to provide
> any meaningful help.
>
> On 2012-04-24 16:16:48 +0000, Allen Zhang said:
>
>> Hi, sorry for my silly question, as I have no experience on
>> developing EMF or Eclipse Plug-in project before.
>> Now I come into another problem, I got an exception:
>> java.lang.IllegalArgumentException: resolve against non-hierarchical
>> or relative base
>> at org.eclipse.emf.common.util.URI.resolve(URI.java:1950)
>> at org.eclipse.emf.common.util.URI.resolve(URI.java:1923)
>> at
>> org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.doResolveUnit(URIUnitResolver.java:105)
>>
>> at
>> org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.doResolveUnit(URIUnitResolver.java:87)
>>
>> at
>> org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.getUnit(URIUnitResolver.java:127)
>>
>> at
>> org.eclipse.m2m.internal.qvt.oml.compiler.UnitResolverFactory$BasicRegistry$1.findUnit(UnitResolverFactory.java:89)
>>
>> at
>> org.eclipse.m2m.internal.qvt.oml.compiler.UnitResolverFactory$BasicRegistry.getUnit(UnitResolverFactory.java:120)
>>
>> at
>> org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.doLoad(InternalTransformationExecutor.java:231)
>>
>> at
>> org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.loadTransformation(InternalTransformationExecutor.java:119)
>>
>> at
>> org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.execute(InternalTransformationExecutor.java:163)
>>
>> at
>> org.eclipse.m2m.qvt.oml.TransformationExecutor.execute(TransformationExecutor.java:88)
>>
>>
>> Do you have any suggestions about this exception?
>> Really thank you very much.
>>
>> Edward Willink wrote on Mon, 23 April 2012 02:28
>>> Hi
>>>
>>> Your questions make little sense.
>>>
>>> There are many QVTo plugins, not all of which need plugin.xml.
>>>
>>> Your last sentence has a bewildering mix of concepts.
>>>
>>> Regards
>>>
>>> Ed Willink
>>>
>>>
>>> On 22/04/2012 23:14, Allen Zhang wrote:
>>>> Hi, thank you very much.
>>>>
>>>> Where can I find the latest codes of qvto?I download from eclipse
>>>> website, but there is no plugin.xml for qvto.I want to read the
>>>> codes after I select the source, target in the UI and before you
>>>> call the executer.
>>>>
>>>>
>>>> Edward Willink wrote on Mon, 16 April 2012 04:57
>>>>> Hi
>>>>>
>>>>> See ...
>>>>>
>>>>> Regards
>>>>>
>>>>> Ed Willink
>>>>>
>>>>>
>>>>> On 16/04/2012 07:21, Allen Zhang wrote:
>>>>>> Hi, now I do my transformation within eclipse. How can I write a
>>>>> stand > along Java project, the input is the source model and the
>>>>> output is > the target model?Is there a jar library or else?Is
>>>>> there a sample > project?
>>>>>> Thank you very much.
>
>
>
Re: [qvto]how to run qvto stand-along [message #856204 is a reply to message #856187] Wed, 25 April 2012 13:14 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Indeed; you must get standalone to work.

Which either means making relevant platform:/... URIs work, or using an
alternative file: scheme everywhere.

The former can be done using the URI_MAP global registry to map each URI
in use to a file: URI that exists. Set a breakpoint on
MalformedURLException and in EcoreUtil.resolveProxy to discover each URI
that is failing.

The latter is really hard when you have a mix of files prepared in
Eclipse that you re-use standalone.

Alternatively you can use
org.eclipse.ocl.examples.domain.utilities.StandaloneProjectMap which
will scan the classpath and read .project files and plugin.xml files to
provide all the registrations automatically.

Regards

Ed Willink





On 25/04/2012 13:56, Allen Zhang wrote:
> Hi, thanks for your reply.
> I tried a demo plug-in project and it works ok. After that I also
> tried standalone project, but still not work.
> Please read my last reply to Alan McMorran.
> Thank you very much.
>
>
> Edward Willink wrote on Tue, 24 April 2012 12:29
>> Hi
>>
>> To gain some relevant experience, you might try to write a tiny Java
>> transformation that loads your input file, resolving URIs correctly,
>> traverses the model tree converting all "name" attributes to upper
>> case, then saves the resulting resource to a distinct URI; again,
>> verifying the utility of your output file names.
>>
>> Regards
>>
>> Ed Willink
>>
>> On 24/04/2012 17:22, Alan McMorran wrote:
>> > If you have no experience doing EMF or Eclipse Plug-in project
>> you're > really diving into the deepend trying to do standalone
>> headless QVTo > then... The error below tells us very little other
>> than your URI is > incorrect. What is the URI you are putting in and
>> how are you creating > it? Without even basic information like that
>> it's very hard to provide > any meaningful help.
>> >
>> > On 2012-04-24 16:16:48 +0000, Allen Zhang said:
>> >
>> >> Hi, sorry for my silly question, as I have no experience on >>
>> developing EMF or Eclipse Plug-in project before.
>> >> Now I come into another problem, I got an exception:
>> >> java.lang.IllegalArgumentException: resolve against
>> non-hierarchical >> or relative base
>> >> at org.eclipse.emf.common.util.URI.resolve(URI.java:1950)
>> >> at org.eclipse.emf.common.util.URI.resolve(URI.java:1923)
>> >> at >>
>> org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.doResolveUnit(URIUnitResolver.java:105)
>> >>
>> >> at >>
>> org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.doResolveUnit(URIUnitResolver.java:87)
>> >>
>> >> at >>
>> org.eclipse.m2m.internal.qvt.oml.compiler.URIUnitResolver.getUnit(URIUnitResolver.java:127)
>> >>
>> >> at >>
>> org.eclipse.m2m.internal.qvt.oml.compiler.UnitResolverFactory$BasicRegistry$1.findUnit(UnitResolverFactory.java:89)
>> >>
>> >> at >>
>> org.eclipse.m2m.internal.qvt.oml.compiler.UnitResolverFactory$BasicRegistry.getUnit(UnitResolverFactory.java:120)
>> >>
>> >> at >>
>> org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.doLoad(InternalTransformationExecutor.java:231)
>> >>
>> >> at >>
>> org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.loadTransformation(InternalTransformationExecutor.java:119)
>> >>
>> >> at >>
>> org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.execute(InternalTransformationExecutor.java:163)
>> >>
>> >> at >>
>> org.eclipse.m2m.qvt.oml.TransformationExecutor.execute(TransformationExecutor.java:88)
>> >>
>> >>
>> >> Do you have any suggestions about this exception?
>> >> Really thank you very much.
>> >>
>> >> Edward Willink wrote on Mon, 23 April 2012 02:28
>> >>> Hi
>> >>>
>> >>> Your questions make little sense.
>> >>>
>> >>> There are many QVTo plugins, not all of which need plugin.xml.
>> >>>
>> >>> Your last sentence has a bewildering mix of concepts.
>> >>>
>> >>> Regards
>> >>>
>> >>> Ed Willink
>> >>>
>> >>>
>> >>> On 22/04/2012 23:14, Allen Zhang wrote:
>> >>>> Hi, thank you very much.
>> >>>>
>> >>>> Where can I find the latest codes of qvto?I download from
>> eclipse >>>> website, but there is no plugin.xml for qvto.I want to
>> read the >>>> codes after I select the source, target in the UI and
>> before you >>>> call the executer.
>> >>>>
>> >>>>
>> >>>> Edward Willink wrote on Mon, 16 April 2012 04:57
>> >>>>> Hi
>> >>>>>
>> >>>>> See ...
>> >>>>>
>> >>>>> Regards
>> >>>>>
>> >>>>> Ed Willink
>> >>>>>
>> >>>>>
>> >>>>> On 16/04/2012 07:21, Allen Zhang wrote:
>> >>>>>> Hi, now I do my transformation within eclipse. How can I write a
>> >>>>> stand > along Java project, the input is the source model and
>> the >>>>> output is > the target model?Is there a jar library or
>> else?Is >>>>> there a sample > project?
>> >>>>>> Thank you very much.
>> >
>> >
>> >
>
Re: [qvto]how to run qvto stand-along [message #856742 is a reply to message #856183] Wed, 25 April 2012 23:56 Go to previous message
Alan McMorran is currently offline Alan McMorranFriend
Messages: 55
Registered: July 2009
Member
> Hi, thanks for your reply.
> I tried a demo plug-in project and it works OK, because I don't need to
> register the EMF model myself.
> I get source model resource by:
> URI bpel =
> URI.createPlatformResourceURI("/ModelTransformation/source/searchProcess.bpel",
> true);
> Resource bpelResource = new ResourceSetImpl().getResource(bpel, true);
> "ModelTransformation" is a project under the run-time workspace
>
> I get qvto file by:
> String pluginURIPrefix = "/" + Activator.PLUGIN_ID; URI
> transformationURI = URI.createPlatformPluginURI(pluginURIPrefix +
> "/m/transformation1.qvto", true);
>
> For transformationURI, I tried createPlatformResourceURI like before
> and createURI by absolute path, but not work. I'm sure the path is
> right. I don't understand why it doesn't work.

I'm confused in the line above you have:
URI transformationURI = URI.createPlatformPluginURI(pluginURIPrefix +
"/m/transformation1.qvto", true);

but then you're saying you tried to load it with the
createPlatformResourceURI? Is the transformation in a plugin or within
a workspace? if it's within a plugin then you should be using the
createPlatformPluginURI not createPlatformResourceURI. If it's within
the workspace, what error are you getting? Are all the plugins being
registered correctly? Are you running it within an OSGi runtime?

>
> For me, it's good enough to run it in a plug-in project. But I still
> want to get it work standalone.
> I tried this:
> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bpel",
> new BPELResourceFactoryImpl());
> resourceSet.getPackageRegistry().put(BPELPackage.eINSTANCE.getNsURI(),
> BPELPackage.eINSTANCE); URI bpelURI =
> URI.createURI("/Users/Allen/Documents/workspace/Test/test.bpel");
> URI transformationURI =
> URI.createURI("/Users/Allen/Documents/workspace/Test/BpelTest.qvto",
> true);
> TransformationExecutor executor = new
> TransformationExecutor(transformationURI);
>
> But exception: java.lang.IllegalArgumentException: resolve against
> non-hierarchical or relative base
> I tried createPlatformResourceURI or some else, but none worked.

That looks like an absolute file URI so you would need:
URI transformationURI =
URI.createFileURI("/Users/Allen/Documents/workspace/Test/BpelTest.qvto",
true);

otherwise the URI resolver has no idea what sort of URI you are
providing. Alternatively do:
URI transformationURI =
URI.createURI("file:/Users/Allen/Documents/workspace/Test/BpelTest.qvto",
true);

Saying that, I had trouble running QVTo files from anything other than
a platform or plugin URI so this may still not work.

Alan
Previous Topic:[QVTo] UnitResolverFactory weiredness
Next Topic:[QVTO] Resolve on disjunctive mapping
Goto Forum:
  


Current Time: Thu Apr 18 18:28:10 GMT 2024

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

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

Back to the top