use of com.adobe.acs.commons.util.visitors.TreeFilteringResourceVisitor in project acs-aem-commons by Adobe-Consulting-Services.
the class ControlledProcessManagerImpl method getInactiveProcesses.
@Override
public Collection<ProcessInstance> getInactiveProcesses() {
ArrayList<ProcessInstance> processes = new ArrayList();
try (ResourceResolver rr = getServiceResourceResolver()) {
Resource tree = rr.getResource(ProcessInstanceImpl.BASE_PATH);
TreeFilteringResourceVisitor visitor = new TreeFilteringResourceVisitor();
visitor.setLeafVisitor((r, l) -> {
if (!activeProcesses.containsKey(r.getName())) {
processes.add(r.adaptTo(ArchivedProcessInstance.class));
}
});
visitor.accept(tree);
} catch (LoginException ex) {
LOG.error("Error getting inactive process list", ex);
}
return processes;
}
Aggregations