package org.springblade.mdm.flow.service;
|
|
import lombok.AllArgsConstructor;
|
import org.flowable.engine.RuntimeService;
|
import org.flowable.engine.runtime.ProcessInstance;
|
import org.springframework.stereotype.Service;
|
|
@AllArgsConstructor
|
@Service
|
public class FlowCommonService {
|
private final RuntimeService runtimeService;
|
|
/**
|
* 根据流程实例id获取definitionKey
|
* @param processInstanceId
|
* @return
|
*/
|
public String getDefinitionKey(String processInstanceId){
|
|
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery()
|
.processInstanceId(processInstanceId)
|
.singleResult();
|
return processInstance.getProcessDefinitionKey();
|
}
|
|
}
|