Forum Discussion
FICO
17 years agoCommunity Manager
valueholder validations in RMA
valueholder validations in RMA We have ruleset template which has a rule template. The rule template contains a string value holder called "Rule Name" which is exposed in the RMA. The requirements a...
FICO
17 years agoCommunity Manager
Hey Jostein (http://dmtforum.fairisaac.com/t5/user/viewprofilepage/user-id/89),
I appreciate for your reply and I have a great confidence on this Forum now. As you requested here is my provider code. Let me know if you need any more information. Thanks buddy stay in touch. public class DataValidatorStringProvider extends NdDefaultTemplateValueProviderimplements NdDesignProvider { private String dataType; //private String dataType = "HCPC"; static NdProviderContext context; public DataValidatorStringProvider() { super(); } public NdDesignProviderArg[] getArgumentDescriptors(NdProviderContext arg0) throws NdTemplateException { NdDesignProviderSelectableArg dataType = new NdDesignProviderSelectableArg( "dataType"); dataType.setDisplayName("Type of Data"); dataType.setMandatory(false); dataType.setChoices(new String[] { "HCPC", "ICD9","Payer"}); return new NdDesignProviderArg[] { dataType }; } public void setArgs(NdProviderContext context, NdProviderStaticArg[] args) throws NdTemplateException { super.setArgs(context, args); //_trace("Set Args length:"+args.length); //_trace("Set Args:"+args[0].getValue()); if (args != null & args.length > 0) { for (int index = 0; index < args.length; index++) { if (args[index].getName().equals("dataType") && args[index].getValue() != null) { _trace("Set args DataType:"+args[index].getValue()); this.dataType = args[index].getValue(); // System.out.println("question type " + _questionType); } } } } public void checkInstantiationValue(NdProviderContext context, String instantiationValue) { _trace("Context:"+context); _trace("instantiationValue:"+instantiationValue); } public String getDescription(NdProviderContext arg0) throws NdTemplateException { return "Data Validation"; } public String getDisplayKey(NdProviderContext arg0) throws NdTemplateException { return "String Provider"; } public String getDisplayName(NdProviderContext arg0) throws NdTemplateException { return "Data Validation"; } public boolean validateInstantiationValue(NdProviderContext context, String value) throws NdTemplateException { _trace("In validateInstantiationValue "); //boolean retValue = true; String nonValidData = ""; if( value == null && value.trim().equals("")) { _trace("Data is empty"); throw new NdTemplateException("Input Data is empty"); //throw an exception }else { //Call a java proxy service which internally calls the web service and pass the Data and DataType _trace("Data is not empty"); _trace("dataType:"+dataType); DataValidatorProxyService dvps = new DataValidatorProxyService(); nonValidData = dvps.validateData(value, dataType); _trace("nonValidData:"+nonValidData); if(nonValidData !=null && !nonValidData.trim().equals("")){ throw new NdTemplateException("This data doesnt exist:"+ nonValidData); } } return true; } private void _trace(String s) { System.out.println(s); } public static void main(String args[]){ DataValidatorStringProvider dvsp = new DataValidatorStringProvider(); try { dvsp.validateInstantiationValue(context, "E1234,E5678"); }catch (Exception e) { e.printStackTrace(); } } }Related Content
Related Content
How to make cuts added in a preIntsol callback globally valid (root node) instead of local to the current subtree?
I'm using the Xpress Optimizer Java API (com.dashoptimization, Xpress 9.4) to solve a MIP with lazy constraints that are generated dynamically. My constraints are all globally valid — they are not lo...2 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum2 unread comments2 unread31Views0likes2Comments