use of org.kie.kogito.internal.process.runtime.WorkItemNotFoundException in project kogito-runtimes by kiegroup.
the class LightWorkItemManager method updateWorkItem.
@Override
public <T> T updateWorkItem(String id, Function<org.kie.kogito.internal.process.runtime.KogitoWorkItem, T> updater, Policy<?>... policies) {
InternalKogitoWorkItem workItem = workItems.get(id);
if (workItem != null) {
if (!workItem.enforce(policies)) {
throw new NotAuthorizedException("User is not authorized to access task instance with id " + id);
}
T results = updater.apply(workItem);
eventSupport.fireAfterWorkItemTransition(processInstanceManager.getProcessInstance(workItem.getProcessInstanceStringId()), workItem, null, null);
return results;
} else {
throw new WorkItemNotFoundException(id);
}
}
Aggregations