*/
public static ProcessInstance start(String processDefinitionKey, String processDefinitionId, Connection connection) {
System.out.println("=====定时任务启动 " + new Date() + " =====");
StartProcessInstanceCommand startProcessInstanceCommand = new StartProcessInstanceCommand();
// 如果是找最新流程启动就用这个
if (processDefinitionKey != null || processDefinitionId != null) {
if (processDefinitionKey != null) {
startProcessInstanceCommand.setProcessDefinitionKey(processDefinitionKey);
} else {
startProcessInstanceCommand.setProcessDefinitionId(processDefinitionId);
}
} else {
throw new FixFlowException("processDefinitionKey和processDefinitionId不能都为空!");
}
//startProcessInstanceCommand.setBusinessKey(businessKey);
startProcessInstanceCommand.setStartAuthor(Authentication.getAdminId());
// 瞬态变量
Map<String, Object> transientVariableMap = new HashMap<String, Object>();
// 设定瞬态变量
startProcessInstanceCommand.setTransientVariables(transientVariableMap);
// 获取流程引擎
ProcessEngine processEngine = ProcessEngineManagement.getDefaultProcessEngine();