public class ActivityStart extends HistoryEvent {
private static final long serialVersionUID = 1L;
public void process() {
DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
long processInstanceDbid = execution.getProcessInstance().getDbid();
HistoryProcessInstance historyProcessInstanceImpl = (HistoryProcessInstance)
dbSession.get(HistoryProcessInstanceImpl.class, processInstanceDbid);
HistoryActivityInstanceImpl historyActivityInstance =
createHistoryActivityInstance(historyProcessInstanceImpl);
String activityType = execution.getActivity().getType();
historyActivityInstance.setType(activityType);
dbSession.save(historyActivityInstance);
execution.setHistoryActivityInstanceDbid(historyActivityInstance.getDbid());
}