Description: Allows you to intercept an appointment transaction before or after creation of appointment using the Pre or Post Interceptor.
Abstract Base Class: com.navis.external.road.AbstractGateAppointmentInterceptor
Interface:EGateAppointmentInterceptor
Module: Gate
Version Added: 3.7
Requires Code Extension Name or Name Pattern:Yes
Code Extension Name or Name Pattern: CustomGateAppointmentInterceptor
Where to Specify Code Extensions of this Type: Not necessary. Code extension is called by name.
System-Seeded Code Extensions Using this Type: CustomGateAppointmentInterceptorSample
Example: GATE_APPOINTMENT_INTERCEPTOR
Code Example
The following code example implements a code extension of type GATE_APPOINTMENT_INTERCEPTOR that updates the GAPPT_UFV_FLEX_STRING01 field based on the values defined for the preAppointmentInterceptor and postAppointmentInterceptor. N4 displays the field values in the Appointments view after you save an appointment.
import com.navis.external.road.AbstractGateAppointmentInterceptor
import com.navis.road.RoadApptsField
import com.navis.road.business.appointment.model.GateAppointment
import org.apache.log4j.Logger
/**
* Custom default system seeded groovy
*/
class CustomGateAppointmentInterceptor extends AbstractGateAppointmentInterceptor {
@Override
void preAppointmentInterceptor(GateAppointment inAppointment) {
inAppointment.setFieldValue(RoadApptsField.GAPPT_UFV_FLEX_STRING01, "Pre Interceptor");
LOGGER.warn(String.format("PRE APPOINTMENT %s.execute", getClass().getName()))
}
@Override
void postAppointmentInterceptor(GateAppointment inAppointment) {
inAppointment.setFieldValue(RoadApptsField.GAPPT_UFV_FLEX_STRING02, "Post Interceptor");
LOGGER.warn(String.format("POST APPOINTMENT %s.execute", getClass().getName()))
}
private static final Logger LOGGER = Logger.getLogger(CustomGateAppointmentInterceptor.class);
}