}
@Override
public void interceptComplete(Method method, Object target, Object event) {
for (ActionEvent actionEvent : getActionEvents(method)) {
CallContext ctx = CallContext.current();
long userId = ctx.getCallingUserId();
long accountId = ctx.getCallingAccountId();
long startEventId = ctx.getStartEventId();
String eventDescription = getEventDescription(actionEvent, ctx);
String eventType = getEventType(actionEvent, ctx);
boolean isEventDisplayEnabled = ctx.isEventDisplayEnabled();
if (eventType.equals(""))
return;
if (actionEvent.create()) {
//This start event has to be used for subsequent events of this action
startEventId = ActionEventUtils.onCreatedActionEvent(userId, accountId, EventVO.LEVEL_INFO, eventType,
isEventDisplayEnabled, "Successfully created entity for " + eventDescription);
ctx.setStartEventId(startEventId);
} else {
ActionEventUtils.onCompletedActionEvent(userId, accountId, EventVO.LEVEL_INFO, eventType,
isEventDisplayEnabled, "Successfully completed " + eventDescription, startEventId);
}
}