介绍
Flowable流程实例processInstance基本操作
- 流程开启
- 流程中止
- 流程激活
- 流程删除
- 流程查询
1. maven项目依赖
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-boot-starter-process</artifactId>
<version>6.7.2</version>
</dependency>
2. 流程processInstance基本操作
public class ProcessInstanceServiceImpl implements ProcessInstanceService {
private final RuntimeService runtimeService;
@Override
public ProcessInstance startProcessInstanceByKey(@NonNull String processDefinitionKey, Map<String, Object> variables) {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processDefinitionKey, variables);
if (log.isDebugEnabled()) {
log.debug("start process instance key: {}, piId: {}", processDefinitionKey, processInstance.getProcessInstanceId());
}
return processInstance;
}
@Override
public ProcessInstance startProcessInstanceByKeyAndTenantId(@NonNull String processDefinitionKey, String tenantId, Map<String, Object> variables) {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKeyAndTenantId(processDefinitionKey, variables, tenantId);
if (log.isDebugEnabled()) {
log.debug("start process instance key: {}, tenantId: {}, piId: {}", processDefinitionKey, tenantId, processInstance.getProcessInstanceId());
}
return processInstance;
}
@Override
public ProcessInstance startProcessInstanceByKey(@NonNull String processDefinitionKey, String businessKey, Map<String, O