当前位置:网站首页>Pm4py - analyze what BPMN can be converted into process tree
Pm4py - analyze what BPMN can be converted into process tree
2022-04-22 13:20:00 【DreamingBetter】
background
Read manually drawn BPMN chart , Want to convert it into Process Tree, It must be converted into WF-net.
However, there are irregularities or differences in logic BPMN Cannot be converted to a unique WF-net, It can't be converted into Process Tree.
Process Tree: Process tree , abbreviation PT;
WF-net: Workflow net ,workflow-net, abbreviation WF-net( yes Petri net A kind of subnet );
Problems encountered ( One )

As shown in the figure above , Say what you give Petri net Is not a WF-net. In fact, normal will not cause this error report , Later it was found that BPMN The annotation of the drawing is wrong , The end of the event is marked as an intermediate event , So draw a BPMN At least be careful , And it's best to conform to the well structured arrangement BPMN. May refer to BPMN - How to draw the basis of good structure arrangement BPMN?
Problems encountered ( Two )

As shown in the figure above , say WF-net Parse failure . Tracing to the source , Click the error reporting line to locate the error reporting source code .

You can see that the cause of this error is len(grouped_net.transitions) It's not equal to 1.
Let's take a look at this grouped_net What is it , Locate above group_blocks_in_net function .

In fact, it's from the right petri net Make a deal . Return to the processed petri net, So this grouped_net That's what happened petri net.
So this grouped_net Of transitions What is it? , Let's print out this code , Print out the relevant information .
The following reads an error reporting that the above conversion failed BPMN.
bpmn_graph = pm4py.read_bpmn('D:\\PM data \\diagram (10).bpmn')
bpmn_graph = layouter.apply(bpmn_graph)
net, im, fm = bpmn_converter.apply(bpmn_graph)
print(net)
print()
grouped_net = tpt.group_blocks_in_net(net, parameters={
})
print(grouped_net.transitions)
print(len(grouped_net.transitions))

The first three lines have not been processed petri net Properties of
The penultimate line is processed transitions attribute
The last line is the number of attributes , That is, the front is not equal to 1 The value of
Why is it equal to 1 Well ? I put the above wrong BPMN Replace it with one that can be converted successfully BPMN

Yes , His number is 1. If you look closely, it really has only one tuple , The first parameter inside is the label , The second parameter is a string .
Take a closer look at his string , In fact, it is a PT Structure , It turns out that it is through this long string to convert into PT Of .
That's why he len(grouped_net.transitions) It's not equal to 1, You can't put untreated petri net convert to PT Why .
Because of this BPMN Logical differences or other reasons , So that he can't merge into 1 A complete process .
These are the analysis process .
The phenomenon :
The above is wrong BPMN in , I want to draw it as a PT There will be logical differences , I can't draw it at all . Because it is found that the cycle will lead to the conversion into coincidence PT Can't express when .
Possible causes :
BPMN Of XOR The gateway appears nested , Logical confusion and disagreement .
Conclusion :
Avoid nested gateways . After a gateway forks out , To merge back .
matters needing attention :
- Try to avoid gateway nesting ( Take the cycle , In this cycle , It's best to be wrapped by two gateways , Don't stretch a line out of the loop at a node in the loop , That is, don't create complications ), You can refer to the cycle in the figure below .

It can be converted into PT,reinitiate request Is the event that triggers the loop .

- Painted BPMN Of XOR Branching and merging can best be seen as two branches , The last two branches merge .
As shown in the figure below , gateway 1, You can think of the whole block above as an event , In this way, it can be regarded as the bifurcation of two events , Finally, merge the two events with the merge gateway . In fact, this is also to avoid nesting .

* If you have questions about this article ( for example : Incorrect knowledge points or expressions in the notes ), Welcome to point out , Learn together and make progress .
版权声明
本文为[DreamingBetter]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221306374588.html
边栏推荐
猜你喜欢

Rsync remote synchronization

Wong Kwong Yu Kwai tiktok is unable to sleep soundly.

Altium Designer导出Gerber文件的一般步骤

Trying to access array offset on value of type int

Partition - elegant violence

Rust实现斐波那契数

Ora-1652 cannot extend temp tablespace

生态 | 万里数据库与溢信科技完成兼容认证

难得盈利或是昙花一现,达芙妮学不会南极人

各省GTFP綠色全要素生產率面板數據(2004-2018年)
随机推荐
Redis persistence
Fade in and fade out function of C form (project source code)
关于chartjs 屏幕大小自适应
The compatibility certification of ecological Wanli database and Yixin technology has been completed
分享下最近遇到的5种网站变慢的案例
算法---反转链表(Kotlin)
ROS机器人学习——麦克纳姆轮运动学解算
Alibaba cloud changes its commander and competes for Huawei's territory
分块——优雅的暴力
500 Internal Server Error错误补充
C whether the administrator has the authority to run the software
Ora-1652 cannot extend temp tablespace
About chartjs screen size adaptation
Inamori Kazuo: face the reality, think hard and fight head-on
MySQL 使用存储过程添加数据
Walking in the clouds - above firewood, rice, oil and salt
Learn shell script (5) -- function, random number, regular expression
Algorithm --- reverse linked list (kotlin)
RT-Thread配置SPI-Flash(W25Q256)
Knowledge to be learned