use of com.b2international.snowowl.snomed.reasoner.classification.ClassificationSchedulingRule in project snow-owl by b2ihealthcare.
the class ClassificationCreateRequest method execute.
@Override
public String execute(final BranchContext context) {
final String repositoryId = context.info().id();
final Branch branch = context.branch();
final ClassificationTracker tracker = context.service(ClassificationTracker.class);
final SnomedCoreConfiguration config = context.service(SnomedCoreConfiguration.class);
final String user = !Strings.isNullOrEmpty(userId) ? userId : context.service(User.class).getUsername();
tracker.classificationScheduled(classificationId, reasonerId, user, branch.path());
final AsyncRequest<Boolean> jobRequest = new ClassificationJobRequestBuilder().setReasonerId(reasonerId).setParentLockContext(parentLockContext).addAllConcepts(additionalConcepts).build(branch.path());
final ClassificationSchedulingRule rule = ClassificationSchedulingRule.create(config.getMaxReasonerCount(), repositoryId, branch.path());
JobRequests.prepareSchedule().setKey(classificationId).setUser(user).setRequest(jobRequest).setDescription(String.format("Classifying the ontology on %s", branch.path())).setSchedulingRule(rule).buildAsync().get(context, SCHEDULE_TIMEOUT_MILLIS);
return classificationId;
}
Aggregations