Hi all,I tried to enable the history-feature for variables with <property name="history" value="full" /> in activiti-context.xml in order to see variable updates via the rest method "ProcessInstance/{processId}".My process contains null-values by default because some variables are set in later tasks.No, I wanted to test the feature and figured out that this is a problem:
private void addVariableList(String processInstanceId, ObjectNode responseJSON) {
List<HistoricDetail> variableList = ActivitiUtil.getHistoryService()
.createHistoricDetailQuery()
.processInstanceId(processInstanceId)
.variableUpdates()
.orderByTime()
.desc()
.list();
if(variableList != null && variableList.size() > 0) {
ArrayNode variablesJSON = new ObjectMapper().createArrayNode();
responseJSON.put("variables", variablesJSON);
for (HistoricDetail historicDetail : variableList) {
HistoricVariableUpdate variableUpdate = (HistoricVariableUpdate) historicDetail;
ObjectNode variableJSON = new ObjectMapper().createObjectNode();
variableJSON.put("variableName", variableUpdate.getVariableName());
variableJSON.put("variableValue", variableUpdate.getValue().toString());
variableJSON.put("variableType", variableUpdate.getVariableTypeName());
variableJSON.put("revision", variableUpdate.getRevision());
variableJSON.put("time", RequestUtil.dateToString(variableUpdate.getTime()));
variablesJSON.add(variableJSON);
}
}
}
The exception happens at variableJSON.put("variableValue", variableUpdate.getValue().toString());java.lang.NullPointerException at org.activiti.rest.api.process.ProcessInstanceResource.addVariableList(ProcessInstanceResource.java:163)because some of my variables are null. I think it can be a normal condition that variables are null, so I think this is a bug.Is there a bug-tracker where I can report this problem or is it sufficient to post it here in the forum?All the best,Thomas