Using the Archi data model outside of Eclipse

Started by GeraldScott, October 30, 2014, 04:22:10 AM

Previous topic - Next topic


I have been experimenting with Archi in the context of sharing models in a community of Enterprise Architects. We would like to generate and render the models using SVG so we are looking for an elegant way of loading the serialized models from the '*.archimate' XML files into a servlet.

We hit a problem trying to use EMF outside of Eclipse. We were getting a PackageNotFoundException which we solved by following the advice in the EMF FAQ to initialize the package by accessing the eINSTANCE field, but the result is a complex model with a lot of processing overheads.

We then tried JAXB to generate the Java classes using xjc from the XSD that we exported from genmodel , but even though we suppressed the EMF related items, we were still getting "Failed to read schema document 'platform:/plugin/org.eclipse.emf.ecore/model/Ecore.xsd'" errors.

We have hacked a solution, using the MyImporter example as inspiration, and it works well, but we were hoping to find a more straightforward solution.

Has anyone else tried to do something similar? How did you do it? We are new to EMF and the Eclipse RCP so any advice would be very welcome.

Phil Beauvoir

Hi Gerald,

your aim is have the models in SVG format, right? Did you try the "Export View As Image" option with SVG?

If you value and use Archi please consider making a donation!


Yes, that is the ultimate aim, and the export facility works beautifully, but we would like to manipulate the model on the server side to add other details to the model before generating the SVG.

Phil Beauvoir

In order to render to SVG, this process happens:

1. Load the model into an EMF instance
2. Load the EMF instance into GEF Edit Parts which will instantiate Draw2D figures
3. Render to a GraphicalViewer
4. Take the top root Figure from the GraphicalViewer and re-render it to a GraphicsToGraphics2DAdaptor
5. Pass this through an Apache Batik SVGGraphics2D instance whicho converts to SVG format

It is possible to do this in a "headless" from within Eclipse, and this is how the JUnit tests do it, but I don't know how to get it all set up outside of Eclipse.
If you value and use Archi please consider making a donation!


Thanks very much for the response. That has pointed in the right direction.