Resolving unresolved reference using IDerivedStateComputer [message #1840047] |
Tue, 06 April 2021 03:27  |
Eclipse User |
|
|
|
I have implemented IDerivedStateComputer to resolve unresolved references in the model.
At the initial level to test whether IDerivedStateComputer implementation will work or not, I just added some dummy data to resolve the unresolved references.
public void installDerivedState(DerivedStateAwareResource resource, boolean preLinkingPhase) {
// other code
if (ab.eIsProxy()) {
Alphabet gNew = cidlInt.createABC();
gNew.setName("ABC");
resource.getContents().add(gNew);
}
}
The above implementation resolved unresolved references but it created a validation error.
Validation error: "There are one or more Objects in the same location."
Questions:
1) installDerivedState() is getting called multiple times for a single resource(resourceName abc.dsl).
Ex : 6 to 7 times with preLinkingPhase false.
I assume multiple calls to installDerivedState() creating an issue(Validation error).
2) How do I derive unresolved reference object name
I tried using NodeModelUtils.findNodesForFeature but it returned empty list.
Please share your thoughts it would be helpful.
[Updated on: Tue, 06 April 2021 03:39] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.28046 seconds