cancel
Showing results for 
Search instead for 
Did you mean: 

History Service Variable Update

boulif18
Champ in-the-making
Champ in-the-making
I would like modify variableUpdates with historyService in JAVA.

I can gather all variable of tasks of a process instance


List<HistoricTaskInstance> historicTasks = historyService.createHistoricTaskInstanceQuery().processInstanceId(processInstanceId).list();
HashMap<String, List<HistoricDetail>> historicTaskDetails = new HashMap<String, List<HistoricDetail>>();
      for (HistoricTaskInstance historicTask : historicTasks) {
         historicTaskDetails.put(historicTask.getId(), historyService.createHistoricDetailQuery().taskId(historicTask.getId()).list());
      }
   
      for(Entry<String, List<HistoricDetail>> entry : historicTaskDetails.entrySet()) {
          key = entry.getKey();
          List<HistoricDetail> listTaskDetail = entry.getValue();
          for (int iteration = 0; iteration<listTaskDetail.size(); iteration++) {
             HistoricVariableUpdate historicVariableUpdate = (HistoricVariableUpdate) listTaskDetail.get(iteration);
             variableName = historicVariableUpdate.getVariableName();
          }
      }

How can i modify an historicVariableUpdate ?

Thanks
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
You can't. At least not with the API. The idea is that history = audit data, and audit data can't be changed.

Of course, you can always add your own custom query that allows this.

senniappans
Champ in-the-making
Champ in-the-making
Are those audit data to be part of elasticsearch ? how to do we stop certain data to be stored/considered as audit data?

jbarrez
Star Contributor
Star Contributor
> Are those audit data to be part of elasticsearch

Elasticsearch is used in the enterprise product (did't get that from your original question). It's used for analytics only there, not for audit. All the audit data remains in the database.