07-20-2012 11:52 AM
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);
}
}
}
07-23-2012 02:47 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.