From what I can see from your code, it looks ok, but to know what is
happening we would need the audit log and some example rule that you would
expect to fire, but is not being fired.
Edson
2010/6/30 Jean-Philippe Steinmetz <jeanphilippe(a)trilogystudios.com>
Hello all,
I’d like to get Drools working in such a way that it is always running and
I can just stream new events into the runtime and have it execute rules
against them. From what I can tell I need to use stream mode in order to do
this. I’ve got everything set up for how I think it should work (based on
what I can decipher from the documentation) but what’s happening is that I’m
never getting a hit on the rules I write. I can see the event be asserted
but nothing happens.
Here is my set up…
KnowledgeBaseConfiguration config = KnowledgeBaseFactory.*
newKnowledgeBaseConfiguration*();
config.setOption(EventProcessingOption.*STREAM*);
setKnowledgeBase(KnowledgeBaseFactory.*newKnowledgeBase*(config));
// Create a knowledge agent to pull load the necessary resources
kagent = KnowledgeAgentFactory.*newKnowledgeAgent*("MyAgenda",
getKnowledgeBase());
initResources(kagent);
setKnowledgeBase(kagent.getKnowledgeBase());
getSession().addEventListener(*new* DebugAgendaEventListener());
getSession().addEventListener(*new* DebugWorkingMemoryEventListener());
And here is how I start up Drools…
thread = *new* Thread() {
@Override
*public* *void* run() {
getSession().fireUntilHalt();
}
};
thread.run();
I then feed events into the engine like this…
WorkingMemoryEntryPoint stream =
getSession().getWorkingMemoryEntryPoint(origin);
stream.insert(event);
I’m obviously missing something in my setup. Any help on understanding how
this is supposed to work is greatly appreciated. Again, the goal here is to
get Drools in a state that is always running so I can pipe in events to it
and have rules execute against them.
Jean-Philippe
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @
www.jboss.com