AnsweredAssumed Answered

Extend-able QueryParameters for Query API

Question asked by balsarori on Jul 26, 2014
Latest reply on Dec 1, 2014 by balsarori

Activiti's Query API fulfills most of my query requirements with some simple exceptions such as querying tasks that are assigned (assignee is not null) and querying tasks/processInstances that a user is involved in with a specific involvement type (ie kermit involved as manager).

I think that the requirements are too simple for using native queries. It would be great if the Query API provided a way to add extra query parameters. Maybe one way to achieve this is by separating parameters from the Query classes for example, moving TaskQuery parameters into a class TaskQueryParameters which holds query parameters and can be extended and passed to TaskQuery. Creating an instance of TaskQuery with a custom TaskQueryParameters can be by calling

taskService.createTaskQuery(TaskQueryParameters taskQueryParameters)

In XML parameters can be used like this

      <if test="taskParams.assigned">

The same can be applied to other Query classes. Users that want to do simple query modifications and/or additions can achieve this by extending QueryParameters without having to write native queries.

Will this be of any value?