@Override
protected void postBusEventFromTransaction(final CustomFieldModelDao customField, final CustomFieldModelDao savedCustomField, final ChangeType changeType,
final EntitySqlDaoWrapperFactory<EntitySqlDao> entitySqlDaoWrapperFactory, final InternalCallContext context)
throws BillingExceptionBase {
BusInternalEvent customFieldEvent = null;
switch (changeType) {
case INSERT:
customFieldEvent = new DefaultCustomFieldCreationEvent(customField.getId(), customField.getObjectId(), customField.getObjectType(),
context.getAccountRecordId(), context.getTenantRecordId(), context.getUserToken());
break;
case DELETE:
customFieldEvent = new DefaultCustomFieldDeletionEvent(customField.getId(), customField.getObjectId(), customField.getObjectType(),
context.getAccountRecordId(), context.getTenantRecordId(), context.getUserToken());
break;
default:
return;
}
try {
bus.postFromTransaction(customFieldEvent, entitySqlDaoWrapperFactory.getSqlDao());
} catch (PersistentBus.EventBusException e) {
log.warn("Failed to post tag event for custom field " + customField.getId().toString(), e);
}
}