Creating a validator

Follow these instructions to create a validation plug-in that is much like the SimpleCampaignValidator, but prevents the creation of campaigns that are called "badCampaign2."

Procedure

  1. Make a copy of the sample validator SimpleCampaignValidator.java in <HCL_Unica_Home\Campaign_Home>\devkits\validation\src\com \unica\campaign\core\validation\samples. Name the copy MyCampaignValidator.java and leave it in the same directory as the source. For example:

    C:\HCL\Unica\Campaign\devkits\validation\src\com \unica\campaign\core\validation\samples\MyCampaignValidator.java

  2. Open MyCampaignValidator.java in an editor. Find the word "badCampaign" in the document and replace it with the word "badCampaign2."
  3. Save the file and close the editor.
  4. Build the validators again. For details, see Building the validator. If your application server locks the validate.jar file while in use, stop the server before you build the validators.
  5. Reconfigure campaign_config.xml to use your new class: <property name="validationClass" value="com.unica.campaign.core.validation.samples.MyCampaignValidator">
  6. Test the validator. For details, see Testing the validator configuration.

What to do next

Confirm that the validator works: You should not be able to save campaigns named "badCampaign2."