[rules-users] Drools 5.5.0.Final : Rule Trigger Issue

Wolfgang Laun wolfgang.laun at gmail.com
Thu Dec 12 03:59:56 EST 2013


Rule 1:
This could result from not updating the WorkflowProcessInstance after
creating the Variable "piRequest". Hard to tell without seeing all of
the code...

Rule 2:
Simply incorrect syntax. Either use
   $r: Request( ADV == "N" )
or
   $r: Request()
   eval( $r.getADV().equals( "N" ) )

Make sure to use Java code inside eval.

-W

On 12/12/2013, Zahid Ahmed <zahid.ahmed at emirates.com> wrote:
> Hi,
>
>
>
> I am new to Rules and having following issues in different rules.
>
>
>
>
>
> Rule 1 :
>
>      Issue
>
>           I have a process definition in which I create and insert into
> Session a REQUEST.java object before the rule-flow node. Insert is done
> using script node. In rule condition section I am filtering  the same
> request object but my rule is not firing. My rule FIRES if I REMOVE this ==
> $process.getVariable("piRequest").
>
>
>
>
>
>           rule "Go to President"
>
>           ruleflow-group "DesigSkip"
>
>           dialect "java"
>
>                when
>
>                     $process: WorkflowProcessInstance()
>
>                     $r: Request(this == $process.getVariable("piRequest"),
> VD == "N", UB == "N", CC not in ( "A", "B") , DP not in (  "X", "Y", "Z")
> );
>
>                then
>
>                     $process.setVariable("piToPres","y");
>
>           end
>
>
>
> Rule 2 :
>
>     I am getting error for eval statement.
>
>
>
> globa Request $r;
>
>
>
> rule "Go to President"
>
> ruleflow-group "DesigSkip"
>
> dialect "java"
>
>     when
>
>     $process: WorkflowProcessInstance($request:getVariable("piRequest"))
>
>     $r : $request
>
>     $r(eval(ADV == "N"))
>
>
>
>     then
>
>
> System.out.println("--------------------*******************--------IN GUIDED
>     RULE--------**********************---------------");
>
>
>
>             $process.setVariable("piToPres","y");
>
>
>
> end
>
>
>
> globa Request $r;
>
>
>
> rule "Go to President"
>
> ruleflow-group "DesigSkip"
>
> dialect "java"
>
>     when
>
>     $process: WorkflowProcessInstance($request:getVariable("piRequest"))
>
>     $r : $request
>
>
>
>     eval($r.getADV() == "N")
>
>
>
>     then
>
>
> System.out.println("--------------------*******************--------IN GUIDED
>     RULE--------**********************---------------");
>
>
>
>             $process.setVariable("piToPres","y");
>
>
>
> end
>
>
>  Zahid Ahmed
>  Senior Software Engineer | Emirates Group IT
>  P.O. Box 686 | Dubai, United Arab Emirates
>  T +971 4 203 3912 | M +971 55 1249171
>
> [http://cdn.ek.aero/email/e_signatures/ekg2013.jpg]
>
>
>
>
>


More information about the rules-users mailing list