Commit 321640e9 by huangfusuper

异步实例保护

parent 29ede9b7
......@@ -14,6 +14,7 @@ import com.byit.dto.specials.RepairFlow;
import com.byit.dto.specials.RepairTimeParam;
import com.byit.enums.*;
import com.byit.enums.plugin.PluginNodeTypeEnum;
import com.byit.enums.task.RunResultEnum;
import com.byit.job.utils.CronExpression;
import com.byit.job.utils.CurrentUserUtils;
import com.byit.job.utils.PlaceholderUtils;
......@@ -1668,6 +1669,9 @@ public class ApiFlowServiceImpl implements ApiFlowService {
StringBuffer runids = new StringBuffer();
//暂停工作流调度
recordingList.forEach(runRecording -> {
if(RunRecordingEnum.FLOW_STATUS_IS_END.getCode().equals(runRecording.getFlowStatus())){
throw new RuntimeException(String.format("实例%s是完结状态", runRecording.getFlowName()));
}
//runRecordingMapper.stopByRunIdAndFlowId(runRecording.getRunId(), runRecording.getFlowId());
runRecordingMapper.stopByRunIdAndFlowId(runRecording.getRunId(), runRecording.getFlowId());
jobTaskMapper.stopByRunIdAndFlowId(runRecording.getRunId(), runRecording.getFlowId());
......
......@@ -71,6 +71,9 @@ public class RpcCallbackInstanceRunTheLifeCycleCallback implements InstanceRunTh
CallbackDto callbackDto = new CallbackDto();
PluginRpcRequestPacket param = buildPluginRpcRequestPacket(runRecording,callbackDto,rpcServerKey);
PluginRpcResponsePacket call = taskServer.call(param);
if (!call.isStatus()) {
throw new RuntimeException(call.getMsg());
}
Object result = call.getResult();
ReturnResult<String> returnResult = (ReturnResult<String>) result;
ScriptParamAndPlaceholderDto rpcScriptParamAndPlaceholderDto = JSON.parseObject(returnResult.getContent(), ScriptParamAndPlaceholderDto.class);
......
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