Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forums[QVTo] how to query all objects from a referenced model ?
https://www.eclipse.org/forums/index.php/mv/msg/841251/1456406/#msg_1456406
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:
However, this code does not work for the objects referenced from another model
What am I missing ?
is there a workaround ?
thanks
j]]>Julien Deantoni2014-10-30T10:24:58-00:00Re: [QVTo] how to query all objects from a referenced model ?
https://www.eclipse.org/forums/index.php/mv/msg/841251/1457589/#msg_1457589
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]]>Ed Willink2014-10-31T13:35:25-00:00Re: [QVTo] how to query all objects from a referenced model ?
https://www.eclipse.org/forums/index.php/mv/msg/841251/1457603/#msg_1457603
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() .
Anyway, I should be able to grab the good resource by calling black box java