1.安装IDEA插件Flowable BPMN visualizer
IDEA插件市场中搜索Flowable BPMN visualizer
安装该插件
2.创建流程图
2.1.创建流程图文件
在resources下创建myProcess.bpmn20.xml流程图。
创建时名称只用输入myProcess
2.2.创建流程图
- 选中myProcess.bpmn20.xml,右键打开流程图设计界面
- 设计流程图
流程名称和id
创建开始事件
创建用户任务
指定任务责任人zhangsan
和lisi
创建结束事件
连线
2.3.部署和执行流程
依次执行下列方法
public class Test02 {
ProcessEngineConfiguration configuration = null;
@Before
public void before(){
// 获取 ProcessEngineConfiguration 对象
configuration = new StandaloneProcessEngineConfiguration();
// 配置 相关的数据库的连接信息
configuration.setJdbcDriver("com.mysql.cj.jdbc.Driver");
configuration.setJdbcUsername("root");
configuration.setJdbcPassword("123456");
configuration.setJdbcUrl("jdbc:mysql://localhost:3306/flowable-learn?serverTimezone=UTC&nullCatalogMeansCurrent=true");
// 如果数据库中的表结构不存在就新建
configuration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
}
/**
* 部署流程
*
*/
@Test
public void testDeploy()