Friday, August 15, 2014

Activiti 5.16.1 released

Today we released Activiti 5.16.1. This is mainly a bug fix release for Activiti 5.16 and doesn't include any database changes other than the usual version update in the property table.

Although it's a bug fix release, we've added a nice new query capability for process instances and tasks, an OR statement. Now you can query for process instances and tasks using one chain of OR statements using our query API. It can be used like this:

runtimeService.createProcessInstanceQuery()
     .or().processDefinitionKey("test").processDefinitionName("Test").endOr().list();

But you can of course also mix with AND statements like:

taskService.createTaskQuery().taskNameLike('%Test%')
     .or().taskOwner('kermit').taskAssignee('kermit').endOr().list();

This will result in a query like:

WHERE task.name like '%Test%' AND (task.owner = 'kermit' OR task.assignee = 'kermit')

Current limitations of the or construct are:
  1. You can use only one chain of OR statements right now. So you can't use the or and endOr methods more than once.
  2. You can use a specific field only once in an OR statement, so you can't use processDefinitionId twice in an OR statement for example. Only the second value will be used in that case.

We welcome any feedback and suggestions on this new query API option. If we get positive feedback, it will be added to more query APIs for the next release. Enjoy!