docs: update wg-basic/activiti
This commit is contained in:
parent
5f0013816a
commit
c1684aa4cd
@ -2,7 +2,7 @@
|
|||||||
title: 6.流程引擎模块
|
title: 6.流程引擎模块
|
||||||
description: activiti流程引擎模块的使用
|
description: activiti流程引擎模块的使用
|
||||||
published: true
|
published: true
|
||||||
date: 2021-09-04T06:09:54.249Z
|
date: 2021-09-24T09:52:45.835Z
|
||||||
tags: wg-basic, activiti
|
tags: wg-basic, activiti
|
||||||
editor: markdown
|
editor: markdown
|
||||||
dateCreated: 2021-09-01T09:28:31.684Z
|
dateCreated: 2021-09-01T09:28:31.684Z
|
||||||
@ -61,4 +61,22 @@ spring:
|
|||||||
|
|
||||||
# 添加菜单
|
# 添加菜单
|
||||||
|
|
||||||
菜单路径为:`/route/activiti/list`
|
菜单路径为:`/route/activiti/list`
|
||||||
|
|
||||||
|
# 如何启动流程
|
||||||
|
|
||||||
|
1. 在流程管理菜单下将流程绘制好并部署后,会生成 **部署ID(deploymentId)**
|
||||||
|
2. 使用如下代码启动流程
|
||||||
|
|
||||||
|
```java
|
||||||
|
// 获取流程定义
|
||||||
|
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).singleResult();
|
||||||
|
// 获取流程定义ID
|
||||||
|
String processDefinitionId = processDefinition.getId();
|
||||||
|
// 流程变量(如果需要)
|
||||||
|
Map<String, Object> variableMap = new HashMap<>();
|
||||||
|
// 业务ID(如果需要)
|
||||||
|
String businessId = "businessId";
|
||||||
|
// 启动流程
|
||||||
|
ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinitionId, "businessId", variableMap);
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user