Automatic BPMN diagram drawer


#1

Thanks to java camunda-bpmn-model library it is convenient to build bpmn models on a fly.
But generated BPMN models are without diagram data and cannot be displayed as diagram, it would be very nice to have bpmn diagram as well.
Is there any library already which does the magic?

Thanks!
Erki


#2

Hi @Erki_Kriks,

right now there are no projects that allow generation of DI for a diagram. We had multiple prototypes, but they never made it to production. You can always create feature request in our JIRA or vote for existing feature, like this one CAM-1472.

If you really want this done fast, you could also provide implementation in form of pull request or community extension.

Cheers,
Askar


#3

Hello,

I’m new to camunda bpmn and the forum and this post seems the closest (maybe identical?) to what I would like to ask.

People at my company start using camunda modeler to create diagrams (but usage of the engine would be a long way to go still…). For documentation purposes I’d like to convert the *.bpmn files of the modeler to *.svg automatically, ideally using some command line tool. The tool chain would look something like camunda modeler -> commit via git -> trigger svg generation via cli -> upload to wiki. If there’s some cli, I could use, that would be great. Otherwise a pointer to the right place in the source would be appreciated.

Thanks in advance!
Malte


Export to png from commandline
#4

Hi @malte,

In the camunda modeler you can easily export a svg of your bpmn model? Does this not work for you?

BTW, I think, your question is not really related to origin post. The next time you should create a new forum post.

Cheers,
Roman


#5

Hi Roman,
thanks for the answer! Next time, I’ll create a new post :slight_smile:

For the time being: The svg-export in the modeler works just fine, but what I would like to do is take a .bpmn file as saved by the modeler and generate an svg file using some kind of shell script. Maybe I don’t know enough yet to do a smart search for what I need – I googled for cli options of the modeler or something similar.
Something like

$> camunda-modeler --svgexport --input some.bpmn --output some.svg

I guess, it’s not that easy, but worst case: it’s somewhere in the code…
So my emphasis would be on ‘automatically’ convert to svg. If that would be possible, I could setup a repo just for the bpmn files and all the boring conversion stuff and wiki update would happen somewhere else. The user wouldn’t need to create a new svg everytime they change the model (which still happens a lot…).

Cheers,
Malte


#6

I’m very interested by the subject, any solution ?


#7

I think the only thing you can do right now is grab the BPMN.IO library and build yourself a custom solution. You’d have find where it reads in the BPMN XML files and hook that into some sort of interface or command line tool. I’d speculate that there’s probably a rendering component in there that might do this.


#8

It’s very strange that there are not any solution to :
1 - AutoLayout automaticaly a BPMN file (rebuild the DI part)
2 - Convert a BPMN to a picture

I don’t want to give up …


#9

I know that in the deprecated Camunda Eclipse plugin it automatically produces a png file. BPMN.IO must automatically render the BPMN, so this functionality is definitely buried in there somewhere.

As for automatic layout, I’m not exactly sure what you mean. If you examine the XML associated with the process, you will see a section like the following:

  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="173" y="102" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="IntermediateThrowEvent_0vbg2qs_di" bpmnElement="IntermediateThrowEvent_0vbg2qs">
        <dc:Bounds x="392" y="254" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="410" y="290" width="0" height="0" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>

Without this code, how would the display component know where to put each element. What is the “right” way to do that? It’s rather arbitrary, though there are layout and routing algorithms out there, their efficacy is pretty subjective. What looks good to me may not look good to someone else. Moreover layout and routing is a fairly complex thing to do as there are an arbitrary number of elements in a process and thus you can’t predict the performance of your algorithm.

If you’re using Camunda Modeler, you can output the file in 3 different graphic formats. Because modeler uses BPMN.IO, the ability to do this dynamically is in there somewhere.


Batch export BPMN to SVG
#10

Is there any progress on the “Export to …” on command line?
Is there any issue in JIRA already to vote for?

If not: Can someone post any hints where this is done “in the code” allowing users to work on this feature?