Commit 6b7066b5 by huangfusuper

开始工作流增加运行标识

parent fc5dbe84
......@@ -1524,18 +1524,18 @@ public class ApiFlowServiceImpl implements ApiFlowService {
ValidationUtil.dataNotBank(workspaceName, "工作空间名称不允许为空!");
//获取工作流名称
String flowName = jsonObject.getString("flowName");
String runId = jsonObject.getString("runId");
ValidationUtil.dataNotBank(flowName, "工作流名称不允许为空!");
ValidationUtil.dataNotBank(runId, "运行标识不允许为空,请检查参数 'runId' 是否存在!");
Workspace byName = workspaceMapper.getByName(workspaceName);
ValidationUtil.isTrueValidation(byName == null, "没有此工作空间");
List<RunRecording> runRecordings = runRecordingMapper.runIngRunRecording(flowName, byName.getWorkspaceId());
ValidationUtil.isTrueValidation(CollectionUtil.isEmpty(runRecordings), "没有正在运行中的实例!");
List<RunRecording> collect = runRecordings.stream().filter(runRecording -> "3".equals(runRecording.getFlowStatus())).collect(Collectors.toList());
ValidationUtil.isTrueValidation(CollectionUtil.isEmpty(collect), "没有暂停的实例!");
List<String> runIds = collect.stream().map(RunRecording::getRunId).collect(Collectors.toList());
String join = StringUtils.join(runIds, ",");
List<RunRecording> collect = runRecordings.stream().filter(runRecording -> "3".equals(runRecording.getFlowStatus()) && runId.equals(runRecording.getRunId())).collect(Collectors.toList());
ValidationUtil.isTrueValidation(CollectionUtil.isEmpty(collect), "该实例不是暂停状态!");
StopFlowParam stopFlowParam = new StopFlowParam();
stopFlowParam.setRunIds(join);
stopFlowParam.setRunIds(runId);
stopFlowParam.setFlowName(flowName);
stopFlowParam.setAllStartFlow("1");
reStartSchedule(stopFlowParam);
......
......@@ -378,10 +378,11 @@ public class JobUtils {
return JSON.parseObject(response, ResponseResult.class);
}
public static ResponseResult unsuspendFlow(String flowName, String workspaceName){
public static ResponseResult unsuspendFlow(String flowName, String workspaceName, String runId){
Map<String, String> map = new HashMap<>(5);
map.put("flowName", flowName);
map.put("workspaceName", workspaceName);
map.put("runId", runId);
//发送请求 添加任务
String response = createHttpRequest(REQUEST_FLOW_START_UNSUSPENDFLOW, "param=" + JSON.toJSONString(map, WriteClassName));
log.debug("--------------------开始接口调用成功,结果为:{}------------------------", response);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment