use of com.evolveum.midpoint.cases.api.request.ReleaseWorkItemsRequest in project midpoint by Evolveum.
the class WorkItemManager method releaseWorkItem.
// We can eventually provide bulk version of this method as well.
public void releaseWorkItem(WorkItemId workItemId, Task task, OperationResult parentResult) throws ObjectNotFoundException, SecurityViolationException, SchemaException, ObjectAlreadyExistsException, CommunicationException, ConfigurationException, ExpressionEvaluationException {
OperationResultBuilder builder = parentResult.subresult(OPERATION_RELEASE_WORK_ITEM).addArbitraryObjectAsParam("workItemId", workItemId);
boolean tracingRequested = startTracingIfRequested(builder, task, parentResult);
OperationResult result = builder.build();
try {
LOGGER.trace("Releasing work item {}", workItemId);
ReleaseWorkItemsRequest request = new ReleaseWorkItemsRequest(workItemId.caseOid);
request.getReleases().add(new ReleaseWorkItemsRequest.SingleRelease(workItemId.id));
caseEngine.executeRequest(request, task, result);
} catch (ObjectNotFoundException | SecurityViolationException | RuntimeException | SchemaException | ObjectAlreadyExistsException | ExpressionEvaluationException | ConfigurationException | CommunicationException e) {
result.recordFatalError("Couldn't release work item " + workItemId + ": " + e.getMessage(), e);
throw e;
} finally {
result.computeStatusIfUnknown();
storeTraceIfRequested(tracingRequested, task, result, parentResult);
}
}
Aggregations