org.kie.api.runtime.rule

## Interface RuleUnit

-     public interface RuleUnit

  Rule units represent a purely declarative approach to partition a rules set into smaller units, binding different data sources to those units and orchestrate the execution of the individual unit. A rule unit is an aggregate of data sources, global variables and rules.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `RuleUnit.Identity`

  - ### Method Summary

    All Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default RuleUnit.Identity` | `getUnitIdentity()` Defines the identity of this RuleUnit.
    `default void` | `onEnd()` Called when the evaluation of this unit terminates
    `default void` | `onResume()` Called when the execution of unit is resumed (only for runUntilHalt)
    `default void` | `onStart()` Called when the rule engine starts evaluating the unit
    `default void` | `onSuspend()` Called when the execution of unit is suspended (only for runUntilHalt)
    `default void` | `onYield(RuleUnit other)` Called when the consequence of rule in this rule unit triggers the execution of a different unit

- - ### Method Detail

    - #### getUnitIdentity

          default RuleUnit.Identity getUnitIdentity()

      Defines the identity of this RuleUnit. By default it corresponds to the unit's class.
      Returns:
        The identity of this RuleUnit

    - #### onStart

          default void onStart()

      Called when the rule engine starts evaluating the unit

    - #### onEnd

          default void onEnd()

      Called when the evaluation of this unit terminates

    - #### onSuspend

          default void onSuspend()

      Called when the execution of unit is suspended (only for runUntilHalt)

    - #### onResume

          default void onResume()

      Called when the execution of unit is resumed (only for runUntilHalt)

    - #### onYield

          default void onYield(RuleUnit other)

      Called when the consequence of rule in this rule unit triggers the execution of a different unit
      Parameters:
        `other` - The called unit

Copyright © 2001–2018 JBoss by Red Hat. All rights reserved.