| Load Domain Model (File) into Diagram [message #756895] |
Tue, 15 November 2011 08:19  |
Matt H. Messages: 6 Registered: August 2011 |
Junior Member |
|
|
Hi!
I want to load business objects (EMF format) into a new Graphiti diagram.
The thread "Create Diagram Model Programatically" has been of great help so far.
But my question is:
How do I get the business objects out of the domain model file?
My first naive attempt was:
ResourceSet resourceSet = new ResourceSetImpl();
Resource resource = resourceSet.getResource(domainModelFileURI, true);
try {
resource.load(Collections.EMPTY_MAP);
} catch (IOException e) {
e.printStackTrace();
}
All I get is resource = 'null'.
Thanks,
Matt
|
|
|
|
| Re: Load Domain Model (File) into Diagram [message #756937 is a reply to message #756917] |
Tue, 15 November 2011 10:34   |
Matt H. Messages: 6 Registered: August 2011 |
Junior Member |
|
|
Hi Tim,
thanks for the quick reply!
Good to know my code is basically correct.
I will check the URI again.
( update: URI is correct. resource.getcontents() is not null, but empty. I will use the EMF Forum for details )
Sorry, I don't understand what you mean by "reusing the resource set of the diagram editor". Could you explain this?
best regards,
Matt
[Updated on: Wed, 16 November 2011 05:23] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01730 seconds