@Test public void testLoadPriorProgressNull() { doReturn(null).when(mockLaunchDataWrapper).getLastProgressObject(any()); operationConductor.loadPriorProgress(); }
protected void loadPriorProgress() { AgendaProgress agendaProgress = executorContext.getLaunchDataWrapper().getLastProgressObject(AgendaProgress.class); if(agendaProgress == null || agendaProgress.getOperationProgress() == null || pendingOperations.size() == 0) { logger.debug("No prior progress loaded"); return; } logger.debug("Processing prior progress"); Map<String, OperationWrapper> operationWrapperMap = new HashMap<>(); pendingOperations.forEach(opWrapper -> operationWrapperMap.put(opWrapper.getOperation().getName(), opWrapper)); Arrays.stream(agendaProgress.getOperationProgress()) .filter(operationProgress -> isOperationSuccessful(operationProgress) && operationProgress.getOperation() != null) .forEach(operationProgress -> { OperationWrapper operationWrapper = operationWrapperMap.get(operationProgress.getOperation()); if(operationWrapper != null) { operationWrapper.setSuccess(true); operationWrapper.setOutputPayload(operationProgress.getResultPayload()); postProcessCompletedOperation(operationWrapper); } }); if(completedOperations.size() > 0) { logger.info("Completed Operation Progress found for operations: {}", completedOperations.stream().map(ow -> ow.getOperation().getName()).collect(Collectors.joining(","))); executorContext.getAgendaProgressReporter().incrementCompletedOperationCount(completedOperations.size()); } Arrays.stream(agendaProgress.getOperationProgress()) .filter(operationProgress -> !isOperationSuccessful(operationProgress) && operationProgress.getProcessingState() != ProcessingState.WAITING && operationProgress.getOperation() != null) .forEach(operationProgress -> { OperationWrapper operationWrapper = operationWrapperMap.get(operationProgress.getOperation()); if(operationWrapper != null) { operationWrapper.setPriorExecutionOperationProgress(operationProgress); } }); }
OperationConductor implements OnOperationCompleteListener { protected void loadPriorProgress() { AgendaProgress agendaProgress = executorContext.getLaunchDataWrapper().getLastProgressObject(AgendaProgress.class); if(agendaProgress == null || agendaProgress.getOperationProgress() == null || pendingOperations.size() == 0) { logger.debug("No prior progress loaded"); return; } logger.debug("Processing prior progress"); Map<String, OperationWrapper> operationWrapperMap = new HashMap<>(); pendingOperations.forEach(opWrapper -> operationWrapperMap.put(opWrapper.getOperation().getName(), opWrapper)); Arrays.stream(agendaProgress.getOperationProgress()) .filter(operationProgress -> isOperationSuccessful(operationProgress) && operationProgress.getOperation() != null) .forEach(operationProgress -> { OperationWrapper operationWrapper = operationWrapperMap.get(operationProgress.getOperation()); if(operationWrapper != null) { operationWrapper.setSuccess(true); operationWrapper.setOutputPayload(operationProgress.getResultPayload()); postProcessCompletedOperation(operationWrapper); } }); if(completedOperations.size() > 0) { logger.info("Completed Operation Progress found for operations: {}", completedOperations.stream().map(ow -> ow.getOperation().getName()).collect(Collectors.joining(","))); executorContext.getAgendaProgressReporter().incrementCompletedOperationCount(completedOperations.size()); } Arrays.stream(agendaProgress.getOperationProgress()) .filter(operationProgress -> !isOperationSuccessful(operationProgress) && operationProgress.getProcessingState() != ProcessingState.WAITING && operationProgress.getOperation() != null) .forEach(operationProgress -> { OperationWrapper operationWrapper = operationWrapperMap.get(operationProgress.getOperation()); if(operationWrapper != null) { operationWrapper.setPriorExecutionOperationProgress(operationProgress); } }); } }
OperationConductor implements OnOperationCompleteListener { protected void loadPriorProgress() { AgendaProgress agendaProgress = executorContext.getLaunchDataWrapper().getLastProgressObject(AgendaProgress.class); if(agendaProgress == null || agendaProgress.getOperationProgress() == null || pendingOperations.size() == 0) { logger.debug("No prior progress loaded"); return; } logger.debug("Processing prior progress"); Map<String, OperationWrapper> operationWrapperMap = new HashMap<>(); pendingOperations.forEach(opWrapper -> operationWrapperMap.put(opWrapper.getOperation().getName(), opWrapper)); Arrays.stream(agendaProgress.getOperationProgress()) .filter(operationProgress -> isOperationSuccessful(operationProgress) && operationProgress.getOperation() != null) .forEach(operationProgress -> { OperationWrapper operationWrapper = operationWrapperMap.get(operationProgress.getOperation()); if(operationWrapper != null) { operationWrapper.setSuccess(true); operationWrapper.setOutputPayload(operationProgress.getResultPayload()); postProcessCompletedOperation(operationWrapper); } }); if(completedOperations.size() > 0) { logger.info("Completed Operation Progress found for operations: {}", completedOperations.stream().map(ow -> ow.getOperation().getName()).collect(Collectors.joining(","))); executorContext.getAgendaProgressReporter().incrementCompletedOperationCount(completedOperations.size()); } Arrays.stream(agendaProgress.getOperationProgress()) .filter(operationProgress -> !isOperationSuccessful(operationProgress) && operationProgress.getProcessingState() != ProcessingState.WAITING && operationProgress.getOperation() != null) .forEach(operationProgress -> { OperationWrapper operationWrapper = operationWrapperMap.get(operationProgress.getOperation()); if(operationWrapper != null) { operationWrapper.setPriorExecutionOperationProgress(operationProgress); } }); } OperationConductor(Collection<Operation> operations, ExecutorContext executorContext,
        List<OperationConductorModifier> completedOperationModifiers);  OperationConductor(Collection<Operation> operations, ExecutorContext executorContext); }
