Guest User

Untitled

a guest
Jul 20th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. List<JobInstance> jobInstances = jobExplorer.getJobInstances(jobName);
  2.  
  3. for (JobInstance jobInstance : jobInstances) {
  4. List<JobExecution> jobExecutions = jobExplorer.getJobExecutions(jobInstance);
  5. for (JobExecution jobExecution : jobExecutions) {
  6. if (//jobExecution.getWhatever...)) {
  7. // do your thing...
  8. }
  9. }
  10. }
  11.  
  12. List<JobInstance> lastExecutedJobs = jobExplorer.getJobInstances(jobName, 0, Integer.MAX_VALUE);
  13.  
  14. Optional<JobExecution> jobExecution = lastExecutedJobs
  15. .stream()
  16. .map(jobExplorer()::getJobExecutions)
  17. .flatMap(jes -> jes.stream())
  18. .filter(je -> BatchStatus.COMPLETED.equals(je.getStatus()))
  19. .findFirst();
Add Comment
Please, Sign In to add comment