Filter by current user in the Java API

Hello,

I’m new to Camunda and I’m using the Java API in a project, I’ve defined a filter with the following criteria:

candidateUser = ${currentUser()}

However, when I execute the filter through the “list()” method in the filter service I am getting the following error:

ENGINE-16004 Exception while closing command context: Unable to invoke method ‘taskCandidateUser’ on class 'org.camunda.bpm.engine.impl.TaskQueryImpl

I’m guessing the cause of the problem is I haven’t set the current user anywhere, but I’m not sure where or how I should set it. So I have the following questions:

  1. Where does the engine get the current user from when executing a filter?
  2. How should I set the current user?

Thanks

Hi,

Please post the complete stacktrace and Camunda version.

Cheers,
Thorben

i’m also facing the same issue.
@j.abbona did yu found the solution?