com.ibm.openpages.api.rule

## Interface ITBRuleDefinition

- All Superinterfaces:
    java.lang.Cloneable

      public interface ITBRuleDefinition
      extends java.lang.Cloneable

  Represents a Rule definition.

  Lifecycle of a rule definition - When a rule definition is created, it becomes immediately runnable as long as it has been marked as enabled.

  The rule

  Since:
    8.1

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAction(ITBRuleAction action)` Add an action to the rule
    `ITBRuleDefinition` | `clone()` Returns a cloned instance.
    `java.util.List<ITBRuleAction>` | `getActions()` Returns the list of actions for the rule.
    `TBRuleDefinitionCategory` | `getCategory()` Get the rule category
    `IWFConditionEval` | `getCondition()` Returns the rule criteria.
    `java.lang.String` | `getCreatedBy()` Returns the user name who created the rule definition
    `java.util.Date` | `getCreatedDate()` Returns the creation date
    `java.lang.String` | `getDescription()` Get the description of the rule
    `Id` | `getId()` Returns unique identifier of the rule definition
    `int` | `getLatestVersionNumber()` Returns version number of the latest rule definition.
    `TBRuleDefinitionState` | `getLatestVersionState()` Gets the state of the latest version of the rule - draft/published
    `java.lang.String` | `getModifiedBy()` Returns the user name who last modified the rule definition
    `java.util.Date` | `getModifiedDate()` Returns the last modified date
    `java.lang.String` | `getName()` Returns name of the rule definition
    `java.lang.String` | `getObjectType()` Returns the object type name.
    `TBRuleDefinitionState` | `getState()` Returns the current state of the rule - draft/published
    `TBRuleDefinitionType` | `getType()` Get the type of the rule that determines when it should be run
    `Id` | `getVersionId()` Returns version id of the rule definition.
    `int` | `getVersionNumber()` Returns version number of the rule definition.
    `boolean` | `isEnabled()` Returns if the rule definition is enabled or not.
    `boolean` | `isObjectInstanceReadOnly()` Returns if the rule definition is read only.
    `void` | `setActions(java.util.List<ITBRuleAction> actions)` Sets the actions to be executed by the rule
    `void` | `setCategory(TBRuleDefinitionCategory category)` Set the rule category
    `void` | `setCondition(IWFConditionEval criteria)` Sets the rule criteria.
    `void` | `setDescription(java.lang.String description)` Set the description of the rule
    `void` | `setEnabled(boolean isEnabled)` Enables or disables the rule definition.
    `void` | `setLatestVersionState(TBRuleDefinitionState latestVersionState)` Sets the state of the latest version of the rule to be draft ot published
    `void` | `setObjectInstanceReadOnly()`
    `void` | `setObjectType(java.lang.String objectType)`
    `void` | `setState(TBRuleDefinitionState state)` Sets the current state of the rule - draft/published
    `void` | `setType(TBRuleDefinitionType type)` Set the type of the rule to determine when it should be run

- - ### Method Detail

    - #### getId

          Id getId()

      Returns unique identifier of the rule definition
      Returns:

    - #### getVersionId

          Id getVersionId()

      Returns version id of the rule definition. There is currently only 1 version per rule.
      Returns:

    - #### getVersionNumber

          int getVersionNumber()

      Returns version number of the rule definition.
      Returns:

    - #### getLatestVersionNumber

          int getLatestVersionNumber()

      Returns version number of the latest rule definition.
      Returns:

    - #### getName

          java.lang.String getName()

      Returns name of the rule definition
      Returns:

    - #### getDescription

          java.lang.String getDescription()

      Get the description of the rule
      Returns:

    - #### setDescription

          void setDescription(java.lang.String description)

      Set the description of the rule
      Parameters:
        `description` -

    - #### getType

          TBRuleDefinitionType getType()

      Get the type of the rule that determines when it should be run
      Returns:

    - #### setType

          void setType(TBRuleDefinitionType type)

      Set the type of the rule to determine when it should be run
      Parameters:
        `type` -

    - #### getCategory

          TBRuleDefinitionCategory getCategory()

      Get the rule category
      Returns:

    - #### setCategory

          void setCategory(TBRuleDefinitionCategory category)

      Set the rule category
      Parameters:
        `category` -

    - #### getObjectType

          java.lang.String getObjectType()

      Returns the object type name.
      Returns:

    - #### setObjectType

          void setObjectType(java.lang.String objectType)

    - #### getActions

          java.util.List<ITBRuleAction> getActions()

      Returns the list of actions for the rule.
      Returns:

    - #### setActions

          void setActions(java.util.List<ITBRuleAction> actions)

      Sets the actions to be executed by the rule
      Parameters:
        `actions` -

    - #### getCondition

          IWFConditionEval getCondition()

      Returns the rule criteria. The criteria is evaluated to determine whether to run the rule when requested.
      Returns:

    - #### setCondition

          void setCondition(IWFConditionEval criteria)

      Sets the rule criteria.
      Parameters:
        `criteria` -

    - #### isEnabled

          boolean isEnabled()

      Returns if the rule definition is enabled or not. The rule can be run only when it is enabled.
      Returns:

    - #### setEnabled

          void setEnabled(boolean isEnabled)

      Enables or disables the rule definition.
      Parameters:
        `isEnabled` -

    - #### getModifiedDate

          java.util.Date getModifiedDate()

      Returns the last modified date
      Returns:

    - #### getModifiedBy

          java.lang.String getModifiedBy()

      Returns the user name who last modified the rule definition
      Returns:

    - #### getCreatedDate

          java.util.Date getCreatedDate()

      Returns the creation date
      Returns:

    - #### getCreatedBy

          java.lang.String getCreatedBy()

      Returns the user name who created the rule definition
      Returns:

    - #### setObjectInstanceReadOnly

          void setObjectInstanceReadOnly()

    - #### getState

          TBRuleDefinitionState getState()

      Returns the current state of the rule - draft/published
      Returns:

    - #### setState

          void setState(TBRuleDefinitionState state)

      Sets the current state of the rule - draft/published
      Parameters:
        `state` -

    - #### getLatestVersionState

          TBRuleDefinitionState getLatestVersionState()

      Gets the state of the latest version of the rule - draft/published
      Returns:

    - #### setLatestVersionState

          void setLatestVersionState(TBRuleDefinitionState latestVersionState)

      Sets the state of the latest version of the rule to be draft ot published
      Parameters:
        `latestVersionState` -

    - #### addAction

          void addAction(ITBRuleAction action)

      Add an action to the rule
      Parameters:
        `action` -

    - #### isObjectInstanceReadOnly

          boolean isObjectInstanceReadOnly()

      Returns if the rule definition is read only. Use the cloned instance for updating.
      Returns:

    - #### clone

          ITBRuleDefinition clone()

      Returns a cloned instance. The `isObjectInstanceReadOnly()` of the cloned instance is always false.
      Returns:

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.