[jboss-user] [JBoss Seam] - Re: Rules and navigation

saeediqbal1 do-not-reply at jboss.com
Tue Feb 13 14:23:48 EST 2007


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


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4015985#4015985

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4015985



More information about the jboss-user mailing list