The processVariableValue filter only woks with history level FULL as it joins on the ACT_HI_DETAIL table (but it should join on the ACT_HI_VARINST table),
YOu can easily check that by adding a process variable to the existing test cases (or add a new one of course ):
public class HistoricTaskInstanceTest extends PluggableProcessEngineTestCase {
@Deployment
public void testHistoricTaskInstance() throws Exception {
Map<String, Object> variables = new HashMap<String, Object>();
>> variables.put("hallo", "steffen");
String processInstanceId = runtimeService.startProcessInstanceByKey("HistoricTaskInstanceTest", variables).getId();
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
// Set priority to non-default value
Task runtimeTask = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();
runtimeTask.setPriority(1234);
// Set due-date
Date dueDate = sdf.parse("01/02/2003 04:05:06");
runtimeTask.setDueDate(dueDate);
taskService.saveTask(runtimeTask);
String taskId = runtimeTask.getId();
String taskDefinitionKey = runtimeTask.getTaskDefinitionKey();
HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery()
>> .processVariableValueEquals("test", "steffen")
.singleResult();
>> now historicTaskInstance is null
Problem in HistoricTaskInstance.xml:
<foreach collection="variables" index="index" item="var">
and exists (
select HD.ID_
>> from ${prefix}ACT_HI_DETAIL HD
This is the controller panel for Smart Panels app
[CAM-1502] HistoricTasKInstanceQuery with processVariableValue filter fails on history level "AUDIT"
Labels | New: AD |
Fix Version/s | New: 7.4.0 [ 13505 ] | |
Fix Version/s | New: 7.3.3 [ 13990 ] |
Fix Version/s | New: 7.2.6 [ 13790 ] | |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Remaining Estimate | New: 0 minutes [ 0 ] | |
Original Estimate | New: 0 minutes [ 0 ] |
Assignee | New: Thorben Lindhauer [ thorben.lindhauer ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Fix Version/s | New: 7.4.0-alpha1 [ 14191 ] |
Hi,
it seems this issue is already corrected, please check file HistoricTaskInstance.xml line 312.
The test case is passing with slight correction:
If needed the mentioned test case can be added to HistoricTaskInstanceTest.java, but in this case the HISTORY_LEVEL_AUDIT should be set for setHistoryLevel in processEngineConfiguration.
Br,
Alexander