* historicTaskInstanceEntity.setEndTime(null); historicTaskInstanceEntity.setDurationInMillis(null);
* historicActivityInstanceEntity.setEndTime(null); historicActivityInstanceEntity.setDurationInMillis(null);
*/
// 创建新任务
TaskEntity task = TaskEntity.create(new Date());
task.setProcessDefinitionId(historicTaskInstanceEntity
.getProcessDefinitionId());
// task.setId(historicTaskInstanceEntity.getId());
task.setAssigneeWithoutCascade(historicTaskInstanceEntity.getAssignee());
task.setParentTaskIdWithoutCascade(historicTaskInstanceEntity
.getParentTaskId());
task.setNameWithoutCascade(historicTaskInstanceEntity.getName());
task.setTaskDefinitionKey(historicTaskInstanceEntity
.getTaskDefinitionKey());
task.setExecutionId(historicTaskInstanceEntity.getExecutionId());
task.setPriority(historicTaskInstanceEntity.getPriority());
task.setProcessInstanceId(historicTaskInstanceEntity
.getProcessInstanceId());
task.setExecutionId(historicTaskInstanceEntity.getExecutionId());
task.setDescriptionWithoutCascade(historicTaskInstanceEntity
.getDescription());
Context.getCommandContext().getTaskEntityManager().insert(task);
// 把流程指向任务对应的节点