use of org.flowable.engine.history.HistoricActivityInstance in project syncope by apache.
the class FlowableUserWorkflowAdapter method getFormTO.
protected WorkflowFormTO getFormTO(final HistoricTaskInstance task) {
final List<HistoricFormPropertyEntity> props = new ArrayList<>();
engine.getHistoryService().createHistoricDetailQuery().taskId(task.getId()).list().stream().filter(historicDetail -> (historicDetail instanceof HistoricFormPropertyEntity)).forEachOrdered(historicDetail -> {
props.add((HistoricFormPropertyEntity) historicDetail);
});
WorkflowFormTO formTO = getHistoricFormTO(task.getProcessInstanceId(), task.getId(), task.getFormKey(), props);
BeanUtils.copyProperties(task, formTO);
HistoricActivityInstance historicActivityInstance = engine.getHistoryService().createHistoricActivityInstanceQuery().executionId(task.getExecutionId()).activityType("userTask").activityName(task.getName()).singleResult();
if (historicActivityInstance != null) {
formTO.setCreateTime(historicActivityInstance.getStartTime());
formTO.setDueDate(historicActivityInstance.getEndTime());
}
return formTO;
}
Aggregations