bpmn-io / bpmn-js

A BPMN 2.0 rendering toolkit and web modeler.
https://bpmn.io/toolkit/bpmn-js/
Other
8.63k stars 1.33k forks source link

Generate the DI information automatically #853

Open zhengyang1988 opened 6 years ago

zhengyang1988 commented 6 years ago

When opening an bpmn file without DI information(the section), there will be an error. If the editor or viewer can generate the DI information automatically and display the diagram correctly, that will be great.

Expected Behavior

image

Actual Behavior

image

Steps to reproduce the Behavior

open a bpmn file without DI information. You can manually delete the element and all its descendants from a bpmn file generated by the bpmn editor

nikku commented 6 years ago

Unfortunately layouting / generating the diagram DI is not a simple task. We appreciate contributions that help to tackle this problem.

To understand your use case a little bit better, how did you end up with a diagram that lacks graphical information?

zhengyang1988 commented 6 years ago

@nikku I need to generate the .bpmn file programmatically. I can use the camunda model API (full api) or activiti dynamic API to do this. But the .bpmn file generated by either of the two APIs doesn't contain DI information. So you can get a bpmn file without DI by using the two APIs. I need to generate the DI information to display the bpmn file generated through those APIs. If someone can help me I will really appreciate. Actually, Eclipse BPMN2 Modeler can do that once you open a bpmn file without DI in it and save it again. But I need some library which reads a .bpmn file without DI, generates the DI for it and outputs a new .bpmn file with DI. Thank you!

nikku commented 6 years ago

The Camunda model API supports generation of BPMN diagrams with DI information, cf. documentation.

It is trivial to do for simple cases and belongs to the BPMN generators rather than our toolkit.

nikku commented 6 years ago

We'll not provide such feature out of the box any time soon. We are open to contributions that provide solid DI generation though.

zhengyang1988 commented 6 years ago

@nikku Only Camunda fluent api can generate DI information, the full api cannot generate DI information. There are some restrictions in fluent api so I have to use the full api in my project.

nikku commented 6 years ago

Only Camunda fluent api can generate DI information, the full api cannot generate DI information.

This is probably due to the reason that generating DI gets very complex pretty fast. Try to pursue the project to close this gap. The Camunda BPMN API builder is the right place to put DI generation.

nikku commented 6 years ago

Reopening this due to popular demand.

alexanderboven commented 4 years ago

Are there any plans for this enhancement anytime soon?