use of com.b2international.snowowl.core.ServiceProvider in project snow-owl by b2ihealthcare.
the class ComponentInactivationChangeProcessor method processReactivations.
private void processReactivations(StagingArea staging, RevisionSearcher searcher, Set<String> reactivatedConceptIds, Set<String> reactivatedComponentIds) throws IOException {
ServiceProvider context = (ServiceProvider) staging.getContext();
ModuleIdProvider moduleIdProvider = context.service(ModuleIdProvider.class);
try {
Query.select(String.class).from(SnomedDescriptionIndexEntry.class).fields(SnomedDescriptionIndexEntry.Fields.ID).where(Expressions.builder().filter(SnomedDescriptionIndexEntry.Expressions.active()).filter(SnomedDescriptionIndexEntry.Expressions.concepts(reactivatedConceptIds)).filter(SnomedDescriptionIndexEntry.Expressions.activeMemberOf(Concepts.REFSET_DESCRIPTION_INACTIVITY_INDICATOR)).build()).limit(PAGE_SIZE).build().stream(searcher).forEachOrdered(hits -> {
try {
reactivateDescriptions(staging, searcher, moduleIdProvider, hits);
} catch (IOException e) {
throw new UndeclaredThrowableException(e);
}
});
} catch (UndeclaredThrowableException ute) {
// Unwrap and throw checked exception from lambda above
throw (IOException) ute.getCause();
}
}
Aggregations