c.addFilterInventoryStatus(InventoryStatus.UNINVENTORIED);
doomedResources.addAll(resourceManager.findResourcesByCriteria(overlord, c));
// invoke bulk delete on the resource to remove any dependencies not defined in the hibernate entity model
// perform in-band and out-of-band work in quick succession
for (Resource doomed : doomedResources) {
List<Integer> deletedIds = resourceManager.uninventoryResource(overlord, doomed.getId());
for (Integer deletedResourceId : deletedIds) {
resourceManager.uninventoryResourceAsyncWork(overlord, deletedResourceId);
}
}