I am puzzled with the following behavior regarding null pointer validation.

 

I have the flowing rule:

rule "Test"

      when

            $ee: ExecutableEvent($taskId: taskid, Type.SOAR == type)

            $tt: TaskTicket($id: id == $taskId)

      then

     

            logger.info("Rule:test !!!"+$tt.toString());

            if($tt.getScheduledTime() != null)

                  logger.info("Rule:test schedule is not null");

           

end

 

what I get when I execute the system are the two printouts indicated in the rule, hence the scheduleTime is not null.

 

Now I wish to move the null verification to the LHS by modifying the rule to (modification is marked in yellow):

 

rule "Test"

      when

            $ee: ExecutableEvent($taskId: taskid, Type.SOAR == type)

            $tt: TaskTicket($id: id == $taskId, scheduledTime != null)

      then

     

            logger.info("Rule:test !!!"+$tt.toString());

            if($tt.getScheduledTime() != null)

                  logger.info("Rule:test schedule is not null");

           

end

 

at this point running the system results in no printouts, hence the rule is not true.

Any suggestion why this occurs and how to resolve this?

The origin of all of this is to add null pointer verification on fields that I wish to use us in the LHS (not shown in the above example)

 

Thanks

Hezi