how to create an image on a server [message #1585909] |
Mon, 26 January 2015 15:04 |
Flavio Donze Messages: 211 Registered: July 2009 Location: Switzerland |
Senior Member |
|
|
Hello
I would like to create an image of a BPMN diagram on the server side without having to load the entire editor environment.
I got the following test snipped so far:
URI modelUri = URI.createFileURI("D:/temp/data.bpmn");
URI diagramUri = URI.createFileURI("D:/temp/data.diagram");
TransactionalEditingDomain editingDomain = createResourceSetAndEditingDomain();
ResourceSet resourceSet = editingDomain.getResourceSet();
resourceSet.setURIConverter(new ProxyURIConverterImplExtension(modelUri));
Bpmn2ResourceImpl resource = (Bpmn2ResourceImpl) resourceSet.createResource(modelUri,
Bpmn2ModelerResourceImpl.BPMN2_CONTENT_TYPE_ID);
ModelHandler modelHandler = ModelHandlerLocator.createModelHandler(modelUri, resource);
URI uridiagram = diagramUri.appendFragment("/0"); // diagram is first object
Diagram diagram = (Diagram) editingDomain.getResourceSet().getEObject(uridiagram, true);
The question now is how do I generate the according GraphicalEditPart from the diagram? If I look at the EditPartFactories e.g. org.eclipse.graphiti.ui.internal.partfactory.PictogramsEditPartFactory it would require to initialize a whole editor. Does anybody have a snippet or can point me in the right direction?
greets and thanks
Flavio
Prozessmanagement und Qualitätsmanagement Software QMS/IMS
https://www.scodi.ch
|
|
|
|
Powered by
FUDForum. Page generated in 0.03726 seconds