cancel
Showing results for 
Search instead for 
Did you mean: 

Quering Ad-Hoc tasks with particular task and process params

jonas_h
Champ in-the-making
Champ in-the-making
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:


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

jbarrez
Star Contributor
Star Contributor
It looks like a bug, yes. Afaics, that query should return the result.