-
1. Re: Rules and navigation
saeediqbal1 Feb 13, 2007 2:23 PM (in response to statelessbean)I would suggest go ahead and open the source code. Look into the resources folder and you will see a file called numberguess.drl . Examine that and then look at the source code.
Contents are
package org.jboss.seam.example.numberguess
import org.jboss.seam.drools.Decision
global Decision decision
rule High
when
RandomNumber(randomValue:value)
Guess(guess: value>randomValue)
game: GameHistory()
then
game.setBiggest(guess.intValue()-1);
end
rule Low
when
RandomNumber(randomValue:value)
Guess(guess: value<randomValue)
game: GameHistory()
then
game.setSmallest(guess.intValue()+1);
end
rule Win
when
RandomNumber(randomValue:value)
Guess(value==randomValue)
then
decision.setOutcome("win");
end
rule Lose
when
GameHistory(guessCount==9)
then
if ( decision.getOutcome()==null )
{
decision.setOutcome("lose");
}
end
rule Incremement
salience -10
when
game: GameHistory()
then
game.incrementGuessCount();
end
Also look at the file next to it called pageflow.jpdl.xml . I'm not putting contents for that here though :)
Then feel free to ask specific questionsa bout functionality of seam+drools int hat application. once you have that implementation down, you'ld be ok to start your own seam+drools project -
2. Re: Rules and navigation
saeediqbal1 Feb 13, 2007 2:26 PM (in response to statelessbean)oh Mr. Bean i forgot to say the above stuff was the seam(distribution)/examples/drools/ . I learned the functionality from that example, which is pretty good. Personally i'm not using drools for now. Dont want to get tangled into alot of new stuff.