Commit 8d767aee by guominglei

修改重跑时运行实例状态

parent 8db192ba
...@@ -591,6 +591,12 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -591,6 +591,12 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//生成运行实例 //生成运行实例
RunRecording newRunRecording = buildRunRecording(runRecording, triggerTime, reRunId, flow, userName); RunRecording newRunRecording = buildRunRecording(runRecording, triggerTime, reRunId, flow, userName);
runRecording.setFlowStatus(RunRecordingEnum.FLOW_STATUS_RUN_ING.getCode());
runRecording.setFlowRunResult(null);
runRecordingMapper.updateState(runRecording);
//将工作流下的节点改为运行中
jobTaskRunLogMapper.updateByFlowIdAndRunId(flow.getFlowId(), runInfo.getRunId());
//生成新的工作流实例 //生成新的工作流实例
runRecordingMapper.saveRunRecording(newRunRecording); runRecordingMapper.saveRunRecording(newRunRecording);
jobTaskMapper.saveJobTasks(jobTaskList); jobTaskMapper.saveJobTasks(jobTaskList);
...@@ -616,6 +622,9 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -616,6 +622,9 @@ public class ApiFlowServiceImpl implements ApiFlowService {
if (dependNodeIdList != null && dependNodeIdList.size() > 0){ if (dependNodeIdList != null && dependNodeIdList.size() > 0){
jobTask.setNodeDepend(Joiner.on(",").join(dependNodeIdList)); jobTask.setNodeDepend(Joiner.on(",").join(dependNodeIdList));
} }
//将节点对应的日志改为运行中
jobTaskRunLog.setRunCode(NodeRunStatusPropertyEnum.RUN_ING.getCode());
jobTaskRunLogMapper.updateJobTaskRunLog(jobTaskRunLog);
jobTaskList.add(jobTask); jobTaskList.add(jobTask);
//查询依赖于当前节点的下级节点 //查询依赖于当前节点的下级节点
List<Integer> childNodeIdList = nodeDependencyMapper.findSubNodeList(childNodeId); List<Integer> childNodeIdList = nodeDependencyMapper.findSubNodeList(childNodeId);
......
...@@ -152,4 +152,6 @@ public interface JobTaskRunLogMapper { ...@@ -152,4 +152,6 @@ public interface JobTaskRunLogMapper {
List<JobTaskRunLog> findJavaTaskByTaskName(@Param("nodeIdList")List<Integer> nodeIdList, @Param("startTime")Date startTime, @Param("endTime")Date endTime); List<JobTaskRunLog> findJavaTaskByTaskName(@Param("nodeIdList")List<Integer> nodeIdList, @Param("startTime")Date startTime, @Param("endTime")Date endTime);
JobTaskRunLog findNewJavaTaskByJobName(Integer javaTaskId); JobTaskRunLog findNewJavaTaskByJobName(Integer javaTaskId);
int updateByFlowIdAndRunId(@Param("flowId")Integer flowId, @Param("runId")String runId);
} }
\ No newline at end of file
...@@ -636,4 +636,8 @@ ...@@ -636,4 +636,8 @@
</set> </set>
where log_id = #{logId,jdbcType=INTEGER} where log_id = #{logId,jdbcType=INTEGER}
</update> </update>
<update id="updateByFlowIdAndRunId">
update job_task_run_log set run_code = '0'
where flow_id = #{flowId} and run_id = #{runId}
</update>
</mapper> </mapper>
\ No newline at end of file
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