Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [texo] JSONEMFConverter from texo web service response
[texo] JSONEMFConverter from texo web service response [message #1746705] Thu, 03 November 2016 09:31 Go to next message
Eclipse UserFriend
Hi,

I already found some topics here, but it seems none of seem are about the exactly same issue.

I have an ecore model, generating texo JPA classes. The texo web service also runs properly and I can get proper responses from the service. Now I need to convert the response json string to EObject instances. The following code breaks with the following message:

final JSONObject responseJsonObject = new JSONObject(result.toString());
final JSONObject rootObjectJson = responseJsonObject.getJSONArray("data").getJSONObject(0);
final JSONEMFConverter converter = new JSONEMFConverter();
rootObject = converter.convert(rootObjectJson);


Error: Quote:
No EClass(ifier) found using name com.mycompany.fileSystem|Root


I already found out to have a resolver for the types, but it is straight forward modeled classes from the same service. I thought the ModelFactory of the com.mycompany.fileSystem implements a resolver or someone else.

Do I need to write my own resolver or is there another, easier solution around?

Best Regards

Peter Friedland

[Updated on: Thu, 03 November 2016 09:42] by Moderator

Re: [texo] JSONEMFConverter from texo web service response [message #1746851 is a reply to message #1746705] Sun, 06 November 2016 08:19 Go to previous messageGo to next message
Eclipse UserFriend
Hi Peter,
No need to write a resolver afaics. It could be that somehow the ModelResolver does not know about your ModelPackage (yet). The ModelPackage is registered when touching/using the ModelPackage instance or alternatively you can register it explicitly: ModelResolver.getInstance().registerModelPackage(modelPackage). It could be that your code above not yet uses the ModelPackage instance, so you can try registering it explicitly.

gr. Martin
Re: [texo] JSONEMFConverter from texo web service response [message #1747248 is a reply to message #1746851] Fri, 11 November 2016 04:21 Go to previous message
Eclipse UserFriend
Ok that may be the problem, I'll give it a try. Thank you!
Previous Topic:[EMF Forms] Hide fields/controls programmaticaly in views
Next Topic:[EMF Forms] Save as XMI removes context menu commands
Goto Forum:
  


Current Time: Sun Jul 27 02:20:46 EDT 2025

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

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

Back to the top