Closed NKMatha closed 1 year ago
Dear @NKMatha
Please consider and adapt the following code:
import pm4py
log = pm4py.read_xes("tests/input_data/receipt.xes")
dfg, sa, ea = pm4py.discover_dfg(log)
filtered_log = pm4py.filter_variants_top_k(log, 6)
bpmn_graph = pm4py.discover_bpmn_inductive(filtered_log)
net, im, fm = pm4py.convert_to_petri_net(bpmn_graph)
try:
process_tree = pm4py.convert_to_process_tree(net, im, fm)
# extracts the footprints from the process tree (very efficient!)
fps = pm4py.discover_footprints(process_tree)
except:
# extracts the footprints from the Petri net (less efficient)
fps = pm4py.discover_footprints(net, im, fm)
allowed_rels = fps["sequence"].union(fps["parallel"])
dfg_list = sorted(list((x, y) for x, y in dfg.items()), key=lambda x: (x[1], x[0])) for el in dfg_list: if el[0] in allowed_rels: print(el, " is allowed") else: print(el, " IS NOT ALLOWED")
Thanks @fit-alessandro-berti,
So, as per the code can i set the color property to elements to dfg in last conditional loop?
You would need to create a specific visualization for the use case
Hi @fit-alessandro-berti i would like to know that can we have dfg in a structured and organized way so that can be look good(like a flow charts something...), As of now my dfg nodes were getting scattered.
Unfortunately that's not possible. We already use the Dot algorithm which is very advanced. There are specialized algorithms but we'll not implement them in the near future in pm4py.
Hi,
Am looking to compare bpmn file with the dfg graph and highlight the dfg graph path(lets say green) which matches the bpmn graph. Is it possible to make this comparison? If yes, please let me know how could i achieve it.