[jboss-user] [JBoss Seam] - JBoss Rules problem (where else to post?)

galo.navarro do-not-reply at jboss.com
Mon Sep 4 06:28:01 EDT 2006


Sorry if this is not the appropiate forum but I can't find anything related to JBoss Rules.

The examples from the livetrails work perfectly on standalone applications, now I'm trying to get an example running on Jboss 4.0.4GA so I created a simple drl file and an EJB that puts some objects in the working memory etc.

The EJB runs this code below normally, if I debug and inspect the working memory I can see the rules are loaded (see below the code) and asserted objects are saved. But, misteriously, when it executes fireAllRules nothing happens. No errors shown anywhere. Am I missing something?


  | PackageBuilder builder = new PackageBuilder();
  | builder.addPackageFromDrl(new InputStreamReader(new java.io.FileInputStream("D:\\noc.drl")));
  | RuleBase ruleBase = RuleBaseFactory.newRuleBase();
  | WorkingMemory workingMemory = ruleBase.newWorkingMemory();
  | if(this.nocs==null)
  |   this.listNoCs();
  | Iterator it=this.nocs.iterator();
  | while(it.hasNext())
  | workingMemory.assertObject(it.next());
  | System.out.println("Now you should see something:");
  | workingMemory.fireAllRules();
  | 


  | #created on: 31-Aug-2006
  | package tal.noc.rules
  | 
  | import tal.noc.entity.*;
  | 
  | #list any import classes here.
  | #declare any global variables here
  | 
  | rule "NOC Id >= than 1"
  | 	when
  | 		noc : NOC(id>=1);
  | 	then 
  | 		System.out.println("Found with id eq/over 1");
  | end
  | 
  | rule "NOC Id < than 1"
  | 	when
  | 		noc : NOC(id<1);
  | 	then 
  | 		System.out.println("Found with id below 1");	
  | end
  | 

Another question, where should my .drl files be packaged for deployment?

Thanks

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

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



More information about the jboss-user mailing list