You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The BPMN model allows to add multiple edges(edges with same source and target nodes). However, the graph from BPMN do not as it is DiGraph.
It has to be MultiDiGraph. However it does not need to pass the name attribute while adding edge in graph to allow multiple edges.
BPMN allows multiple edges by providing different names. However, the graph from bpmn do not show multiple edges. Even if the name attribute is passed to graph(fix in #202) it won't show multiple edges, because bpmn creates nx.DiGraph()
In [26]: y=BPMN.Flow(a, b, name='y')
In [27]: bpmn=BPMN()
In [28]: bpmn.add_flow(x)
In [29]: bpmn.add_flow(y)
In [30]: bpmn.get_flows()
Out[30]:
{id7daf881a-fcb5-4ec3-9dc5-b86978402c47@a->id4e566611-6a18-4f49-be78-576674b092d0@b,
id7daf881a-fcb5-4ec3-9dc5-b86978402c47@a->id4e566611-6a18-4f49-be78-576674b092d0@b}
In [31]: bpmn.get_graph().edges()
Out[31]: OutEdgeView([(7daf881a-fcb5-4ec3-9dc5-b86978402c47@a, 4e566611-6a18-4f49-be78-576674b092d0@b)])
In nx.DiGraph() it is not possible to have multiple edges. The nx.MultiDiGraph() fixes the issue. However the bpmn add/remove flows/tasks needs to tested for MultiDiGraph() to make sure it works as expected, because MultiDiGraph() adds new edge even if all values(source, target, attribute) are same(shown below).
In [32]: g=nx.DiGraph()
In [34]: g.add_edge("a", "b", name='x')
In [35]: g.add_edge("a", "b", name="y")
In [36]: g.edges()
Out[36]: OutEdgeView([('a', 'b')])
In [37]: g.edges(data=True)
Out[37]: OutEdgeDataView([('a', 'b', {'name': 'y'})])
In [38]: g=nx.MultiDiGraph()
In [40]: g.add_edge("a", "b", name='x')
Out[40]: 0In [41]: g.add_edge("a", "b", name="y")
Out[41]: 1In [42]: g.edges()
Out[42]: OutMultiEdgeDataView([('a', 'b'), ('a', 'b')])
In [43]: g.edges(data=True)
Out[43]: OutMultiEdgeDataView([('a', 'b', {'name': 'x'}), ('a', 'b', {'name': 'y'})])
In [44]: g=nx.MultiDiGraph()
In [45]: g.add_edge("a", "b")
Out[45]: 0In [46]: g.add_edge("a", "b")
Out[46]: 1In [47]: g.edges()
Out[47]: OutMultiEdgeDataView([('a', 'b'), ('a', 'b')])
In [48]: g.edges(data=True)
Out[48]: OutMultiEdgeDataView([('a', 'b', {}), ('a', 'b', {})])
My question is, what is expected? Is multiple edges in BPMN allowed, if yes then why its corresponding graph is DiGraph?
The text was updated successfully, but these errors were encountered:
The BPMN standard allows for multiple edges between the same activities. Hence, we will accept your suggestion to use MultiDiGraph for the underlying graph object, after some testing.
…mputation-in-the-simplified-interface' into 'integration'
[Priority 2] Adding methods for generalization and simplicity computation in the simplified interface
Closes#203
See merge request process-mining/pm4py/pm4py-core!1201
The BPMN model allows to add multiple edges(edges with same source and target nodes). However, the graph from BPMN do not as it is
DiGraph
.It has to be
MultiDiGraph
. However it does not need to pass the name attribute while adding edge in graph to allow multiple edges.BPMN allows multiple edges by providing different names. However, the graph from bpmn do not show multiple edges. Even if the name attribute is passed to graph(fix in #202) it won't show multiple edges, because bpmn creates
nx.DiGraph()
In
nx.DiGraph()
it is not possible to have multiple edges. Thenx.MultiDiGraph()
fixes the issue. However the bpmn add/remove flows/tasks needs to tested forMultiDiGraph()
to make sure it works as expected, becauseMultiDiGraph()
adds new edge even if all values(source, target, attribute) are same(shown below).My question is, what is expected? Is multiple edges in BPMN allowed, if yes then why its corresponding graph is
DiGraph
?The text was updated successfully, but these errors were encountered: