cancel
Showing results for 
Search instead for 
Did you mean: 

Get User tasks based on Priority

rahul_mackdani
Champ in-the-making
Champ in-the-making
Hi

I have a requirement where in I want all the user tasks based on multiple priority.

e.g. : I want tasks with priority 2 and 3

TaskQuery interface has method "taskPriority" in which we can pass only single value of priority

Do we have an option/method where in we can pass multiple priority in a single call?

Regards



3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Rahul,

In the described case try to use

  /** Only select tasks with the given priority or higher. */
  TaskQuery taskMinPriority(Integer minPriority);

  /** Only select tasks with the given priority or lower. */
  TaskQuery taskMaxPriority(Integer maxPriority);

Another option could be NativeTaskQuery.

Regards
Martin

rahul_mackdani
Champ in-the-making
Champ in-the-making
Hi Martin

Can you provide reference to existing native query which is called for say my tasks or my pooled tasks so that we can add our filters to the same

Regards

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Rahul.

Native queries supports your own defined queries on the activiti DB.
Usage example can be found here org.activiti.engine.test.api.task.TaskQueryTest#testNativeQuery.

Can you provide reference to existing native query
I do not know whether such an example exists. You can create one.

Regards
Martin