Ah, got it! I had changed the history level AFTER creating the process. Once I re-created the process with the history level at audit, it works.
However, I want to be able to do it using process variables:
List<HistoricTaskInstance> historicTasks = historyService.createHistoricTaskInstanceQuery()
.taskAssignee(username)
.processVariableValueEquals(ProcessVariablesEnum.PROCESS_ID.getName(), processId)
This is NOT working, even though the equivalent query for active tasks:
taskService.createTaskQuery()
.taskAssignee(username)
.processVariableValueEquals(ProcessVariablesEnum.PROCESS_ID.getName(), processId)
Works to get the task, then I complete it, and the equivalent history query does not work.
Is audit the history level that should work for keeping process and task variables? Or do I need to do full to get the history query to work with process variables? I see the history record in the database, so completing the task is working as expected.
Thanks.