Hi there,
I have a process application using camunda tasklist and embedded forms and I need to prevent specific users being assigned to specific user tasks. The business requirement is: the initiator of a process needs to see an approval task in his tasklist (to see who is working on it) but may not claim this task himself. The username of the initiator is provided as a process variable and I’m using (something like) the following task listener to prevent the assignment:
@Component
@Slf4j
public class PreventAssignmentListener implements TaskListener {
@Override
public void notify(DelegateTask delegateTask) {
if ("horst".equalsIgnoreCase(delegateTask.getAssignee())) {
throw new RuntimeException("User 'horst' is not allowed to claim this task!");
}
log.info("Assigned task to {}", delegateTask.getAssignee());
}
}
So far, so good – it works. But now I don’t want to see the standard error overlay to be shown in the tasklist web app but trigger a custom notification. Any ideas how I can achieve this?
Thanks & Cheers…
Jo