use of org.kie.kogito.process.workitem.HumanTaskWorkItem in project kogito-runtimes by kiegroup.
the class TaskManagementService method updateTask.
@Override
public TaskInfo updateTask(String processId, String processInstanceId, String taskId, TaskInfo taskInfo, boolean shouldReplace, Policy<?>... policies) {
ProcessInstance<?> pi = getProcessInstance(processId, processInstanceId, taskId);
KogitoWorkItem workItem = UnitOfWorkExecutor.executeInUnitOfWork(processConfig.unitOfWorkManager(), () -> pi.updateWorkItem(taskId, wi -> {
HumanTaskWorkItemImpl humanTask = HumanTaskHelper.asHumanTask(wi);
setField(humanTask::setAdminGroups, taskInfo::getAdminGroups, shouldReplace);
setField(humanTask::setAdminUsers, taskInfo::getAdminUsers, shouldReplace);
setField(humanTask::setExcludedUsers, taskInfo::getExcludedUsers, shouldReplace);
setField(humanTask::setPotentialUsers, taskInfo::getPotentialUsers, shouldReplace);
setField(humanTask::setPotentialGroups, taskInfo::getPotentialGroups, shouldReplace);
setField(humanTask::setTaskPriority, taskInfo::getPriority, shouldReplace);
setField(humanTask::setTaskDescription, taskInfo::getDescription, shouldReplace);
setMap(humanTask::setParameters, humanTask::setParameter, taskInfo.getInputParams(), shouldReplace);
return wi;
}, policies));
return convert((HumanTaskWorkItem) workItem);
}
Aggregations