An alternate option that i know is to use "RuleNameMatchesAgendaFilter" in
drools, by which you can selectively fire the rules with matching rule name.

Typically to add/remove new rules at runtime requires to create a new
KnowledgeSession which might be little expensive. For integration with Camel
Route/Endpoint this newly created KnowledgeSession will need to be
registered with 'GridNode' with any given name ~ "knowledgeSessionName".


typically then to execute rules:
List<Command&lt;?>> commands = new ArrayList<Command&lt;?>>();
....populate commands with facts.
BatchExecutionCommandImpl executionCommand = (BatchExecutionCommandImpl)
CommandFactory
                                .newBatchExecution(commands);
getTemplate().requestBodyAndHeader("direct:myrules",
                                executionCommand, DroolsComponent.DROOLS_LOOKUP,
                                "knowledgeSessionName");

peace,
Surya




--
View this message in context: 
http://camel.465427.n5.nabble.com/Inserting-rules-dynamically-into-camel-drools-component-tp5681880p5683733.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to