pm4py / pm4py-core

Public repository for the PM4Py (Process Mining for Python) project.
https://pm4py.fit.fraunhofer.de
GNU General Public License v3.0
722 stars 286 forks source link

BPMN layouter is not working #352

Closed f4rih closed 1 year ago

f4rih commented 1 year ago

Hello After upgrading pm4py to version 2.2.29 and 2.2.30 I got a problem with the BPMN layout, it actually generates the BPMN file (In this example from petree net) but the positioning of nodes have a problem. In many situations, nodes are merged together and the whole graph is messed up.

Here is my code :

ptree = inductive_miner.apply_tree(event_log, parameters=parameters)
bpmn = pt_converter.apply(ptree, variant=pt_converter.Variants.TO_BPMN)
bpmn_graph = layouter.apply(bpmn)
bpmn_exporter.apply(bpmn_graph, "my_bpmn_file.bpmn")

So I've tested the graph with https://bpmn.io and here is the result:

bpmn_layout

Thanks in advanced

fit-alessandro-berti commented 1 year ago

Dear @f4rih

Our current BPMN layouter is based on Graphviz. This is not exceptional in layouting real-life models.

In the current release (2.2.31) I changed a bit the parameters of the layouter, in order to better fit larger models. I hope you'll benefit from this change.

f4rih commented 1 year ago

Dear @fit-alessandro-berti

Thank you so much for your quick response, I'll check that and will let you know. Cheers.

f4rih commented 1 year ago

Dear @fit-alessandro-berti I've checked your fix, and it's ok now but the space between the nodes is expended a bit more than expected. by the way, thank you so much for your hotfix.

fit-alessandro-berti commented 1 year ago

Yes indeed the drawback of the proposed fix is the enlargement of the layout. We'll investigate in better layouting algorithms

f4rih commented 1 year ago

Yes indeed the drawback of the proposed fix is the enlargement of the layout. We'll investigate in better layouting algorithms

Thank you, also there is a another way if it's possible for you, If layouter function could have the Graphviz hyper parameters it would be more flexible and better.