cancel
Showing results for 
Search instead for 
Did you mean: 

Search with a specific field in Activiti

lnavet
Champ in-the-making
Champ in-the-making


Hello everyone,

Currently I have an application that is separated into 2, an HMI part with an input form and a server part with activiti. Each time I finish a task in my workflow I save the JSON form in the variables of the current task and I finish the task :

this.taskService.complete (task.getId (), variables);

Here is my problem, inside my JSON form there is a date that the user inputs and I have to do sorting on it.

Knowing that if I have a volumetry of 200000 tasks, it is not necessary that for each task I go through its variables ... it is too in terms of time.

What is the solution that I have to put in place?

I thank you in advance.

Regards,
Lawrence.

1 REPLY 1

gdharley
Elite Collaborator
Elite Collaborator

Lawrence,

I am not sure how you are retrieving you list of tasks, but if it is via the REST API, you can use the historic process instance query API to filter by any process variable.

Details are below:

Activiti User Guide - Historic process Instance Query 

Now, this would require that you know the exact data that you are interested in and if you are looking for accounts that fund on a particular day, or for employees that are terminated on a specfic day, then this would work just fine.
Available operators include greater than and less than, so if you needed al tasks with a variable between two dates it would require two calls.

If you are using th Java API, you can do exactly the same thing with the HistoricTaskInstanceQuery :
HistoricTaskInstanceQuery (Activiti - Engine 5.22.0 API) 

Hope this is what you were after.

Greg