当前位置:网站首页>PM4PY - BPMN support
PM4PY - BPMN support
2022-04-22 13:07:00 【DreamingBetter】
BPMN支持
在pm4py,我们提供导入/导出/布局BPMN图表的支持。这些支持仅限于以下BPMN元素:
- Events:事件(开始/结束事件)
- Tasks:任务
- Gateways:网关(排他的,平行的,包容的)
而且,我们提供在PM4PY中实施的流程模型的相互转换(例如:Petri nets 和BPMN 图标)
导入
import pm4py
import os
bpmn_graph = pm4py.read_bpmn(os.path.join("tests", "input_data", "running-example.bpmn"))
导出
bpmn_graph应该就是pm4py里的bpmn对象;enable_layout设置为True,在导出之前启用 BPMN 模型的自动布局。
import pm4py
import os
pm4py.write_bpmn(bpmn_graph, "ru.bpmn", enable_layout=True)
布局
一个布局操作尝试给BPMN图标的节点和边缘一个好的位置。
from pm4py.objects.bpmn.layout import layouter
bpmn_graph = layouter.apply(bpmn_graph)
转换成Petri net
将 BPMN 模型转换为 Petri net模型可以实现不同的 PM4Py 算法(例如一致性检查和模拟算法)
from pm4py.objects.conversion.bpmn import converter as bpmn_converter
net, im, fm = bpmn_converter.apply(bpmn_graph)
从Process Tree(PT)转换成BPMN
示例代码中,首先我们导入XES事件日志,我们用inductive miner(感应矿工)挖掘一个模型。返回一个PT对象。
import pm4py
import os
log = pm4py.read_xes(os.path.join("tests", "input_data", "running-example.xes"))
tree = pm4py.discover_process_tree_inductive(log)
接下来,我们将其转换成BPMN图表
from pm4py.objects.conversion.process_tree import converter
bpmn_graph = converter.apply(tree, variant=converter.Variants.TO_BPMN)
*若对本文有疑问(例如:笔记中知识点或表达有误),欢迎指出,共同学习进步。
版权声明
本文为[DreamingBetter]所创,转载请带上原文链接,感谢
https://blog.csdn.net/DreamingBetter/article/details/123712463
边栏推荐
- Redis update
- redis 更新升级版本
- R language uses the scale function to standardize and scale dataframe data (set the scale parameter, divide the scale parameter setting by the standard deviation)
- sprintf格式化字符串
- Redis本地连接查看数据
- 科技产品宣传片制作成本的重要性!
- Ros2 - teach you to write a topic hand in hand
- ROS机器人学习——TF坐标变换
- RT-Thread配置SPI-Flash(W25Q256)
- Example accumulation of two-dimensional line drawing function plot () in MATLAB
猜你喜欢
随机推荐
R语言多条决策曲线分析DCA(Decision Curve Analysis)曲线可视化在同一图像中、使用png函数将决策曲线分析DCA可视化结果保存为png格式
ROS2——什么是接口
calloc和realloc
Fade in and fade out function of C form (project source code)
redis的key都变成了backup,值也都不见了,这是为什么呢?
With the help of digital business cloud real estate industry procurement platform solution, realize simple, intelligent and compliant procurement
树莓派压缩备份
The R language uses the rowsums function to calculate the row data sum value of all data rows in the dataframe
ROS Robot Learning -- kinematics solution of mcnamu wheel
sprintf格式化字符串
STM32CubeMX重定向printf输出至串口
2022年上半年软考备考冲刺攻略
Mysql database has been started successfully, but show is not an internal or external command. How to solve it?
数商云:数字化采购浪潮下,企业如何实现局部突破,小步快跑
数商云电子招投标系统解决方案丨规范政采流程,提高工作效率
如何成为开源数据库开发人员?
JS box moves with the mouse when clicked
R语言编写决策曲线DCA(Decision Curve Analysis)函数、多条决策曲线分析DCA曲线可视化在同一图像中
Redis advantages and disadvantages usage scenarios
一句代码将OpenCV的Mat对象的数据打印输出









