How can I avoid task being assigned to process starter?

Hi,

I am using standalone version of camunda and communicating with it via rest calls. There is a business rule that claiming that one task cannot be allocated by the creator. I can’t find any filter that provides this functionality for me when I read get tasks details (Get Tasks (POST) | docs.camunda.org). Is there any best practise for this or should I store the creator on process variables and filter according to this variable? Thanks for your answers.

There is no default functionality to enforce that specific rule that I’m aware of. These kinds of checks are usually implemented by configuring Java listeners to the appropriate tasks. In this case, you could take the initiator of the process (from a variable or somewhere else) to compare to and add them to a blocklist for that specific task instance. When gathering the list of tasks for a user, you check against that list to prevent access. Unfortunately, this requires an explosion of queries/requests which can hurt the performance. In addition to that, or instead, you can configure an assignment listener that does the same check. That ensures that even if the user manages to attempt to claim the task, it won’t be allowed.