Triggering actions when incorrect answers are changed

Insurers sometime want to know when a user changes an answer from incorrect to correct, especially when the change enables the policy to pass validation or unblocks its progress.

You can configure the IncorrectAnswerChangedAction class to trigger an action when a user changes an incorrect answer. You also can examine, but not change, the code that identifies answers with values that have been changed by opening the read-only IncorrectAnswerProcessor class.

The base configuration of PolicyCenter creates a custom history event for transactions in which answers are changed that had previously blocked the user. The custom history event is used on the Pre-Qualification screen of the Submission wizard and on the Qualification screen of the RewriteNewAccount wizard.

Trigger action when incorrect answers are changed

About this task

To enable wizard steps to trigger an action when incorrect answers are changed:

Procedure

  1. Define a variable in the wizard PCF file to store a map of incorrect answers. For example:
      <Variable
        initialValue="new java.util.HashMap<gw.api.productmodel.Question, String>()"
        name="incorrectAnswerMap"
        type="java.util.Map<gw.api.productmodel.Question, String>"/>
  2. Call the incorrect answer processor in the beforeSave attribute of the wizard screen. Be sure to call this function before the changed answer’s bundle is committed to the database. The function compares the answers with their original values. If the answer is now correct, the function calls the IncorrectAnswerChangedAction class to perform the action you specified.
    For example, to check for changes in answers associated with the questions stored in incorrectAnswerMap.
      <JobWizardStep
        beforeSave="gw.question.IncorrectAnswerProcessor.processIncorrectAnswers(policyPeriod,
                incorrectAnswerMap);
                gw.policy.PolicyPeriodValidation.validatePreQualAnswers(policyPeriod)"
        ... >
      </JobWizardStep>