com.ibm.openpages.api.trigger

## Class AbstractRule

- java.lang.Object
- - com.ibm.openpages.api.trigger.AbstractRule

- Direct Known Subclasses:
    DefaultRule

      public abstract class AbstractRule
      extends java.lang.Object

  Base class for Rules. Most rules should extend `DefaultRule`. Rules will check events which are generated from operations performed by users in the OpenPages system. If the event applies to the rule, then the event handlers configured for the trigger will handle the event.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractRule()` Default Constructor
    `AbstractRule(java.util.Map<java.lang.String,java.lang.String> ruleAttributes)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.HashMap<java.lang.String,java.lang.String>` | `getAttributes()` Returns HashMap containing rule attributes and their values.
    `abstract boolean` | `isApplicable(AbstractEvent event)` Determines whether or not the current operation satisfies the rule.
    `void` | `setAttributes(java.util.HashMap<java.lang.String,java.lang.String> attributes)` Sets the attributes for rules.

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

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

- - ### Constructor Detail

    - #### AbstractRule

          public AbstractRule()

      Default Constructor

    - #### AbstractRule

          public AbstractRule(java.util.Map<java.lang.String,java.lang.String> ruleAttributes)

  - ### Method Detail

    - #### getAttributes

          public java.util.HashMap<java.lang.String,java.lang.String> getAttributes()

      Returns HashMap containing rule attributes and their values.
      Returns:
        rule attributes

    - #### setAttributes

          public void setAttributes(java.util.HashMap<java.lang.String,java.lang.String> attributes)

      Sets the attributes for rules. These attributes are simple name value pairs.

    - #### isApplicable

          public abstract boolean isApplicable(AbstractEvent event)

      Determines whether or not the current operation satisfies the rule. If the event is applicable to the rule, the event will be passed to each of the trigger's event handlers' handleEvent. Definition of what is applicable is specific to the event handler implementations.
      Parameters:
        `event` - the current operation to check
      Returns:
        true if the event satisfies the criteria for rule implementation.

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