本文整理汇总了Java中org.activiti.engine.history.HistoricDetail类的典型用法代码示例。如果您正苦于以下问题:Java HistoricDetail类的具体用法?Java HistoricDetail怎么用?Java HistoricDetail使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HistoricDetail类属于org.activiti.engine.history包,在下文中一共展示了HistoricDetail类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: packageVariables
import org.activiti.engine.history.HistoricDetail; //导入依赖的package包/类
/**
* 读取历史变量并封装到Map中
*/
private Map<String, Object> packageVariables(ProcessInstance processInstance) {
Map<String, Object> historyVariables = new HashMap<String, Object>();
List<HistoricDetail> list = historyService.createHistoricDetailQuery().processInstanceId(processInstance.getId()).list();
for (HistoricDetail historicDetail : list) {
if (historicDetail instanceof HistoricFormProperty) {
// 表单中的字段
HistoricFormProperty field = (HistoricFormProperty) historicDetail;
historyVariables.put(field.getPropertyId(), field.getPropertyValue());
System.out.println("form field: taskId=" + field.getTaskId() + ", " + field.getPropertyId() + " = " + field.getPropertyValue());
} else if (historicDetail instanceof HistoricVariableUpdate) {
HistoricVariableUpdate variable = (HistoricVariableUpdate) historicDetail;
historyVariables.put(variable.getVariableName(), variable.getValue());
System.out.println("variable: " + variable.getVariableName() + " = " + variable.getValue());
}
}
return historyVariables;
}