For Using OTP generation (setting otp length, otp expiry time ) you need to follow below steps.
1. Create a custom interface in the app.
2. Give implementation class name in the interface under "user impl class". (Ex : com.iexceed.otpservice.GenrateOtpImpl)
3. Save the interface, now go to your custom class and extends "com.iexceed.appzillon.iface.ExternalServicesRouter".
Ex :
public class GenrateOtpImpl extends ExternalServicesRouter{
public void serviceRequestDispatcher(Message pMessage,
SpringCamelContext pContext) throws ExternalServicesRouterException,
InvalidPayloadException, ClassNotFoundException, URIException, JSONException {
//write your logic here
Request lRequest = pMessage.getRequestObject();
JSONObject lgenOTPJSON = new JSONObject();
lgenOTPJSON.put("payload", lRequest.getRequestJson());
lgenOTPJSON.put("otpExpirySecs", "300"); // you can set OTP expiry time in seconds according your requirement
lgenOTPJSON.put("otpLength", "6"); // you can set otp length according your requirement
//set request format
pMessage.getRequestObject().setRequestJson(new JSONObject().put("generateOTPRequest", lgenOTPJSON));
com.iexceed.appzillon.services.otp.OTPEngineService otpEngine = new com.iexceed.appzillon.services.otp.OTPEngineService();
otpEngine.generateOtp(pMessage); // for generating OTP
response = pMessage.getResponseObject().getResponseJson(); // OTP response received
LOG.debug("OTP Response is " + pMessage.getResponseObject().getResponseJson());
String otp = pMessage.getResponseObject().getResponseJson().getJSONObject("generateOTPResponse").get("otp") + ""; // OTP received
}
}