com.ibm.openpages.api.trigger.oob

## Class DateValidationHandler

- java.lang.Object
- - com.ibm.openpages.api.trigger.AbstractEventHandler
  - - com.ibm.openpages.api.trigger.ext.DefaultEventHandler
    - - com.ibm.openpages.api.trigger.oob.DateValidationHandler

-     public class DateValidationHandler
      extends DefaultEventHandler

  This GRC trigger event handler validates two date fields on an object, throws a validation error message if end date is not after start date.
  Usage: This event handler can be used for following events:
  create.object
  create.object.with.relations
  update.object
  This event handler must be executed only in the PRE position.
  Attributes:

  Attribute | Values | Description | Required | Default
  --- | --- | --- | --- | ---
  start.date.field |  | The field name of a date field for start date. | Yes |
  end.date.field |  | The field name of a date field for end date. | Yes |

  The format of a field name should be [FieldGroup]:[FieldName], for example: 'OPSS-Iss:Due Date'.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DateValidationHandler()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `handleEvent(CreateResourceEvent event)` Handles create resource event.
    `boolean` | `handleEvent(CreateResourceWithRelationsEvent event)` Handles create resource with relations event.
    `boolean` | `handleEvent(UpdateResourceEvent event)` Handles update resource event.

    - ### Methods inherited from class com.ibm.openpages.api.trigger.ext.DefaultEventHandler

      `handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent`

    - ### Methods inherited from class com.ibm.openpages.api.trigger.AbstractEventHandler

      `getAttributes, getRuleAttributes, setAttributes, setRuleAttributes, throwException`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DateValidationHandler

          public DateValidationHandler()

  - ### Method Detail

    - #### handleEvent

          public boolean handleEvent(CreateResourceEvent event)

      Handles create resource event.
      Overrides:
        `handleEvent` in class `DefaultEventHandler`
      Parameters:
        `event` - a create resource event to be handled
      Returns:
        true.

    - #### handleEvent

          public boolean handleEvent(CreateResourceWithRelationsEvent event)

      Handles create resource with relations event.
      Overrides:
        `handleEvent` in class `DefaultEventHandler`
      Parameters:
        `event` - a create resource with relations event to be handled
      Returns:
        true.

    - #### handleEvent

          public boolean handleEvent(UpdateResourceEvent event)

      Handles update resource event.
      Overrides:
        `handleEvent` in class `DefaultEventHandler`
      Parameters:
        `event` - an update resource event to be handled
      Returns:
        true.

Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2021. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.