|Adding a Semantic Resource to the Session (SOLVED) [message #1818519]
||Wed, 18 December 2019 11:48
| Neeraj Bhusare
Registered: July 2009
I use the following code to add a semantic-resource to the Session instance.
final AddSemanticResourceCommand command = new AddSemanticResourceCommand(session, resource.getURI(), monitor);
The constructor takes the resource URI as an input parameter. After the command is executed, the semantic-resource "instance" loaded in the session is not the same as the one used to get the URI (resource.getURI()). As a side-effect, I see the following error when I try to perform the save operation - Impossible to find an interpreter - Could not find a session for the model element...
As a workaround, I get hold of the semantic-resource from the session using the resource URI and replace the model element in the resource with the one passed as the parameter to the service method. The hack works.
Is there a better way to deal with the above?
Out of curiosity, why is it that the `AddSemanticResourceCommand` constructor takes a resource URI and not a resource as a parameter?
Thanks in advance.
Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj
[Updated on: Wed, 18 December 2019 15:02]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.07585 seconds