Author: tsurdilovic
Date: 2009-06-19 13:37:51 -0400 (Fri, 19 Jun 2009)
New Revision: 11180
Added:
branches/community/Seam_2_2/examples/drools/resources/numberguessforflow.drl
branches/community/Seam_2_2/examples/drools/resources/numberguessforflow.xls
Modified:
branches/community/Seam_2_2/examples/drools/resources/WEB-INF/components.xml
branches/community/Seam_2_2/examples/drools/resources/numberguess.drl
branches/community/Seam_2_2/examples/drools/resources/numberguess.xls
branches/community/Seam_2_2/examples/drools/resources/pageflow.jpdl.jpg
branches/community/Seam_2_2/examples/drools/resources/pageflow.jpdl.xml
Log:
JBSEAM-4219, JBSEAM-4241
fix for broken test
Modified: branches/community/Seam_2_2/examples/drools/resources/WEB-INF/components.xml
===================================================================
---
branches/community/Seam_2_2/examples/drools/resources/WEB-INF/components.xml 2009-06-19
13:46:04 UTC (rev 11179)
+++
branches/community/Seam_2_2/examples/drools/resources/WEB-INF/components.xml 2009-06-19
17:37:51 UTC (rev 11180)
@@ -11,11 +11,11 @@
<drools:rule-base name="ruleBase"
rule-files="numberguess.drl"/>
<!-- use this in order to load from decision table instead -->
- <!-- <drools:rule-base name="ruleBase"
rule-files="numberguess.xls"/> -->
+ <!-- <drools:rule-base name="ruleBase"
rule-files="numberguess.xls"/> -->
<!-- use this in order to load from a drl and also add a ruleflow -->
- <!-- <drools:rule-base name="ruleBase"
rule-files="numberguess.drl, numberguess.rf"/> -->
+ <!-- <drools:rule-base name="ruleBase"
rule-files="numberguessforflow.drl, numberguess.rf"/> -->
<!-- use this in order to load from a xls and also add a ruleflow -->
- <!-- <drools:rule-base name="ruleBase"
rule-files="numberguess.xls, numberguess.rf"/> -->
+ <!-- <drools:rule-base name="ruleBase"
rule-files="numberguessforflow.xls, numberguess.rf"/> -->
<!-- use this if you want to register a custom consequence exception handler
-->
<!-- <drools:rule-base name="ruleBase"
rule-files="numberguess.xls"
consequence-exception-handler="#{gameConsequenceExceptionHandler}"/> -->
<drools:managed-working-memory name="workingMemory"
rule-base="#{ruleBase}">
Modified: branches/community/Seam_2_2/examples/drools/resources/numberguess.drl
===================================================================
--- branches/community/Seam_2_2/examples/drools/resources/numberguess.drl 2009-06-19
13:46:04 UTC (rev 11179)
+++ branches/community/Seam_2_2/examples/drools/resources/numberguess.drl 2009-06-19
17:37:51 UTC (rev 11180)
@@ -1,13 +1,14 @@
package org.jboss.seam.example.numberguess
-import org.jboss.seam.drools.Decision
+import org.jboss.seam.drools.Decision;
+import java.lang.Integer;
global Decision decision
global Integer randomNumber
global Game game
rule High
- ruleflow-group "Guess"
+ #ruleflow-group "Guess"
when
Guess(guess: value>randomNumber)
then
@@ -15,7 +16,7 @@
end
rule Low
- ruleflow-group "Guess"
+ #ruleflow-group "Guess"
when
Guess(guess: value<randomNumber)
then
@@ -23,7 +24,7 @@
end
rule Win
- ruleflow-group "Decision"
+ #ruleflow-group "Decision"
when
Guess(value==randomNumber)
then
@@ -31,7 +32,7 @@
end
rule Lose
- ruleflow-group "Decision"
+ #ruleflow-group "Decision"
when
Game(guessCount==9)
then
@@ -42,7 +43,7 @@
end
rule Increment
- ruleflow-group "Increment"
+ #ruleflow-group "Increment"
salience -10
when
Guess()
Modified: branches/community/Seam_2_2/examples/drools/resources/numberguess.xls
===================================================================
(Binary files differ)
Added: branches/community/Seam_2_2/examples/drools/resources/numberguessforflow.drl
===================================================================
--- branches/community/Seam_2_2/examples/drools/resources/numberguessforflow.drl
(rev 0)
+++
branches/community/Seam_2_2/examples/drools/resources/numberguessforflow.drl 2009-06-19
17:37:51 UTC (rev 11180)
@@ -0,0 +1,52 @@
+package org.jboss.seam.example.numberguess
+
+import org.jboss.seam.drools.Decision;
+import java.lang.Integer;
+
+global Decision decision
+global Integer randomNumber
+global Game game
+
+rule High
+ ruleflow-group "Guess"
+ when
+ Guess(guess: value>randomNumber)
+ then
+ game.setBiggest(guess-1);
+end
+
+rule Low
+ ruleflow-group "Guess"
+ when
+ Guess(guess: value<randomNumber)
+ then
+ game.setSmallest(guess+1);
+end
+
+rule Win
+ ruleflow-group "Decision"
+ when
+ Guess(value==randomNumber)
+ then
+ decision.setOutcome("win");
+end
+
+rule Lose
+ ruleflow-group "Decision"
+ when
+ Game(guessCount==9)
+ then
+ if ( decision.getOutcome()==null )
+ {
+ decision.setOutcome("lose");
+ }
+end
+
+rule Increment
+ ruleflow-group "Increment"
+ salience -10
+ when
+ Guess()
+ then
+ game.incrementGuessCount();
+end
Added: branches/community/Seam_2_2/examples/drools/resources/numberguessforflow.xls
===================================================================
(Binary files differ)
Property changes on:
branches/community/Seam_2_2/examples/drools/resources/numberguessforflow.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/community/Seam_2_2/examples/drools/resources/pageflow.jpdl.jpg
===================================================================
(Binary files differ)
Modified: branches/community/Seam_2_2/examples/drools/resources/pageflow.jpdl.xml
===================================================================
--- branches/community/Seam_2_2/examples/drools/resources/pageflow.jpdl.xml 2009-06-19
13:46:04 UTC (rev 11179)
+++ branches/community/Seam_2_2/examples/drools/resources/pageflow.jpdl.xml 2009-06-19
17:37:51 UTC (rev 11180)
@@ -21,7 +21,7 @@
<handler class="org.jboss.seam.drools.DroolsDecisionHandler">
<workingMemoryName>workingMemory</workingMemoryName>
<!-- if a ruleflow was added, start a process -->
- <!-- <startProcessId>numberguessid</startProcessId> -->
+ <!-- <startProcessId>numberguessid</startProcessId> -->
<assertObjects>
<element>#{game}</element>
<element>#{guess}</element>
Show replies by date