Filtering Process Instances and User Tasks

Hi,

I have a dashboard that displays all the user tasks for multiple processes. I wanted to implement a functionality to filter these tasks based on multiple filter values.

I am planning to assign some labels to each task/process. A task can have multiple labels. We are not using these variables to make flow decisions in the BPMN diagram.

  1. Can we store these values as process variables? Ideally, we should store variables as process variables that make the decision to take a certain flow in the BPMN diagram.

  2. Can we create a process variable that can store multiple labels and query the task using TaskService?

  3. Can we create a query that will return all the tasks with a certain label like “lang_en”? As mentioned below

execution.setVariable("language_label", ["lang_en", "lang_eu"])

val query = taskService.createTaskQuery().processVariableValueEquals("language_label", "lang_en")

Hey @navnjangir,

  1. Yes, you can story anything as a variable on the process level
  2. Yes, you can create a process variable and use the task service to query on that
  3. Yes you can query something like that

All your questions are possible. However, not in the way you have done it. First of all you are storing the language_label as a List, which stores it as serializable. We recommend not storing data in such a manner.

When querying you can only query on data that matches the simple type. For example you should store the language_label in multiple variables, e.g. language_label_en, language_label_de, etc. And then use an or to query on those. Keep in mind that using an or and querying on process variables might make be slow.

Cheers,
Filip