If yo are using Kagent, you don't need to add the change set to kbuilder.
The steps you need to implement should be something like this:

1. Start ResourceChangeScanner and ResourceChangeMonitor services 
2. Create a changeset.xml file containing all the resources you want to add to the kagent's kbase
3. Create a new kagent
4. kagent.applyChangeSet() <-- The agent will process each resource the xml defines and add a monitor to detect further changes.
5. kagent.getKnowledgeBase() <-- the agen't kbase will contain all the rules now

If you are looking for examples: http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/agent/

The bad new is that kagent can't manage dsl/dslr resouces yet. I'm working on that right now. Please follow these issues to be inform: https://jira.jboss.org/browse/JBRULES-2377 & https://jira.jboss.org/browse/JBRULES-2350

Best,


2010/6/18 Fnu Mahalakshmi <FMahalakshmi@nyx.com>

Hi guys,

 

In my program I have couple of .brl, .drl and .dslr files which get added to the rulebase.

 

Now my .brl files get converted to drl files and then have to be added to the rulebase.

 

After creating my .drl or .dslr file I am using this code to update the resources in my change-set.xml

ResourceChangeScannerConfiguration sconf = ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();

sconf.setProperty( "drools.resource.scanner.interval",

                   "30" ); // set the disk scanning interval to 30s, default is 60s

ResourceFactory.getResourceChangeScannerService().configure( sconf );

ResourceFactory.getResourceChangeNotifierService().start();

KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

kbuilder.add( ResourceFactory.newClassPathResource( "change-set.xml", getClass()),ResourceType.CHANGE_SET );

if ( kbuilder.hasErrors() ) {

   System.err.println( kbuilder.getErrors().toString() );

}

 

Now as per my understanding:

Since a new .drl file has been just created – the resource notifier will update my change-set.xml file of the change.

 

Now I need to load this new file to my rulebase along with my dsl file.

 

kbuilder.add( ResourceFactory.newClassPathResource( "change-set.xml", getClass()),ResourceType.CHANGE_SET );

 

is adding my new created file to my knowledge pacakage.

How can I specify my dsl file also to be added along with it???

 

Can you please guide me in the right direction..??

Please help.

 

Thank you.

M




Please consider the environment before printing this email.

Visit our website at http://www.nyse.com
*****************************************************************************
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.


_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti