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

Getting possible variants of sequences from BPMN graph #194

Closed solterbeck closed 3 years ago

solterbeck commented 3 years ago

Hi PM4PY guys,

I appreciate your great work very much. One question I have:

Is there any chance to get a list of the possible allowed sequences from a BPMN file? My current approach is:

Code snippet:

 def __init__(self):
    bpmn_graph = pm4py.read_bpmn(cfg['graphs']['bpmn'])
    net, im, fm = bpmn_converter.apply(bpmn_graph)
    tree = wf_net_converter.apply(net, im, fm)  
    log = semantics.generate_log(tree, no_traces=100000)
    variants = variants_filter.get_variants(log)
    file = open(cfg['graphs']['variants'], 'w')
    i = 0
    for key in variants.keys():
        file.write(str(i) + ': ' + str(key) + '\n')
        i = i + 1
    file.close()

Statistically I can assume, that getting a log of 100000 events would meet all possible sequences. How can I then make sure, getting all sequences? Did I oversee an another possibility?

Thanks and best regards Sven

fit-alessandro-berti commented 3 years ago

Dear solterbeck,

If you can obtain a process tree out of the BPMN, you can use the extensive playout of the process tree to get all the combinations.

Please take a look at the "Extensive playout" section in https://pm4py.fit.fraunhofer.de/documentation#simulation

solterbeck commented 3 years ago

Dear Alessandro,

thanks for your quick answer. It works.