public TaskActivityStart(TaskImpl task) {
this.task = task;
}
public void process() {
DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
ExecutionImpl processInstance = execution.getProcessInstance();
long processInstanceDbid = processInstance.getDbid();
HistoryProcessInstance historyProcessInstance =
dbSession.get(HistoryProcessInstanceImpl.class, processInstanceDbid);
HistoryTaskImpl historyTask = new HistoryTaskImpl(task);
historyTask.setExecutionId(execution.getId());
HistoryActivityInstanceImpl historyActivityInstance =
new HistoryTaskInstanceImpl(historyProcessInstance, execution, historyTask);
String activityType = execution.getActivity().getType();
historyActivityInstance.setType(activityType);
dbSession.save(historyActivityInstance);
execution.setHistoryActivityInstanceDbid(historyActivityInstance.getDbid());
}