Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » How can i define a metamodel in the properties in QVT
icon5.gif  How can i define a metamodel in the properties in QVT [message #496706] Wed, 11 November 2009 05:09 Go to next message
Rahul Chandrashekar is currently offline Rahul ChandrashekarFriend
Messages: 43
Registered: July 2009
Member
I have my own metamodel and i want to register it in QVT.

The Metamodels are defined as follows:

Model for Book

metamodel BOOK {
class Chapter;
class Book {title: String; composes chapters: Sequence(Chapter);}
class Chapter {title : String; nbPages : Integer;}
}

Model for Publication

metamodel PUB {
class Publication {title : String; nbPages : Integer;}
}

Can anyone in the forum tell how this can be registered and used?.

Thanks in advance.

Rahul Chandrashekar.
Re: How can i define a metamodel in the properties in QVT [message #496748 is a reply to message #496706] Wed, 11 November 2009 09:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Rahul Chandrashekar,

You can only define intermediate classes at the moment.
Metamodel definitions embedded in QVTO source are not supported yet as
it can be done in many convenient ways outside QVTO.

For intermediate classes there is no other way, therefore it's already
supported.

Regards,
/Radek


On Wed, 11 Nov 2009 06:09:41 +0100, Rahul Chandrashekar
<rahul.chandrashekar@in.bosch.com> wrote:

> I have my own metamodel and i want to register it in QVT.
>
> The Metamodels are defined as follows:
>
> Model for Book
>
> metamodel BOOK {
> class Chapter;
> class Book {title: String; composes chapters: Sequence(Chapter);}
> class Chapter {title : String; nbPages : Integer;}
> }
>
> Model for Publication
>
> metamodel PUB {
> class Publication {title : String; nbPages : Integer;}
> }
>
> Can anyone in the forum tell how this can be registered and used?.
>
> Thanks in advance.
>
> Rahul Chandrashekar.
Re: How can i define a metamodel in the properties in QVT [message #498946 is a reply to message #496748] Thu, 19 November 2009 10:17 Go to previous messageGo to next message
Rahul Chandrashekar is currently offline Rahul ChandrashekarFriend
Messages: 43
Registered: July 2009
Member
Dear Radek,

I have one more query. Assume i will getting a model in the run time , then how can achieve this.

For example. I have a java program on which i will be getting the model. which is my input model to be transformed.

How will i achieve this?

Regds
Rahul.
Re: How can i define a metamodel in the properties in QVT [message #499105 is a reply to message #498946] Thu, 19 November 2009 21:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

On Thu, 19 Nov 2009 11:17:53 +0100, Rahul Chandrashekar
<rahul.chandrashekar@in.bosch.com> wrote:

> Dear Radek,
>
> I have one more query. Assume i will getting a model in the run time ,
> then how can achieve this.
>
> For example. I have a java program on which i will be getting the model.
> which is my input model to be transformed.
>
> How will i achieve this?
>
> Regds
> Rahul.
Re: How can i define a metamodel in the properties in QVT [message #499108 is a reply to message #498946] Thu, 19 November 2009 21:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Rahul,

I have to admit, I have no idea what your question is about ;).
Could you rephrase it little bit please?

Regards,
/Radek


On Thu, 19 Nov 2009 11:17:53 +0100, Rahul Chandrashekar
<rahul.chandrashekar@in.bosch.com> wrote:

> Dear Radek,
>
> I have one more query. Assume i will getting a model in the run time ,
> then how can achieve this.
>
> For example. I have a java program on which i will be getting the model.
> which is my input model to be transformed.
>
> How will i achieve this?
>
> Regds
> Rahul.
Re: How can i define a metamodel in the properties in QVT [message #499133 is a reply to message #499108] Fri, 20 November 2009 02:46 Go to previous messageGo to next message
Rahul Chandrashekar is currently offline Rahul ChandrashekarFriend
Messages: 43
Registered: July 2009
Member
Dear Radek,

The question is something like this:

In case of QVTO, the developer has to give both the input and the output model type, is it possible for me to load the input model type from a java program @ the runtime; i.e i dont want to have a static input model reference, but rather a dynamic model reference.

i believe this is possible in OAW.

Regds
Rahul.
Re: How can i define a metamodel in the properties in QVT [message #499157 is a reply to message #499133] Fri, 20 November 2009 08:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Rahul,

If you mean "static input model reference" via a constant uri
in your launch configuration and need to pass an arbitrary model
using invocation in Java programmatically,
See http://wiki.eclipse.org/QVTOML/Examples/InvokeInJava

In case you talk about dynamic model type declaration, IOW
non-static nsURI in a model type declaration, it is not possible.

However, it is possible to tell QVTO what this static reference points to.
At development time via 'QVT Project/Settings/metamodel';
in InvokeInJava by passing custom EPackage.Registry to
TransformationExecutor class.


Regards,
/Radek



On Fri, 20 Nov 2009 03:46:13 +0100, Rahul Chandrashekar
<rahul.chandrashekar@in.bosch.com> wrote:

> Dear Radek,
>
> The question is something like this:
>
> In case of QVTO, the developer has to give both the input and the output
> model type, is it possible for me to load the input model type from a
> java program @ the runtime; i.e i dont want to have a static input model
> reference, but rather a dynamic model reference. i believe this is
> possible in OAW.
>
> Regds
> Rahul.
Re: How can i define a metamodel in the properties in QVT [message #499500 is a reply to message #499157] Mon, 23 November 2009 03:52 Go to previous messageGo to next message
Rahul Chandrashekar is currently offline Rahul ChandrashekarFriend
Messages: 43
Registered: July 2009
Member
Dear Radek,

Sure i wil give a try and let you know.......
Smile

Thanks
Rahul.
Re: How can i define a metamodel in the properties in QVT [message #499571 is a reply to message #499157] Mon, 23 November 2009 11:42 Go to previous messageGo to next message
Rahul Chandrashekar is currently offline Rahul ChandrashekarFriend
Messages: 43
Registered: July 2009
Member
Hello Radek,

Consider this example

modeltype input "strict" uses <Java model which will be loaded programatically by executing java code>
modeltype output "strict" uses 'http://www.eclipse.org/uml2/3.0.0/UML';

It is something like converting input model from the java runtime to UML (or) any other output model.

This is very much possible in OAW, can you tell me if this is possible in QVTO? Rolling Eyes

Kindly depict with examples.

Regds
Rahul.


Re: How can i define a metamodel in the properties in QVT [message #499579 is a reply to message #499571] Mon, 23 November 2009 12:05 Go to previous message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Rahul,

Yes, this is possible for the Helios release.
As I have mentioned, you can do it when invoking a QVTO transformation
programmatically.

See
org.eclipse.m2m.qvt.oml.TransformationExecutor.Transformatio nExecutor(URI,
Registry).

The package registry that you can pass to the executor will be responsible
for loading your
metamodel, IOW the executor will try to resolve the modeltype's uri within
that package registry to
a corresponding EPackage.
All is in your hands then. ;)

Not sure what OAW does, but I think this is pretty sufficient and flexible.
As for examples, it's all about loading a EPackage of your choice and
putting into
the registry under given nsURI.

Also, you seem to mix two things, metamodel resolution and loading of
input model, which
conforms to its metamodel.
We do NO conversion on input models, you can do it outside QVTO as we have
no idea about
all possible conversion that users might want.


Regards,
/Radek



On Mon, 23 Nov 2009 12:42:55 +0100, Rahul Chandrashekar
<rahul.chandrashekar@in.bosch.com> wrote:

> Hello Radek,
>
> Consider this example
>
> modeltype input "strict" uses <Java model which will be loaded
> programatically by executing java code>
> modeltype output "strict" uses 'http://www.eclipse.org/uml2/3.0.0/UML';
>
> It is something like converting input model from the java runtime to UML
> (or) any other output model.
>
> This is very much possible in OAW, can you tell me if this is possible
> in QVTO? :roll: Kindly depict with examples.
>
> Regds
> Rahul.
>
>
>
Previous Topic:Debugger for QVTO?
Next Topic:[ATL] Transformatio problem with extended metadata in ecore
Goto Forum:
  


Current Time: Thu Apr 18 15:35:16 GMT 2024

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

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

Back to the top