[rules-users] threw error java.lang.ClassCastException: org.drools.reteoo.FromNode$FromMemory cannot be cast to org.drools.reteoo.BetaMemory

mohdejaz74 mohdejaz74 at gmail.com
Thu Apr 25 12:52:33 EDT 2013


For the previous java.lang.ArrayIndexOutOfBoundsException, would the
following code change fix them correctly? would there be any other impact ?

org.drools.common.SingleBetaConstraints

    /* (non-Javadoc)
     * @see
org.drools.common.BetaNodeConstraints#updateFromTuple(org.drools.reteoo.ReteTuple)
     */
    public void updateFromTuple(final ContextEntry[] context,
                                final InternalWorkingMemory workingMemory,
                                final LeftTuple tuple) {
      // Check if context has any elements
      // If (... ) added
      if (context != null && context.length > 0)
      {
        context[0].updateFromTuple( workingMemory,
                                 tuple );
      }
    }


org.drools.reteoo.FromNode
- checkConstraintsAndPropagate

            for ( int i = 0, length = this.alphaConstraints.length; i <
length; i++ ) {
                // Check memory.alphaContexts size before accessing ith
element
                // If (... ) added
                if (memory.alphaContexts != null &&
memory.alphaContexts.length > i)
                {
                  if ( !this.alphaConstraints[i].isAllowed(
rightTuple.getFactHandle(),
                                                            workingMemory,
                                                           
memory.alphaContexts[i] ) ) {
                      // next iteration
                      isAllowed = false;
                      break;
                  }
                }
            }




--
View this message in context: http://drools.46999.n3.nabble.com/threw-error-java-lang-ClassCastException-org-drools-reteoo-FromNode-FromMemory-cannot-be-cast-to-orgy-tp4023497p4023538.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list