I am using Drool 3.0 in Eclipse IDE I want to know whether it's possible to fire specified rule from another rule. For ex: I am having from Rule 1 to Rule 10.. I want Rule 1 to be fired first..for that I will use salience..no problem in it.. If Rule 1 fired, then Rule 3 should be fired(selective rule should be fired)
Whether Agenda-group is used for this thing?? I have got one example from mail-archieve, which is written by Mark Proctor. In that example assertEquals() method shows error (The method assertEquals(int,int) is undefined for the type Cheese) in my eclipse IDE ..the links is from http://www.mail-archive.com/[email protected]/msg00404.html And also, Whether some options in Drools2.x will support in Drools3.0.. mean to say whether Drools is providing upward compatability?? public void testAgendaGroups() throws Exception { PackageBuilder builder = new PackageBuilder(); builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "test_AgendaGroups.drl" ) ) ); Package pkg = builder.getPackage(); RuleBase ruleBase = getRuleBase(); ruleBase.addPackage( pkg ); WorkingMemory workingMemory = ruleBase.newWorkingMemory(); List list = new ArrayList(); workingMemory.setGlobal( "list", list ); Cheese brie = new Cheese( "brie", 12 ); workingMemory.assertObject( brie ); workingMemory.fireAllRules(); assertEquals( 7, list.size() ); assertEquals( "group3", list.get( 0 ) ); assertEquals( "group4", list.get( 1 ) ); assertEquals( "group3", list.get( 2 ) ); assertEquals( "MAIN", list.get( 3 ) ); assertEquals( "group1", list.get( 4 ) ); assertEquals( "group1", list.get( 5 ) ); assertEquals( "MAIN", list.get( 6 ) ); } ----------------------------------------- package org.drools.test; import org.drools.Cheese; global java.util.List list; rule "test MAIN 1" salience 10 when Cheese( ) then list.add( "MAIN" ); drools.setFocus( "group1" ); end rule "test MAIN 2" when Cheese( ) then list.add( "MAIN" ); end rule "test group1 1" agenda-group "group1" when Cheese( ) then list.add( "group1" ); end rule "test group1 2" agenda-group "group1" when Cheese( ) then list.add( "group1" ); end rule "test group2" agenda-group "group2" when Cheese( ) then list.add( "group2" ); end rule "test group3 1" salience 5 agenda-group "group3" auto-focus true when Cheese( ) then list.add( "group3" ); drools.setFocus( "group4" ); end rule "test group3 2" agenda-group "group3" when Cheese( ) then list.add( "group3" ); end rule "test group4" agenda-group "group4" when Cheese( ) then list.add( "group4" ); end --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
