package org.fh.controller.act;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.fh.controller.base.BaseController;
import org.flowable.common.engine.impl.identity.Authentication;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.runtime.ProcessInstance;
public class AcStartController extends BaseController {
@Autowired
private RuntimeService runtimeService;
protected String startProcessInstanceByKey(String processInstanceKey){
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processInstanceKey);
return processInstance.getId();
}
protected String startProcessInstanceByKeyHasVariables(String processInstanceKey,Map<String,Object> map, String USERNAME){
Authentication.setAuthenticatedUserId(USERNAME);
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processInstanceKey, map);
Authentication.setAuthenticatedUserId(null);
return processInstance.getId();
}
protected String startProcessInstanceById(String processInstanceId){
ProcessInstance processInstance = runtimeService.startProcessInstanceById(processInstanceId);
return processInstance.getId();
}
}
本作品採用《CC 協議》,轉載必須註明作者和本文連結