pm4py-core icon indicating copy to clipboard operation
pm4py-core copied to clipboard

Duplicated sequence from activity to Exclusive Gateway in BPMN visualization

Open jacaballero opened this issue 1 year ago • 5 comments

Hi all,

I don't know if this is a problem with the library or if it is accepted in BPMN models, but I have been working for a long time with other frameworks such as ProM, and it's the first time that I found it.

I'm importing a CSV log to show its BPMN model. When I apply a significant noise_threshold (i.e. 0.20), a duplicated sequence with two exclusive gateways is shown as appears in the image below:

screenshot

The function where I create and save the BPMN is very simple, it is included below:

# BPMN: Discover and save model
def get_bpmn(filtered_log, file_name):
    noise_threshold = 0.0
    noise_threshold = float(input("Insert the ratio (0-100) to filter infrequent paths: "))
    bpmn_model = pm4py.discover_bpmn_inductive(filtered_log, noise_threshold/100)
    pm4py.save_vis_bpmn(bpmn_model, file_name)

When I get the BPMN model without filtering infrequent paths (or with scarce filters as 0.01), this doesn't happen.

Could you help me with this, please?

Thanks

jacaballero avatar Mar 14 '24 11:03 jacaballero

Dear @jacaballero

It's not technically wrong, but we'll have a look to avoid these double arcs in the conversion

fit-alessandro-berti avatar Mar 14 '24 12:03 fit-alessandro-berti

Dear @fit-alessandro-berti

That's great.

Thank you for your quick response.

jacaballero avatar Mar 14 '24 14:03 jacaballero

By the way, could you attach a small example log where this happens?

Cheers

fit-alessandro-berti avatar Mar 14 '24 14:03 fit-alessandro-berti

The log that I'm using has 240000 lines in XES format. I'll try to test if with a sample of the traces it happens as well.

jacaballero avatar Mar 14 '24 15:03 jacaballero

Dear @fit-alessandro-berti

I attached a CSV sample of where this happens. I loaded it as below:

log = pm4py.format_dataframe(pandas.read_csv('filtered_file.csv', sep=';'), case_id='case_id',activity_key='concept:name', timestamp_key='time:timestamp')

And then applied the function that I included in a previous comment.

Hope this helps to debug it.

Regards

filtered_file.csv

jacaballero avatar Mar 15 '24 09:03 jacaballero

Thanks, we identified and resolved the issue :-)

fit-alessandro-berti avatar Mar 22 '24 06:03 fit-alessandro-berti

I checked the last version and now it works. Thank you!!

jacaballero avatar Mar 22 '24 14:03 jacaballero