use of org.molgenis.ontology.sorta.meta.SortaJobExecutionMetaData.SORTA_JOB_EXECUTION in project molgenis by molgenis.
the class SortaController method getJobsForCurrentUser.
private List<SortaJobExecution> getJobsForCurrentUser() {
final List<SortaJobExecution> jobs = new ArrayList<>();
User currentUser = userAccountService.getCurrentUser();
Query<SortaJobExecution> query = dataService.query(SORTA_JOB_EXECUTION, SortaJobExecution.class).eq(JobExecutionMetaData.USER, currentUser.getUsername());
query.sort().on(JobExecutionMetaData.START_DATE, DESC);
RunAsSystemAspect.runAsSystem(() -> query.findAll().forEach(job -> {
// TODO: fetch the user as well
job.set(JobExecutionMetaData.USER, currentUser.getUsername());
jobs.add(job);
}));
return jobs;
}
Aggregations