Hi Team,
I’m facing a issue for finding the entier Task History Based on the processInstanceKey with custom Queries in camunda 8,
Below is my code snippet, Here when I claim/unclaim and change the assignee for a particular task’s User Tasks, I’m unable to get that claim/unclaim statuses of the Assigne in the Task History with the below Queries, kindly anyone address this issue and help in solving this.
I have tried to query in both Elastic Search and Task List as well but I’m facing the same issue
For Elastic Search:
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery()
.must(QueryBuilders.matchQuery("value.tenantId", tenantId))
.must(QueryBuilders.matchQuery("value.processInstanceKey", executionId));
SearchRequest searchRequest = new SearchRequest(Constants.JOB_RECORD_INDEX_KEY);
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
searchSourceBuilder.query(boolQuery);
searchSourceBuilder.size(Constants.RETRIVAL_SIZE);
searchRequest.source(searchSourceBuilder);
SearchResponse searchResponse = restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT);
For Task List:
if (tasklistClient == null) {
try {
tasklistClient();
} catch (TaskListException e) {
logger.error("Error initializing tasklist client", e);
throw e;
}
}
TaskSearch ts = new TaskSearch().setProcessInstanceKey(executionId);
TaskList tasksFromInstance = tasklistClient.getTasks(ts);
List<Task> tasks = tasksFromInstance.getItems();
Thank You in advance !