Class BiLeftHandSide<A,​B>

  • Type Parameters:
    A - generic type of the first resulting variable
    B - generic type of the second resulting variable
    All Implemented Interfaces:
    Supplier<List<org.drools.model.view.ViewItem<?>>>

    public final class BiLeftHandSide<A,​B>
    extends Object
    Represents the left hand side of a Drools rule, the result of which are two variables. The simplest variant of such rule, with no filters or groupBys applied, would look like this in equivalent DRL:
     
      rule "Simplest bivariate rule"
      when
          $a: Something()
          $b: SomethingElse()
      then
          // Do something with the $a and $b variables.
      end
     
     
    Usually though, there would be a joiner between the two, limiting the cartesian product:
     
      rule "Bivariate join rule"
      when
          $a: Something($leftJoin: someValue)
          $b: SomethingElse(someOtherValue == $leftJoin)
      then
          // Do something with the $a and $b variables.
      end
     
     
    For more, see UniLeftHandSide.
    • Constructor Detail

      • BiLeftHandSide

        protected BiLeftHandSide​(org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<A> left,
                                 org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<B> right,
                                 DroolsVariableFactory variableFactory)
      • BiLeftHandSide

        protected BiLeftHandSide​(BiLeftHandSide<A,​B> leftHandSide,
                                 org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<A> left,
                                 org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<B> right)
    • Method Detail

      • getPatternVariableA

        protected org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<A> getPatternVariableA()
      • getPatternVariableB

        protected org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<B> getPatternVariableB()
      • andTerminate

        public org.optaplanner.core.impl.score.stream.drools.common.AbstractBiConstraintConsequence<A,​B> andTerminate()
      • andTerminate

        public org.optaplanner.core.impl.score.stream.drools.common.AbstractBiConstraintConsequence<A,​B> andTerminate​(ToIntBiFunction<A,​B> matchWeighter)
      • andTerminate

        public org.optaplanner.core.impl.score.stream.drools.common.AbstractBiConstraintConsequence<A,​B> andTerminate​(ToLongBiFunction<A,​B> matchWeighter)
      • andTerminate

        public org.optaplanner.core.impl.score.stream.drools.common.AbstractBiConstraintConsequence<A,​B> andTerminate​(BiFunction<A,​B,​BigDecimal> matchWeighter)
      • get

        public List<org.drools.model.view.ViewItem<?>> get()
      • getVariables

        public org.drools.model.Variable[] getVariables()
      • getConstraintType

        protected static org.drools.model.Index.ConstraintType getConstraintType​(JoinerType type)
      • joinViewItemsWithLogicalAnd

        protected static org.drools.model.view.ViewItem<?> joinViewItemsWithLogicalAnd​(org.optaplanner.core.impl.score.stream.drools.common.PatternVariable<?>... patternVariables)