Commit 65b5ae9a by huangfusuper

工作流运行唯一判断

parent 6d08ed46
......@@ -7,6 +7,7 @@ import com.byit.model.Node;
import com.byit.service.FlowService;
import com.byit.service.NodeService;
import com.byit.service.RunNodeServer;
import com.byit.service.RunRecordingService;
import com.byit.thread.BaseThreadRunHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
......@@ -30,12 +31,15 @@ public class FlowThreadRunHelper extends BaseThreadRunHelper {
private final FlowService flowService;
private final NodeService nodeService;
private final RunNodeServer runNodeServer;
private final RunRecordingService runRecordingService;
public FlowThreadRunHelper(DataSource dataSource, FlowService flowService, NodeService nodeService, RunNodeServer runNodeServer) {
public FlowThreadRunHelper(DataSource dataSource, FlowService flowService, NodeService nodeService,
RunNodeServer runNodeServer, RunRecordingService runRecordingService) {
this.dataSource = dataSource;
this.flowService = flowService;
this.nodeService = nodeService;
this.runNodeServer = runNodeServer;
this.runRecordingService = runRecordingService;
}
@Override
......@@ -45,7 +49,12 @@ public class FlowThreadRunHelper extends BaseThreadRunHelper {
List<Flow> halfAnHourFlow = flowService.findHalfAnHourFlow(preTestTime);
if (CollectionUtil.isNotEmpty(halfAnHourFlow)) {
for(Flow flow : halfAnHourFlow ){
log.debug("-----------------【工作流{}的执行次数大于0,放行】-------------------------",flow.getFlowName());
log.debug("-----------------【工作流{}的执行次数不等于0,放行】-------------------------",flow.getFlowName());
if (runRecordingService.findRunRecordingIsRunning(flow.getFlowId())) {
//TODO 是否可以使用事件通知机制,由完结的工作流实例通知通过流可以运行了
log.info("-----工作流{},有正在运行中的实例,跳过等待------",flow);
continue;
}
//String versionName = flow.getVersionName()
Integer flowId = flow.getFlowId();
//根据工作流查询工作流下所有的节点
......
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