AnsweredAssumed Answered

Quering Ad-Hoc tasks with particular task and process params

Question asked by jonas_h on Jan 19, 2016
Latest reply on Jan 21, 2016 by jbarrez
Hi All,

we see the following unexpected behaviour quering an Ad-Hoc Task with an or() query including particular task query params and process query params.

If we perform a TaskQuery or a HistoricTaskInstanceQuery for an Ad-Hoc Task with an or() including e.g. taskId() and processDefinitionKey() in the or() part, the Ad-Hoc task is not in the result list.

This seemed to be caused by the inner join, configured in the corresponding mapping in /org/activiti/db/mapping/entity/Task.xml and HistoricTaskInstance.xml 
If we replace this with a left outer join, the query seems to be work as exepcted.

Is it a bug and if yes, would it help, if we contribute a bug ticket ?

Unit Test is attached:

public ActivitiRule activitiRule = new ActivitiRule();
@Deployment(resources = {"org/activiti/test/my-process.bpmn20.xml"})
public void test() {
   TaskService taskService = activitiRule.getTaskService();
   Task task = taskService.newTask();
   List<Task> tasks = taskService.createTaskQuery().or().taskId(task.getId()).processDefinitionKey("xyz").endOr().list();