OperationConductor implements OnOperationCompleteListener { protected void loadPriorProgress() { AgendaProgress agendaProgress = executorContext.getLaunchDataWrapper().getLastProgressObject(AgendaProgress.class); if(agendaProgress == null || agendaProgress.getOperationProgress() == null || pendingOperations.size() == 0) { logger.debug("No prior progress loaded"); return; } logger.debug("Processing prior progress"); Map<String, OperationWrapper> operationWrapperMap = new HashMap<>(); pendingOperations.forEach(opWrapper -> operationWrapperMap.put(opWrapper.getOperation().getName(), opWrapper)); Arrays.stream(agendaProgress.getOperationProgress()) .filter(operationProgress -> isOperationSuccessful(operationProgress) && operationProgress.getOperation() != null) .forEach(operationProgress -> { OperationWrapper operationWrapper = operationWrapperMap.get(operationProgress.getOperation()); if(operationWrapper != null) { operationWrapper.setSuccess(true); operationWrapper.setOutputPayload(operationProgress.getResultPayload()); postProcessCompletedOperation(operationWrapper); } }); if(completedOperations.size() > 0) { logger.info("Completed Operation Progress found for operations: {}", completedOperations.stream().map(ow -> ow.getOperation().getName()).collect(Collectors.joining(","))); executorContext.getAgendaProgressReporter().incrementCompletedOperationCount(completedOperations.size()); } Arrays.stream(agendaProgress.getOperationProgress()) .filter(operationProgress -> !isOperationSuccessful(operationProgress) && operationProgress.getProcessingState() != ProcessingState.WAITING && operationProgress.getOperation() != null) .forEach(operationProgress -> { OperationWrapper operationWrapper = operationWrapperMap.get(operationProgress.getOperation()); if(operationWrapper != null) { operationWrapper.setPriorExecutionOperationProgress(operationProgress); } }); } OperationConductor(Collection<Operation> operations, ExecutorContext executorContext,
        List<OperationConductorModifier> completedOperationModifiers);  OperationConductor(Collection<Operation> operations, ExecutorContext executorContext); void run(); @Override void onComplete(OperationWrapper operationWrapper); List<OperationWrapper> getRunningOperations(); List<OperationWrapper> getPendingOperations(); List<OperationWrapper> getFailedOperations(); JsonContextUpdater getJsonContextUpdater(); List<DiagnosticEvent> retrieveAllDiagnosticEvents(); boolean hasExecutionFailed(); String getFailedOperationsDelimited(String delimiter); void setCompletedOperationModifiers(List<OperationConductorModifier> completedOperationModifiers); }
OperationConductor implements OnOperationCompleteListener { protected void loadPriorProgress() { AgendaProgress agendaProgress = executorContext.getLaunchDataWrapper().getLastProgressObject(AgendaProgress.class); if(agendaProgress == null || agendaProgress.getOperationProgress() == null || pendingOperations.size() == 0) { logger.debug("No prior progress loaded"); return; } logger.debug("Processing prior progress"); Map<String, OperationWrapper> operationWrapperMap = new HashMap<>(); pendingOperations.forEach(opWrapper -> operationWrapperMap.put(opWrapper.getOperation().getName(), opWrapper)); Arrays.stream(agendaProgress.getOperationProgress()) .filter(operationProgress -> isOperationSuccessful(operationProgress) && operationProgress.getOperation() != null) .forEach(operationProgress -> { OperationWrapper operationWrapper = operationWrapperMap.get(operationProgress.getOperation()); if(operationWrapper != null) { operationWrapper.setSuccess(true); operationWrapper.setOutputPayload(operationProgress.getResultPayload()); postProcessCompletedOperation(operationWrapper); } }); if(completedOperations.size() > 0) { logger.info("Completed Operation Progress found for operations: {}", completedOperations.stream().map(ow -> ow.getOperation().getName()).collect(Collectors.joining(","))); executorContext.getAgendaProgressReporter().incrementCompletedOperationCount(completedOperations.size()); } Arrays.stream(agendaProgress.getOperationProgress()) .filter(operationProgress -> !isOperationSuccessful(operationProgress) && operationProgress.getProcessingState() != ProcessingState.WAITING && operationProgress.getOperation() != null) .forEach(operationProgress -> { OperationWrapper operationWrapper = operationWrapperMap.get(operationProgress.getOperation()); if(operationWrapper != null) { operationWrapper.setPriorExecutionOperationProgress(operationProgress); } }); } OperationConductor(Collection<Operation> operations, ExecutorContext executorContext,
        List<OperationConductorModifier> completedOperationModifiers);  OperationConductor(Collection<Operation> operations, ExecutorContext executorContext); void run(); @Override void onComplete(OperationWrapper operationWrapper); List<OperationWrapper> getRunningOperations(); List<OperationWrapper> getPendingOperations(); List<OperationWrapper> getFailedOperations(); JsonContextUpdater getJsonContextUpdater(); List<DiagnosticEvent> retrieveAllDiagnosticEvents(); boolean hasExecutionFailed(); String getFailedOperationsDelimited(String delimiter); void setCompletedOperationModifiers(List<OperationConductorModifier> completedOperationModifiers);  }