Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Model-to-Model Transformation » [QVTo] how to query all objects from a referenced model ?
[QVTo] how to query all objects from a referenced model ? [message #1456406] Thu, 30 October 2014 10:24 Go to next message
Julien Deantoni is currently offline Julien DeantoniFriend
Messages: 45
Registered: July 2009
Member
Hello,

I'm using QVTo to translate a model in another one (classical).
My source model is referencing eObjects from another model (conforming to another MM)

I used to do something like that to query all the objects of type XXX:
inM.rootObjects().allSubObjects()[XXX] -> map ....


However, this code does not work for the objects referenced from another model Sad
What am I missing ?

is there a workaround ?

thanks

j
Re: [QVTo] how to query all objects from a referenced model ? [message #1457589 is a reply to message #1456406] Fri, 31 October 2014 13:35 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The whole thing depends on the concept of extent which is not
well-defined for model inputs.

OMG-wise it would appear that referenced models are definitely not
considered if they involve types not forming part of the true input.
Whether types that occur in the true input are included is vague.

Eclipse-wise, without studying the code, there is a design choice as to
whether extent corresponds to Resource or ResourceSet. The classic OCL
uses Resource, the Pivot OCL uses ResourceSet for allInstances().

You should get predictable behavior by explicitly navigating to the
roots of referenced resources and then using perhaps
Element::allSubobjects()

Regards

Ed Willink


On 30/10/2014 10:24, Julien DeAntoni wrote:
> Hello,
>
> I'm using QVTo to translate a model in another one (classical).
> My source model is referencing eObjects from another model (conforming
> to another MM)
>
> I used to do something like that to query all the objects of type XXX:
>
> inM.rootObjects().allSubObjects()[XXX] -> map ....
>
>
> However, this code does not work for the objects referenced from another
> model :(
> What am I missing ?
>
> is there a workaround ?
>
> thanks
>
> j
Re: [QVTo] how to query all objects from a referenced model ? [message #1457603 is a reply to message #1456406] Fri, 31 October 2014 13:57 Go to previous message
Julien Deantoni is currently offline Julien DeantoniFriend
Messages: 45
Registered: July 2009
Member
Hi,

thanks a lot for the answer...
Because the transformation is generated automatically (by an HOT) it would have been of great help to have a Element::veryAllSubObjects() Smile.

Anyway, I should be able to grab the good resource by calling black box java

thanks a lot Ed !

regards

julien
Previous Topic:Choosing between ATL and QVT for model to model transformation
Next Topic:Empty target model
Goto Forum:
  


Current Time: Thu Mar 28 14:21:20 GMT 2024

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

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

Back to the top