Class BuildUtils

java.lang.Object
org.drools.core.reteoo.builder.BuildUtils

public class BuildUtils extends Object
Utility functions for reteoo build
  • Constructor Details

    • BuildUtils

      public BuildUtils()
  • Method Details

    • addBuilder

      public void addBuilder(Class<?> target, ReteooComponentBuilder builder)
      Adds the given builder for the given target to the builders map
    • getBuilderFor

      public ReteooComponentBuilder getBuilderFor(RuleConditionElement target)
      Returns a builder for the given target from the builders map
    • getBuilderFor

      public ReteooComponentBuilder getBuilderFor(Class cls)
    • attachNode

      public <T extends BaseNode> T attachNode(BuildContext context, T candidate)
      Attaches a node into the network. If a node already exists that could substitute, it is used instead.
      Parameters:
      context - The current build context
      candidate - The node to attach.
      Returns:
      the actual attached node that may be the one given as parameter or eventually one that was already in the cache if sharing is enabled
    • createBetaNodeConstraint

      public BetaConstraints createBetaNodeConstraint(BuildContext context, List<BetaConstraint> list, boolean disableIndexing)
      Creates and returns a BetaConstraints object for the given list of constraints
      Parameters:
      context - the current build context
      list - the list of constraints
    • calculateTemporalDistance

      public TemporalDependencyMatrix calculateTemporalDistance(GroupElement groupElement)
      Calculates the temporal distance between all event patterns in the given subrule.
      Parameters:
      groupElement - the root element of a subrule being added to the rulebase