Make state node of workflow graph unique

Quite a few model have states with the same name (e.g. "open",
"close).  When creating Workflow Graphs for several of these models at
once, the nodes of these states must be distinguished.  Otherwise the
graphs will overlap and eventually even overwrite each other.

Closes #12253
(grafted from 91a09102ec61a08f57868bc9f030fdcb9ab831c8)

--HG--
branch : 6.0
This commit is contained in:
Hartmut Goebel committed 2023-11-19 12:16:03 +01:00
1 parent c5d2e432cd
commit 2ca461397f
1 file changed
+5 -3
+5 -3
View File
@@ -1537,10 +1537,12 @@ class ModelWorkflowGraph(Report):
state_field = getattr(Model, Model._transition_state)
for state, _ in state_field.selection:
node = pydot.Node(
'"%s"' % state, shape='octagon', label=state)
f'"{record.model}--{state}"', shape='octagon', label=state)
subgraph.add_node(node)
for from_, to in Model._transitions:
edge = pydot.Edge('"%s"' % from_, '"%s"' % to,
arrowhead='normal')
edge = pydot.Edge(
f'"{record.model}--{from_}"',
f'"{record.model}--{to}"',
arrowhead='normal')
subgraph.add_edge(edge)