TaskQuery missing .variableValueEquals()

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2011 11:10 AM
Hi,
I started evaluating Activiti and I am quite impressed. It was very easy to write an example workflow and use the API, straight foward, very nice, thanks for the execellent work.
I implemented a simple order management with these nodes:
Start -> UserTask -> ServiceTask -> End
The UserTask sets a variable that decides if the order goes to the ServiceTask or to an EndError node, this works fine so far.
Concerning performance I am stuck at the moment because my TaskQuery is way too slow. I am not sure if I misuse Activiti or if a feature is missing.
When I start the workflow I set a variable "department" = "dep1". This way I started 100.000 Workflows for 500 different departments - this was very fast as well.
To get the tasks I do the following at the moment:
Obviously this runs forever. 100.000+1 SQL Queries are executed, then I have to throw away 99.800 of the results.
Querying the process instances on the other hand is very fast:
So this should be possible for Tasks as well?
Thanks,
Thomas
I started evaluating Activiti and I am quite impressed. It was very easy to write an example workflow and use the API, straight foward, very nice, thanks for the execellent work.
I implemented a simple order management with these nodes:
Start -> UserTask -> ServiceTask -> End
The UserTask sets a variable that decides if the order goes to the ServiceTask or to an EndError node, this works fine so far.
Concerning performance I am stuck at the moment because my TaskQuery is way too slow. I am not sure if I misuse Activiti or if a feature is missing.
When I start the workflow I set a variable "department" = "dep1". This way I started 100.000 Workflows for 500 different departments - this was very fast as well.
To get the tasks I do the following at the moment:
TaskQuery taskQuery = taskService.createTaskQuery();taskQuery.taskDefinitionKey("userTask");taskQuery.taskName("Allow order");List<Task> taskList = taskQuery.list();for (Task task : taskList) { Map<String, Object> variables = taskService.getVariables(task.getId()); final String taskDepartment = (String)variables.get("department"); if (taskDepartment.matches("dep1")) { System.out.println("Hit!"); }}
Obviously this runs forever. 100.000+1 SQL Queries are executed, then I have to throw away 99.800 of the results.
Querying the process instances on the other hand is very fast:
ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery();query.variableValueEquals("department", "dep1");rc = query.list();
So this should be possible for Tasks as well?
Thanks,
Thomas
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2011 05:26 AM
I started evaluating Activiti and I am quite impressed. It was very easy to write an example workflow and use the API, straight foward, very nice, thanks for the execellent work.
Thanks!
Regarding your question: It is not yet possible to query tasks using variables.
I've filed a feature request for it: http://jira.codehaus.org/browse/ACT-501
However, this will not be implemented in the near future due to more important feature requests at this moment.
Alternatively, we can offer a 'backport' to run custom SQL queries, see http://jira.codehaus.org/browse/ACT-502
This can be implemented very quickly. Are you capable/willing of building from trunk and trying this fix for us?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2011 09:25 AM
I've filed a feature request for it: http://jira.codehaus.org/browse/ACT-501
However, this will not be implemented in the near future due to more important feature requests at this moment.
Alternatively, we can off a 'backport' to run custom SQL queries, see http://jira.codehaus.org/browse/ACT-502
This can be implemented very quickly. Are you capable/willing of building from trunk and trying this fox for us?
Yes of course.
At the moment this is a showstopper for me but I really like Activiti. If there is a way around the showstopper I'd be happy to help out.
Thanks for your help!
Regards,
Thomas
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2011 03:02 AM
Hi,
I just resolved http://jira.codehaus.org/browse/ACT-588, which adds taskVariableValueEquals() to the taskQuery, will be available in 5.3.
I just resolved http://jira.codehaus.org/browse/ACT-588, which adds taskVariableValueEquals() to the taskQuery, will be available in 5.3.
