05-30-2017 01:39 PM
I would like to export the image of a BPMN diagram, getting the process definition from the process instance. I know that is possible to to the export of the XML in this way and using the repository service and I am wondering if it is also possible to export an image (png, jpg,...).
Thank in advance.
06-01-2017 01:51 AM
Thank you for your reply and your test code.
I see that you want to create a dynamic process and generate it's diagram image.
But, it is difficult to generate dynamic process's diagram because it have no graphic information like the following.
You should make the graphic information of dynamic process.
<bpmndi:BPMNDiagram id="BPMNDiagram_test">
<bpmndi:BPMNPlane bpmnElement="test" id="BPMNPlane_test">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
<omgdc:Bounds height="35.0" width="35.0" x="70.0" y="170.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="task1" id="BPMNShape_task1">
<omgdc:Bounds height="55.0" width="105.0" x="180.0" y="160.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
<omgdc:Bounds height="35.0" width="35.0" x="370.0" y="170.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="105.0" y="187.0"></omgdi:waypoint>
<omgdi:waypoint x="180.0" y="187.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="285.0" y="187.0"></omgdi:waypoint>
<omgdi:waypoint x="370.0" y="187.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
I have no idea to make the properly placed process diagram.
I maked the sample code that generate a process diagram aligned in line and made pull request to your repo.
https://github.com/ajeje93/activiti-processdiagramgenerator-test/pull/1
https://github.com/daisuke-yoshimoto/activiti-processdiagramgenerator-test/blob/master/ProcessDiagra...
05-31-2017 10:57 AM
I'm sorry that I could not understand your intention.
Please provide the code that you tried and got error.
05-31-2017 02:45 PM
Sorry if I did not provide code sooner:
This is my example, suppose that in the original code I retrieved the BpmnModel variable from a process instance. However, the error is the same as in my case.
06-01-2017 01:51 AM
Thank you for your reply and your test code.
I see that you want to create a dynamic process and generate it's diagram image.
But, it is difficult to generate dynamic process's diagram because it have no graphic information like the following.
You should make the graphic information of dynamic process.
<bpmndi:BPMNDiagram id="BPMNDiagram_test">
<bpmndi:BPMNPlane bpmnElement="test" id="BPMNPlane_test">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
<omgdc:Bounds height="35.0" width="35.0" x="70.0" y="170.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="task1" id="BPMNShape_task1">
<omgdc:Bounds height="55.0" width="105.0" x="180.0" y="160.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
<omgdc:Bounds height="35.0" width="35.0" x="370.0" y="170.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="105.0" y="187.0"></omgdi:waypoint>
<omgdi:waypoint x="180.0" y="187.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="285.0" y="187.0"></omgdi:waypoint>
<omgdi:waypoint x="370.0" y="187.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
I have no idea to make the properly placed process diagram.
I maked the sample code that generate a process diagram aligned in line and made pull request to your repo.
https://github.com/ajeje93/activiti-processdiagramgenerator-test/pull/1
https://github.com/daisuke-yoshimoto/activiti-processdiagramgenerator-test/blob/master/ProcessDiagra...
06-01-2017 01:59 AM
Thank you very much!
06-02-2017 01:44 AM
> I have no idea to make the properly placed process diagram.
I'm sorry that I did not know that there was a standard solution to decide the layout arbitrarily.
You can use org.activiti.bpmn.BpmnAutoLayout.class and you do not need to forcibly create the graphic information.
new BpmnAutoLayout(model).execute();
I made new pull request to add auto layout.
06-02-2017 05:35 AM
You have been of great help. Thank you again!
Explore our Alfresco products with the links below. Use labels to filter content by product module.