[rules-users] RuntimeDroolsException as Solver concludes execution

dweppenaar dweppenaar at gmail.com
Thu Apr 22 04:34:12 EDT 2010


Hi.

I am experiencing the following exception:
org.drools.RuntimeDroolsException: Exception executing ReturnValue
constraint org.drools.rule.ReturnValueRestriction at a5f6c234 :
java.lang.NullPointerException.

The rule that is causing the exception to occur is the following:

rule "spreadOvertime"

    when
        $violatingTask :
MaintenanceTask(eval(maintenanceSlot.getAvailability() == 1), motor != null,
maintenanceTechnician != null, $overtimeTaskID : id);

        ArrayList( $numberOfViolations : size ) from collect(
MaintenanceTask(
                    id == ($overtimeTaskID + 1) ||
                    id == ($overtimeTaskID + 2) ||
                    id == ($overtimeTaskID - 1) ||
                    id == ($overtimeTaskID - 2),
                    eval(maintenanceSlot.getAvailability() >= 1) ) );

    then
        insertLogical(new IntConstraintOccurrence("spreadOvertime",
ConstraintType.NEGATIVE_SOFT,
            $numberOfViolations, $violatingTask, $numberOfViolations));
        //System.out.println("Rule Fired: spreadOvertime ( number of
violations:" + $numberOfViolations + " for task " + $violatingTask + ")");

end

The purpose of the rule is to spread the closer to normal maintenance
shifts.

Just to clarrify what the objects are:

MaintenanceTask: Consists of a MaintenanceSlot, MaintenanceTechnician and
Motor
MaintenanceSlot: Day, Timeslot, Availability and Index

The 'availability' of a MaintenanceSlot specifies whether it is considered
Overtime, ProductionTime or Normal Maintenance

This exception is thrown at the end of solving as the solver (I presume) is
supposed to return the best solution. The score is calculating and updating
but at the end of the specified step count, this exception occurs.

If I comment this rule out, no exception.

Any help would be appreciated!

Regards,
De Ville
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/RuntimeDroolsException-as-Solver-concludes-execution-tp742371p742371.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list