Home » Archived » EMF-IncQuery » Find the feature of changed elements(Find the feature of changed elements)
| |
Re: Find the feature of changed elements [message #1703385 is a reply to message #1703378] |
Fri, 31 July 2015 08:48 |
Zoltan Ujhelyi Messages: 392 Registered: July 2015 |
Senior Member |
|
|
Hi,
for index performance reasons, IncQuery current does not support referencing the containment hierarchy directly, however, if you know which features to check, there is a workaround for that: you can have a pattern that provides the union of all features. For example, see the following helper pattern:
pattern container(EObject container, EObject object) {
Class.ownedOperation(container, object);
} or {
StructuredClassifier.ownedAttributes(container, object);
} or {
//You have to have a body for all interesting containment references
...
}
If you have this pattern, and bind the second parameter to the value you have, the matcher will bind the first parameter to the container. This is equivalent of getting all feature values and checking whether they are contained.
I hope, this idea helps. If not, feel free to ask for clarification.
Cheers,
Zoltán
|
|
| |
Re: Find the feature of changed elements [message #1703387 is a reply to message #1703385] |
Fri, 31 July 2015 08:52 |
Van Cam PHAM Messages: 13 Registered: July 2015 |
Junior Member |
|
|
Zoltan Ujhelyi wrote on Fri, 31 July 2015 08:48Hi,
for index performance reasons, IncQuery current does not support referencing the containment hierarchy directly, however, if you know which features to check, there is a workaround for that: you can have a pattern that provides the union of all features. For example, see the following helper pattern:
pattern container(EObject container, EObject object) {
Class.ownedOperation(container, object);
} or {
StructuredClassifier.ownedAttributes(container, object);
} or {
//You have to have a body for all interesting containment references
...
}
Hi Zoltan,
Yes I'm using this kind of query and transitive closure to find the containment hierarchy and it works. But I'm looking for if I can get the feature of the container corresponding to the given value
|
|
| | |
Goto Forum:
Current Time: Fri Sep 20 14:24:56 GMT 2024
Powered by FUDForum. Page generated in 0.02804 seconds
|