2

I am using the Camunda BPMN-Model API for generating bpmn 2.0-xml files. However, I can't find a auto-layout functionality in it to create the BPMN-DI information automatically. I know that it's possible to create the rendering components by manually importing to the Camunda modeler, but I am trying to do so automatically. Activity and Yaoqiang seem to implement such a function. Is there any algorithm based on the Camunda model api?

There is also a try for the Camunda modeler, but it's probably not what I'm looking for.

Thanks for your help!

1 Answers1

1

On the last hack days Chris developed a working auto-layout in Javascript: https://github.com/bpmn-io/bpmn-moddle-auto-layout. I would recommend to give it a try.

Update:

Auto-layouting is now part of the core model API in Java. Hence DI is now automatically created for you. Best try it with the latest Camunda version.

Bernd Ruecker
  • 970
  • 5
  • 6
  • 1
    I've created an issue there: https://github.com/bpmn-io/bpmn-moddle-auto-layout/issues/6. I have a problem with the xml generated by camunda's model api. maybe you can help me. – pinussilvestrus Sep 22 '16 at 18:34
  • Unfortunately, it can't handle sub-processes – andrey Sep 15 '17 at 16:06
  • Best try the auto-layout of the Camunda model API itself. I just updated my answer as it was introduced in the meanwhile in Camunda itself. – Bernd Ruecker Sep 18 '17 at 07:04
  • @BerndRuecker thx for the heads up on the auto layouter. Which version of the camunda bpmn api do you mean? 7.8.0-alpha4? And how is the auto-layouting invoked with the API? – mwhs Oct 01 '17 at 11:54
  • is the DI generator (auto-layout) only available in the fluent API? Or how can a DI be generated using the full API? – mwhs Oct 01 '17 at 12:09
  • The auto-layout is part of the Java Model API: https://docs.camunda.org/manual/7.7/user-guide/model-api/bpmn-model-api/create-a-model/. The auto-layout is done automatically in the current 7.7.0 - you do not have to do anything for it. – Bernd Ruecker Oct 02 '17 at 12:09
  • But unfortunately, it is said "Branches of gateways are placed one below the other. Auto layout is not provided, therefore the elements of different branches may overlap", so the diagram lines from gateway may also overlap. Found it in version 7.9 https://docs.camunda.org/manual/7.9/user-guide/model-api/bpmn-model-api/fluent-builder-api/#generation-of-diagram-interchange – Simon Apr 11 '19 at 02:20
  • @BerndRuecker is the auto-layout only generated with the Fluent Builder API or also with the normal/full model API? The doc you linked explicitly states "The following code creates this process [...] (without the DI elements)." – kleinph Feb 12 '20 at 13:22
  • @kleinph: If I recall it correctly this is part of the builder, see e.g. https://github.com/camunda/camunda-bpmn-model/blob/master/src/main/java/org/camunda/bpm/model/bpmn/builder/ProcessBuilder.java#L42 – Bernd Ruecker Feb 13 '20 at 20:04