Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-327

PHREAK goes into infinite loop, even with 'no-loop' defined.

XMLWordPrintable

    • Hide
      Show
      clone this Github repo: https://github.com/DuncanDoyle/DroolsPhreakConditionalNamedConsequenceInfiniteLoopIssue run "mvn -Preteoo exec:java" and observe the correct output. run "mvn -Pphreak exec:java" and observe the incorrect output and infinite-loop issue.

      See this project on my Github: https://github.com/DuncanDoyle/DroolsPhreakConditionalNamedConsequenceInfiniteLoopIssue

      The 'src/main/resources/rules/Sample.drl' contains an adapted version of the default Drools Eclipse plugin sample rule. As you can see, the rule uses Conditional Named Consequence construct. Although the rule is a bit strange (the issue actuallty popped up while debugging another issue) it does show different behaviour between ReteOO and PHREAK, where in this case PHREAK actually goes into an infinitie-loop, even though 'no-loop' has been defined on the "Hello World" rule.

      To run the sample using ReteOO:

      • mvn -Preteoo exec:java

      The (correct) output is:
      Hello World
      Goodbye cruel world

      To run the sample using PHREAK

      • mvn -Pphreak exec:java

      The incorrect output is:
      Hello, I'm here!
      Hello World
      Goodbye cruel world
      Goodbye cruel world
      Goodbye cruel world
      Goodbye cruel world
      Goodbye cruel world

      {infinite loop}

      Note that the PHREAK run also prints "Hello, I'm here!" and ReteOO doesn't (because the activation of that rule is canceled when the Message is updated with a new message and status).

              mfusco@redhat.com Mario Fusco
              rhn-gps-ddoyle Duncan Doyle (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: