|
|
@ -45,22 +45,27 @@ public abstract class ProcessAbstractService implements ProcessService { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R startFlow(String userId, String dictValue, String taskId, String processName, Map<String, Object> variables) { |
|
|
|
public R startFlow(String userId, String dictValue, String taskId, String processName, Map<String, Object> variables) { |
|
|
|
log.info("开启流程....."); |
|
|
|
log.info("开启流程....."); |
|
|
|
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables); |
|
|
|
|
|
|
|
R r = new R(); |
|
|
|
R r = new R(); |
|
|
|
r.setCode(result.getCode()); |
|
|
|
try { |
|
|
|
r.setMsg(result.getMsg()); |
|
|
|
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables); |
|
|
|
// 更新任务流程Id
|
|
|
|
r.setCode(result.getCode()); |
|
|
|
if (result.isSuccess()) { |
|
|
|
r.setMsg(result.getMsg()); |
|
|
|
log.info("开启流程成功:{}",variables); |
|
|
|
// 更新任务流程Id
|
|
|
|
BladeFlow flow = result.getData(); |
|
|
|
if (result.isSuccess()) { |
|
|
|
r.setData(flow.getProcessInstanceId()); |
|
|
|
log.info("开启流程成功:{}",variables); |
|
|
|
} else { |
|
|
|
BladeFlow flow = result.getData(); |
|
|
|
log.error("开启流程失败:{}",result); |
|
|
|
r.setData(flow.getProcessInstanceId()); |
|
|
|
log.error("流程信息为{}",variables); |
|
|
|
} else { |
|
|
|
r.setData(variables); |
|
|
|
log.error("开启流程失败:{}",result); |
|
|
|
pushStartFailMessage(dictValue,Long.valueOf(taskId),userId,processName,result.getMsg()); |
|
|
|
log.error("流程信息为{}",variables); |
|
|
|
|
|
|
|
r.setData(variables); |
|
|
|
|
|
|
|
pushStartFailMessage(dictValue,Long.valueOf(taskId),userId,processName,result.getMsg()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return r; |
|
|
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
|
|
|
log.error(e.toString()) ; |
|
|
|
} |
|
|
|
} |
|
|
|
return r; |
|
|
|
return R.fail("开启流程失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
// public R compensateFlow(String userId,String dictValue,String taskId,String processName,Map<String, Object> variables) {
|
|
|
|
// public R compensateFlow(String userId,String dictValue,String taskId,String processName,Map<String, Object> variables) {
|
|
|
|
// R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables);
|
|
|
|
// R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables);
|
|
|
|