[rules-users] Inconsistent behavior between LHS and RHS ...
Wolfgang Laun
wolfgang.laun at gmail.com
Mon Nov 9 07:56:19 EST 2009
It's difficult to assess this case without the code from Task.java,
especially mehtods getParameter(), getTechnicalParams(); the code used
to create the Task fact, and the actual output.
-W
2009/11/9 Javier Vera Gomez <Javier.Vera at andorratelecom.ad>:
> Hi,
>
> I've been using drools 4.07 for a while. I have found a weird case. It seems
> that when evaluating the LHS some fact is true but the RHS probes it wasn't
> actually true.
>
> The example code is at the end. It is very weird to me I have no clue about
> how to solve this or what could be happening!
>
> rule "A-Rule"
> no-loop true
> ruleflow-group "validate-task"
> salience -9999999
> when
> >$task : Task( type == "Creacio_Profile_Radius" )
> >eval($task.getParameter("PRIMARYDNS")==null)
> then
> >System.out.println(">>>DBGPar0:
> "+$task.getTechnicalParams().get(0).getName());
> >System.out.println(">>>DBGPar1:
> "+$task.getTechnicalParams().get(1).getName());
> >System.out.println("Getparam PRIMARYDNS:
> "+$task.getParameter("PRIMARYDNS"));
> end
>
>
> further explanation:
>
> The Task class has a List<Parameter> technicalParams, originally the eval
> part was:
> not(Parameter (name=="PRIMARYDNS") from $task.technicalParams())
>
> it didn't work and I coded this "getParameter" method just to make some
> tests. So, it seems the collection appears "empty" to the LHS but in fact it
> isnt!
>
> any clue?
>
> thanks a lot,
>
> Javier
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
More information about the rules-users
mailing list