Looks like an NPE in your rule.
Maybe maintenanceSlot or something is null.
You should raise an issue with drools-core (drools expert) that it
should give a better runtime error to show on which line it NPE'ed.
With kind regards,
Geoffrey De Smet
dweppenaar schreef:
> Hi.
>
> I am experiencing the following exception:
> org.drools.RuntimeDroolsException: Exception executing ReturnValue
> constraint org.drools.rule.returnvaluerestrict...@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
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users