05-10-2012 01:37 AM
10-03-2012 06:44 AM
10-03-2012 07:05 AM
Hi all
I have a process which contains the user tasks, am able to successfully submit the user form using activiti api's and the variable data is stored in act_hi_details table successfully.
am not able to retrieve the history data from the act_hi_details table.
As per user guide the query is
"historyService.createHistoricDetailQuery()
.variableUpdates()
.processInstanceId("123")
.orderByVariableName().asc()
.list()" which returns List<HistoricDetail>, but am not able to extract form data i.e, variable name and value from the historyDetails object.
thanks,
kleyo
List<HistoricDetail> list = historyService.createHistoricDetailQuery().processInstanceId(processInstance.getId()).list();
for (HistoricDetail historicDetail : list) {
HistoricVariableUpdateEntity variable = (HistoricVariableUpdateEntity) historicDetail;
System.out.println(variable.getName() + " = " + variable.getValue());
}
10-03-2012 07:19 AM
Exception in thread "main" java.lang.ClassCastException: org.activiti.engine.impl.persistence.entity.HistoricFormPropertyEntity cannot be cast to org.activiti.engine.impl.persistence.entity.HistoricVariableUpdateEntity
10-03-2012 08:09 AM
Hi kafeitu,
Thank u for yr immediate reply… I get the following Exception when i try to do that:Exception in thread "main" java.lang.ClassCastException: org.activiti.engine.impl.persistence.entity.HistoricFormPropertyEntity cannot be cast to org.activiti.engine.impl.persistence.entity.HistoricVariableUpdateEntity
I m using activiti-5.10
List<HistoricDetail> details = historyService.createHistoricDetailQuery().processInstanceId(processInstance.getId()).list();
for (HistoricDetail historicDetail : details) {
if (historicDetail instanceof HistoricFormPropertyEntity) {
HistoricFormPropertyEntity formEntity = (HistoricFormPropertyEntity) historicDetail;
System.out.println(String.format("form->, key: %s, value: %s", formEntity.getPropertyId(), formEntity.getPropertyValue()));
} else if (historicDetail instanceof HistoricVariableUpdateEntity) {
HistoricVariableUpdateEntity varEntity = (HistoricVariableUpdateEntity) historicDetail;
System.out.println(String.format("variable->, key: %s, value: %s", varEntity.getName(), varEntity.getValue()));
}
}
List<HistoricDetail> formDetails = historyService.createHistoricDetailQuery().processInstanceId(processInstance.getId()).formProperties().list();
10-04-2012 09:57 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.