Implement the ServiceProcessRequestPreProcessor interface to create a preprocessor class that transforms and validates data for custom attributes in the Service Catalog Connect REST API. Using a preprocessor is optional.
Represents service request attributes in the input payload in key-value pair format.
Return Value
Type: ServiceProcessPreProcessorResponse object
ServiceProcessRequestPreProcessor Example Implementation
This is an example implementation of the industriesserviceprocess.ServiceProcessRequestPreProcessor interface.
1public class StopCheckPayment implements industriesserviceprocess.ServiceProcessRequestPreProcessor{2 public industriesserviceprocess.ServiceProcessPreProcessorResponse processServiceProcessRequest3(String serviceProcessDefId, Map<String, Object>caseInfo, Map<String, Object>serviceProcessAttrs){4 industriesserviceprocess.ServiceProcessPreProcessorResponse response = null; 5 Date paymentDate = (Date)serviceProcessAttrs.get('paymentDate');6 if(paymentDate<Date.today()){7 response = 8 new industriesserviceprocess.ServiceProcessPreProcessorResponse('Payment Date cannot be before the current date',9 false, industriesserviceprocess.ServiceProcessPreProcessorErrorTypes.VALIDATION_ERROR);10}else{11 response = 12 new industriesserviceprocess.ServiceProcessPreProcessorResponse(true);13}14 return response;15}16}