Hi everyoneIn my app I'm building workflows and I want to get the history of the workflows triggered for a specific object.When the workflows are executing, is easy to retrieve the workflows for that entity/object, the API gives everything is needed, but when it ends and it's needed to be accessed via History API I can't find a way to retrieve those objects.I will try to explain how I do it.This is how I start a workflow
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("my_object_class", myObject.getClass().getName());
variables.put("my_object_id", myObject.getId());
runtimeService.startProcessInstanceByKey(processDefinitionKey, variables);
This is how I retrieve ongoing workflows for my object
private List<ProcessInstance> returnProcessInstances(MyObject myObject) {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("my_object_class", myObject.getClass().getName());
variables.put("my_object_id", myObject.getId());
for(Map.Entry<String, Object> variable : variables.entrySet()) {
query.variableValueEquals(variable.getKey(), variable.getValue());
}
return query.list();
}
I have the history in full mode, so everything is persisted in the DB.How can I access the BD and retrieve the process instances with the variables provided? Should I do it in a different way?Thanks