}
public void onEvent(BpelEvent be) {
if (be instanceof ActivityEvent) {
final ActivityEvent event = (ActivityEvent) be;
ActivityInfoDocument actinf = lookup(event);
assert actinf != null;
if (event instanceof ActivityEnabledEvent) {
actinf.getActivityInfo().setStatus(TActivityStatus.ENABLED);
Calendar dtEnabled = Calendar.getInstance();
dtEnabled.setTime(event.getTimestamp());
actinf.getActivityInfo().setDtEnabled(dtEnabled);
_activities.put(event.getActivityId(), actinf);
}
if (event instanceof ActivityDisabledEvent) {
actinf.getActivityInfo().setStatus(TActivityStatus.DEAD);
Calendar dtDied = Calendar.getInstance();
dtDied.setTime(event.getTimestamp());
actinf.getActivityInfo().setDtDied(dtDied);
}
if (event instanceof ActivityExecStartEvent) {
actinf.getActivityInfo().setStatus(TActivityStatus.STARTED);
Calendar dtStarted = Calendar.getInstance();
dtStarted.setTime(event.getTimestamp());
actinf.getActivityInfo().setDtStarted(dtStarted);
} else if (event instanceof ActivityExecEndEvent) {
actinf.getActivityInfo().setStatus(TActivityStatus.COMPLETED);
Calendar dtComp = Calendar.getInstance();
dtComp.setTime(event.getTimestamp());
actinf.getActivityInfo().setDtCompleted(dtComp);
completed(actinf);
}
}
}