Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » java M2MT(I nedd transform a java model in another java model)
java M2MT [message #1698749] Wed, 17 June 2015 15:04 Go to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
Hello,

How should I define modeltype in the transformation to transform a java model in another?

I have a java model created from MoDisco discoverer.

I have noticed that only metamodels are defined in ModelType. I need transform models.

Regards.
Re: java M2MT [message #1698755 is a reply to message #1698749] Wed, 17 June 2015 15:35 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Just look at the XMI of any model that QVTo or other equivalent tooling
loads and you'll see the MI namespace declarations that identify the
metamodel.

Regards

Ed Willink



On 17/06/2015 16:04, Gonzalo Bressan Zuber wrote:
> Hello,
>
> How should I define modeltype in the transformation to transform a
> java model in another?
>
> I have a java model created from MoDisco discoverer.
>
> I have noticed that only metamodels are defined in ModelType. I need
> transform models.
>
> Regards.
Re: java M2MT [message #1698783 is a reply to message #1698755] Wed, 17 June 2015 21:14 Go to previous messageGo to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
Ed,

the header of the XMI is

<?xml version="1.0" encoding="ASCII"?>
<java:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:java="http://www.eclipse.org/MoDisco/Java/0.2.incubation/java" name="tesis">

Here is the information I need?

Regards.
Re: java M2MT [message #1698788 is a reply to message #1698783] Wed, 17 June 2015 21:42 Go to previous messageGo to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
I tried define the header file of the following way

modeltype A uses 'platform:/resource/tesis/tesis_java.xmi';

transformation Plus_To_Minus(in a : A, out A);


and i recieve the following error:

Failed to resolve metamodel 'platform:/resource/tesis/tesis_java.xmi'

Regards.
Re: java M2MT [message #1698835 is a reply to message #1698783] Thu, 18 June 2015 09:25 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

It is always easier to debug a problem if you have a similar example
that works.

You have an example project that does:

modeltype UML uses
'http://www.eclipse.org/qvt/1.0.0/Operational/examples/simpleuml';
....
transformation Simpleuml_To_Rdb(in uml : UML, out RDB);

and an example file that does:

<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:uml="http://www.eclipse.org/qvt/1.0.0/Operational/examples/simpleuml"
name="model">

Comaprng these should help you understand why

modeltype A uses 'platform:/resource/tesis/tesis_java.xmi';

is not a good idea.

Regards

Ed Willink


On 17/06/2015 22:14, Gonzalo Bressan Zuber wrote:
> Ed,
>
> the header of the XMI is
>
> <?xml version="1.0" encoding="ASCII"?>
> <java:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:java="http://www.eclipse.org/MoDisco/Java/0.2.incubation/java"
> name="tesis">
>
> Here is the information I need?
>
> Regards.
Re: java M2MT [message #1698848 is a reply to message #1698755] Thu, 18 June 2015 11:51 Go to previous messageGo to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
Hi Ed,

I have the Simpleuml_To_Rdb working but

modeltype UML uses
'http://www.eclipse.org/qvt/1.0.0/Operational/examples/simpleuml';

refers a ECORE file (metamodel), however i have a XMI file (model).

You understand me?

Regards.
Re: java M2MT [message #1698860 is a reply to message #1698848] Thu, 18 June 2015 12:40 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

When working with Java you have objects that conform to/instantiate
their classes.

When working with models you have models (containing a hierarchy of
instances) that conform to metamodels (containing a hierarchy of classes).

If you confuse meta-levels garbage and errors result.

http://www.eclipse.org/qvt/1.0.0/Operational/examples/simpleuml is the
nsURI of a metamodel.

platform:/resource/org.eclipse.m2m.qvt.oml.samples.simpleuml2rdb/pim.simpleuml
is a model

http://www.eclipse.org/MoDisco/Java/0.2.incubation/java is the nsURI of
Modisco's Java metamodel

platform:/resource/tesis/tesis_java.xmi is presumably your Java model.

Regards

Ed Willink




On 18/06/2015 12:51, Gonzalo Bressan Zuber wrote:
> Hi Ed,
>
> I have the Simpleuml_To_Rdb working but
> modeltype UML uses
> 'http://www.eclipse.org/qvt/1.0.0/Operational/examples/simpleuml';
>
> refers a ECORE file (metamodel), however i have a XMI file (model).
>
> You understand me?
>
> Regards.
Re: java M2MT [message #1698928 is a reply to message #1698860] Thu, 18 June 2015 21:57 Go to previous messageGo to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
Hi Ed, may be i dont understand something, but i need transform the xmi file in another. What should establish as modeltype?

I'm sorry, I have a confusion between, english language and qvt concepts.

Regards.
Re: java M2MT [message #1698930 is a reply to message #1698928] Thu, 18 June 2015 22:13 Go to previous messageGo to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
The Simpleuml_To_Rdb example transform the UML metamodel in RDB metamodel. I need transform a model (xmi) created through java metamodel.

Regards.

[Updated on: Thu, 18 June 2015 22:14]

Report message to a moderator

Re: java M2MT [message #1698944 is a reply to message #1698930] Fri, 19 June 2015 06:08 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
On 18/06/2015 23:13, Gonzalo Bressan Zuber wrote:
> The Simpleuml_To_Rdb example transform the RDB metamodel in UML
> metamodel. I need transform a model (xmi) created through java metamodel.
>
> Regards.
No

The Simpleuml_To_Rdb example transforms an XMI file conforming to the
SimpleUML metamodel to an XMI file conforming to the RDB metamodel.

You want a transformation that transforms an XMI file conforming to the
Modisco Java metamodel to another XMI file conforming to the Modisco
Java metamodel.

Regards

Ed Willink
Re: java M2MT [message #1699003 is a reply to message #1698944] Fri, 19 June 2015 12:10 Go to previous messageGo to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
Thanks!
Re: java M2MT [message #1699007 is a reply to message #1699003] Fri, 19 June 2015 12:40 Go to previous messageGo to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
How it is established that the source model is pim.simpleuml?

Thanks!!
Re: java M2MT [message #1699012 is a reply to message #1699007] Fri, 19 June 2015 13:13 Go to previous message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
Seeing the "Hello world" in Eclipse QVTo by Fabio Levi Siqueira clarify some concepts.

I understand now that, first the transformation is declared and then the source model is specified for the transformation execution.

Regards.
Thamks.
Previous Topic:Java model transformation with qvto
Next Topic:Blackbox library in a standalone QVTo transformation
Goto Forum:
  


Current Time: Fri Apr 19 23:16:36 GMT 2024

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

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

Back to the top