Commit 4b395198 by huangfusuper

工作流运行实例增加开始时间和结束时间

parent dd74a46b
...@@ -17,6 +17,7 @@ import org.springframework.context.ApplicationEventPublisherAware; ...@@ -17,6 +17,7 @@ import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -67,6 +68,7 @@ public class ClosingExampleThreadRunHelper extends BaseThreadRunHelper implement ...@@ -67,6 +68,7 @@ public class ClosingExampleThreadRunHelper extends BaseThreadRunHelper implement
runRecording.setFlowRunResult(runCode); runRecording.setFlowRunResult(runCode);
log.debug("----------------扫描到有完结的运行实例{},{}-------------",runCode, RunRecordingEnum.FLOW_STATUS_IS_END.getCode()); log.debug("----------------扫描到有完结的运行实例{},{}-------------",runCode, RunRecordingEnum.FLOW_STATUS_IS_END.getCode());
runRecording.setFlowStatus(RunRecordingEnum.FLOW_STATUS_IS_END.getCode()); runRecording.setFlowStatus(RunRecordingEnum.FLOW_STATUS_IS_END.getCode());
runRecording.setEndTime(new Date());
runRecordingService.updateRunRecordingById(runRecording); runRecordingService.updateRunRecordingById(runRecording);
applicationEventPublisher.publishEvent(new EndFlowEvent(this,flowId)); applicationEventPublisher.publishEvent(new EndFlowEvent(this,flowId));
} }
......
...@@ -24,6 +24,7 @@ import org.springframework.stereotype.Component; ...@@ -24,6 +24,7 @@ import org.springframework.stereotype.Component;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -190,6 +191,7 @@ public class TaskThreadRunHelper extends BaseThreadRunHelper { ...@@ -190,6 +191,7 @@ public class TaskThreadRunHelper extends BaseThreadRunHelper {
Integer flowId = thisJobTask.getFlowId(); Integer flowId = thisJobTask.getFlowId();
RunRecording runRecordingByFlowIdAndRunId = runRecordingService.findRunRecordingByFlowIdAndRunId(flowId, runId); RunRecording runRecordingByFlowIdAndRunId = runRecordingService.findRunRecordingByFlowIdAndRunId(flowId, runId);
runRecordingByFlowIdAndRunId.setFlowStatus(FlowPropertyEnum.FLOW_RUN_ING.getCode()); runRecordingByFlowIdAndRunId.setFlowStatus(FlowPropertyEnum.FLOW_RUN_ING.getCode());
runRecordingByFlowIdAndRunId.setStartTime(new Date());
runRecordingService.updateRunRecordingById(runRecordingByFlowIdAndRunId); runRecordingService.updateRunRecordingById(runRecordingByFlowIdAndRunId);
} }
......
...@@ -60,6 +60,20 @@ public class RegistryServiceRegistry extends ServiceRegistry { ...@@ -60,6 +60,20 @@ public class RegistryServiceRegistry extends ServiceRegistry {
return registryClient.registry(registryDataList); return registryClient.registry(registryDataList);
} }
public static void main(String[] args) throws InterruptedException {
/*for (int i = 0; i < 10; i++) {
Thread.sleep(1000);*/
RegistryClient registryClient = new RegistryClient("http://localhost:8080/myth-register", null, "myth-job", "test");
List<RegistryDataParamVO> registryDataList = new ArrayList<>();
RegistryDataParamVO registryDataParamVO = new RegistryDataParamVO("testRun","127.0.0.1:8989");
RegistryDataParamVO registryDataParamVO1 = new RegistryDataParamVO("testRun","127.0.0.1:8975");
registryDataList.add(registryDataParamVO);
registryDataList.add(registryDataParamVO1);
registryClient.registry(registryDataList);
//}
}
@Override @Override
public boolean remove(Set<String> keys, String value) { public boolean remove(Set<String> keys, String value) {
if (keys==null || keys.size() == 0 || value == null) { if (keys==null || keys.size() == 0 || value == null) {
......
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