E Sample Validation Class

You can validate provisioning data according to your requirements. This feature has been described in "Validating Data Sent to the Target System for Provisioning".

If you want to validate the value of a process form field that is passed to the target system during provisioning, then one of the steps involves implementing the required validation logic in a Java class. This validation class must implement the com.thortech.xl.schedule.tasks.FieldsValidation interface and the validate method.

The following is a sample validation class:

package com.thortech.xl.integration.ActiveDirectory.utils;
import java.util.HashMap;
import com.thortech.xl.integration.ActiveDirectory.utils.ConnectorLogger;
/**
 *  This class is used to validate the process form fields during user provisioning.
 * 
 * 
 */
public class FirstNameValidation implements FieldsValidation {
        private ConnectorLogger logger = new ConnectorLogger("OIMCP.ADCS");
        private String sClassName = this.getClass().getName();
        /**
         * Description :This method 
         * @param hmUserAttributes
         *  This is the input hashmap containing the form column names and their values.
         * @param sAttributeKey
         * This is the column name which needs to be validated.
         * @return Boolean 
         * returns true or false based on validation logic
         */
        public boolean validate(HashMap hmUserAttributes, String sAttributeKey) {
                String sMethodName = "validate";
                logger.setMethodStartLog(sClassName, sMethodName);
                String sFormfieldVal=(String)hmUserAttributes.get(sAttributeKey);
                /* TO DO
                 * Write your own logic to perform validation on field names which you got from
                 * the caller method
                 */
        logger.setMethodStartLog(sClassName, sMethodName);
        return true;
                }
        }

The method defined in this class accepts the value of the field to be validated, checks if it meets the validation criteria, and sends it to the target system if the validation criteria is met. If the criteria is not met, then an exception is thrown.