forked from SWISDATA/processintel
mining.fuzzy: mining crashes or shows a stale graph when only one activity remains #6
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ffrauenberger/ProcessIntel#6
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: critical (the first run crashes when the filters leave one activity)
Where
app/mining_algorithms/fuzzy_mining.py:106-114,:829-868Problem
__calculate_first_ruleremoves node i whencounter == len(events) - 1. With exactly one event both sides are0, so the only node is always removed.nodes_after_first_ruleis then empty, andgenerate_graphruns:This writes into the existing
self.graphinstead of creating a new graph:self.graphisNone, which raises an uncaughtAttributeError: 'NoneType' object has no attribute 'add_start_node'.self.graphis the previous graph, which already has aStartnode. This raisesDuplicateNodeException, which is caught as aGraphException: the user sees "Do not change the parameters while mining" and the old graph stays on screen (see #8).Steps to reproduce
Alternatively: on any log, set Node Frequency (normalized) or SPM high enough that only one activity remains.
Expected behavior
Mining completes and shows an empty graph with only Start and End nodes.
Actual behavior
AttributeError).Possibly the same bug as upstream GitHub issue SWISDATA/processintel#27 (
self.graphisNonewhen no significant node is left on the first run).Fix
Use
self.graph = self.graph_converter.build_empty_graph(rankdir="TB")(as already done at line 65) before adding Start/End, and/or special-caselen(events) == 1in the first rule.from
issues/BUG-006-fuzzy-miner-crashes-when-one-activity-remains.md(code analysis of commit6bcc646, 2026-10-03)Reviewed by Codex (GPT-6) against origin/main
6bcc646eb464.Review: partially correct.
Reproduced the first-run
AttributeErrorwith a single retained activity. The proposed fix needs one correction:DFGConverter.build_empty_graph()already adds Start, End and their connecting edge. Replace the entire lines 110–114 branch with assignment to that helper followed byreturn; inserting the helper assignment before the existingadd_start_node()/add_end_node()calls would raiseDuplicateNodeException. Whether a one-activity log should instead preserve its visible activity is a separate model-behavior decision.Code references: app/mining_algorithms/fuzzy_mining.py:110, app/converters/dfg_converter.py:34.