Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] Loading non-registered metamodels
[QVTO] Loading non-registered metamodels [message #73629] Mon, 28 January 2008 17:28 Go to next message
Eclipse UserFriend
Originally posted by: jjcadavid.avansoft.com

Hello,

I've been using Operational QTV for a few days, and I think itŽs awesome.
I have tried it with some metamodels included in the EMF registry that
have been registered by the platform, but I havenŽt been able to use my
own metamodels (defined using ecore). For example, when writing:

modeltype WAP uses 'http:///schemas/MyMetamodel/_N7z_oM21EdyT85bEj1lqOw/0';

I get that the model can't be recognized. How can I register the metamodel
for QVTO to be recognized?

Thank you so much.

-Juan
Re: [QVTO] Loading non-registered metamodels [message #73648 is a reply to message #73629] Mon, 28 January 2008 17:55 Go to previous messageGo to next message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
Hi Juan,

By default, you get access to metamodels in the global registry
EPackage.Registry.INSTANCE.
For writing QVT against your ecore files located in the workspace, go to
properties of
the QVTO project. In the page 'QVT Settings/Metamodel mappings' you can
map your
metamodel package uri to a resource location uri, platform:/resource/....,
your ecore file.

So far, we have implemented only this simplistic mapping to address
dynamic metamodels as we believe
a more sophisticated solution is out of the scope of QVTO itself and we
expect this to be solved
by other Eclipse components; we will just make use of it.

Does this satisfy your usecase? Perhaps, we should do more ;-)

Regards,
/Radek


On Mon, 28 Jan 2008 18:28:29 +0100, Juan Cadavid <jjcadavid@avansoft.com>
wrote:

> Hello,
>
> I've been using Operational QTV for a few days, and I think itŽs
> awesome. I have tried it with some metamodels included in the EMF
> registry that have been registered by the platform, but I havenŽt been
> able to use my own metamodels (defined using ecore). For example, when
> writing:
>
> modeltype WAP uses
> 'http:///schemas/MyMetamodel/_N7z_oM21EdyT85bEj1lqOw/0';
>
> I get that the model can't be recognized. How can I register the
> metamodel for QVTO to be recognized?
>
> Thank you so much.
>
> -Juan
>
>
>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: [QVTO] Loading non-registered metamodels [message #73684 is a reply to message #73648] Tue, 29 January 2008 07:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jjcadavid.avansoft.com

Richard and Radek,

Thank you so much for your help on my previous question! I successfully
had the metamodel recognized.

I would like to ask for help on one more thing. I am interested in
carrying out some transformations between UML models, taking as input an
UML marked model, i.e. a class diagram with stereotypes. However, these
marks over the origin model are serialized outside the containing package
of the input model, like this:

<xmi ...>
<uml:Package ...>
<class id="1" ... />
<class id="2" ... />
<class id="3" ... />
</uml:Package ...?
<MyProfile:MyStereotype base_Class="1">
<MyProfile:MyStereotype base_Class="2">
</xmi>

My mission here is to retrieve only the classes marked with MyStereotype.
To do this, I have to load both the UML and the MyProfile metamodels,
which is no problem. The deal comes when I want to get the actual marks
contained in my model, because the main mapping declares that I receive a
<uml:Package> as input, but this leaves the marks outside. I tried adding
an additional "in" argument at the main mapping signature, like this:

main(in pim: UML::Package, in marks: Set(MyProfile::MyStereotype), out
psm: UML::Package)

but the Run Configuration won't let me add a second input model (which
would be the same file).

Do you have any ideas on how to accomplish my mission? Thank you so much
again!

-Juan
Re: [QVTO] Loading non-registered metamodels [message #73702 is a reply to message #73648] Tue, 29 January 2008 10:14 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Hi,

Minor addition on using non-registered metamodels. You can explicitly
refer to your workspace metamodel in modeltype expression as platfrom
resource:

modeltype WAP uses 'platform:/resource/.../mm.ecore';

Regards,
Sergey


Radek Dvorak wrote:
> Hi Juan,
>
> By default, you get access to metamodels in the global registry
> EPackage.Registry.INSTANCE.
> For writing QVT against your ecore files located in the workspace, go to
> properties of
> the QVTO project. In the page 'QVT Settings/Metamodel mappings' you can
> map your
> metamodel package uri to a resource location uri,
> platform:/resource/...., your ecore file.
>
> So far, we have implemented only this simplistic mapping to address
> dynamic metamodels as we believe
> a more sophisticated solution is out of the scope of QVTO itself and we
> expect this to be solved
> by other Eclipse components; we will just make use of it.
>
> Does this satisfy your usecase? Perhaps, we should do more ;-)
>
> Regards,
> /Radek
>
>
> On Mon, 28 Jan 2008 18:28:29 +0100, Juan Cadavid
> <jjcadavid@avansoft.com> wrote:
>
>> Hello,
>>
>> I've been using Operational QTV for a few days, and I think itŽs
>> awesome. I have tried it with some metamodels included in the EMF
>> registry that have been registered by the platform, but I havenŽt been
>> able to use my own metamodels (defined using ecore). For example, when
>> writing:
>>
>> modeltype WAP uses
>> 'http:///schemas/MyMetamodel/_N7z_oM21EdyT85bEj1lqOw/0';
>>
>> I get that the model can't be recognized. How can I register the
>> metamodel for QVTO to be recognized?
>>
>> Thank you so much.
>>
>> -Juan
>>
>>
>>
>
>
>
Re: [QVTO] Loading non-registered metamodels [message #73736 is a reply to message #73684] Tue, 29 January 2008 12:21 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Hi Juan,

Current implementation considers only first object in given xmi file. It
means that whenever whole model file is supplied as [in] parameter in
Run UI it's equivalent to reference to models' first root object, i.e.
'../in.ecore' is equal to '../in.ecore#0'.
Of course given root object in Run UI can be referenced using it's id
(like ../in.ecore#1) and provided as separate [in] object but it's not
suited for unlimited number of objects.

In your case I'd suggest to:
- use UML profiles for the stereotype like markers
- use separate model for markers, all object should be rooted in some
container (like Package)

Regards,
Sergey


Juan Cadavid wrote:
> Richard and Radek,
>
> Thank you so much for your help on my previous question! I successfully
> had the metamodel recognized.
>
> I would like to ask for help on one more thing. I am interested in
> carrying out some transformations between UML models, taking as input an
> UML marked model, i.e. a class diagram with stereotypes. However, these
> marks over the origin model are serialized outside the containing
> package of the input model, like this:
>
> <xmi ...>
> <uml:Package ...>
> <class id="1" ... />
> <class id="2" ... />
> <class id="3" ... />
> </uml:Package ...?
> <MyProfile:MyStereotype base_Class="1">
> <MyProfile:MyStereotype base_Class="2">
> </xmi>
>
> My mission here is to retrieve only the classes marked with
> MyStereotype. To do this, I have to load both the UML and the MyProfile
> metamodels, which is no problem. The deal comes when I want to get the
> actual marks contained in my model, because the main mapping declares
> that I receive a <uml:Package> as input, but this leaves the marks
> outside. I tried adding an additional "in" argument at the main mapping
> signature, like this:
>
> main(in pim: UML::Package, in marks: Set(MyProfile::MyStereotype), out
> psm: UML::Package)
>
> but the Run Configuration won't let me add a second input model (which
> would be the same file).
>
> Do you have any ideas on how to accomplish my mission? Thank you so much
> again!
>
> -Juan
>
Re: [QVTO] Loading non-registered metamodels [message #73878 is a reply to message #73736] Wed, 30 January 2008 11:35 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Hi Juan,

According to sample model you've mentioned interpretation of [in] models
specified in Run UI was changed. Now all root objects from the specified
URI are considered.
So it's possible to select model with marker as the only input. For
obtaining root objects from it the following code can be used:

inModel.rootObjects()->select(oclIsKindOf(uml::Package))
inModel.rootObjects()->select(oclIsKindOf(MyProfile::MyStereotype))


Regards,
Sergey


> Hi Juan,
>
> Current implementation considers only first object in given xmi file. It
> means that whenever whole model file is supplied as [in] parameter in
> Run UI it's equivalent to reference to models' first root object, i.e.
> '../in.ecore' is equal to '../in.ecore#0'.
> Of course given root object in Run UI can be referenced using it's id
> (like ../in.ecore#1) and provided as separate [in] object but it's not
> suited for unlimited number of objects.
>
> In your case I'd suggest to:
> - use UML profiles for the stereotype like markers
> - use separate model for markers, all object should be rooted in some
> container (like Package)
>
> Regards,
> Sergey
>
>
> Juan Cadavid wrote:
>> Richard and Radek,
>>
>> Thank you so much for your help on my previous question! I
>> successfully had the metamodel recognized.
>>
>> I would like to ask for help on one more thing. I am interested in
>> carrying out some transformations between UML models, taking as input
>> an UML marked model, i.e. a class diagram with stereotypes. However,
>> these marks over the origin model are serialized outside the
>> containing package of the input model, like this:
>>
>> <xmi ...>
>> <uml:Package ...>
>> <class id="1" ... />
>> <class id="2" ... />
>> <class id="3" ... />
>> </uml:Package ...?
>> <MyProfile:MyStereotype base_Class="1">
>> <MyProfile:MyStereotype base_Class="2">
>> </xmi>
>>
>> My mission here is to retrieve only the classes marked with
>> MyStereotype. To do this, I have to load both the UML and the
>> MyProfile metamodels, which is no problem. The deal comes when I want
>> to get the actual marks contained in my model, because the main
>> mapping declares that I receive a <uml:Package> as input, but this
>> leaves the marks outside. I tried adding an additional "in" argument
>> at the main mapping signature, like this:
>>
>> main(in pim: UML::Package, in marks: Set(MyProfile::MyStereotype), out
>> psm: UML::Package)
>>
>> but the Run Configuration won't let me add a second input model (which
>> would be the same file).
>>
>> Do you have any ideas on how to accomplish my mission? Thank you so
>> much again!
>>
>> -Juan
>>
Re: [QVTO] Loading non-registered metamodels [message #73930 is a reply to message #73878] Wed, 30 January 2008 15:32 Go to previous messageGo to next message
Juan Cadavid is currently offline Juan CadavidFriend
Messages: 59
Registered: July 2009
Location: Paris, France
Member

WOW, simply amazing. This is precisely what I needed, since moving the
marks to another package wouldnŽt work. Can I do check out from your
repository or should I wait for the next milestone release?
Re: [QVTO] Loading non-registered metamodels [message #74184 is a reply to message #73930] Fri, 01 February 2008 13:11 Go to previous message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Hi Juan,

At present described feature is only available in sources from Eclispe
CVS HEAD. Checking out from it is Ok.

Regards,
Sergey.

Juan Cadavid wrote:
> WOW, simply amazing. This is precisely what I needed, since moving the
> marks to another package wouldnŽt work. Can I do check out from your
> repository or should I wait for the next milestone release?
>
Previous Topic:[ATL] New ATL Use Case: "Model-Driven Performance Engineering: From UML/SPT to AnyLogic"
Next Topic:[ATL] Problem in Transformation ATL (Root Element)
Goto Forum:
  


Current Time: Fri Apr 26 18:57:54 GMT 2024

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

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

Back to the top