[rules-users] CEP Stream Mode

Jean-Philippe Steinmetz jeanphilippe at trilogystudios.com
Wed Jul 28 21:47:42 EDT 2010


Hello again!

 

It's been a while since I could tackle this problem but I'm back at it.

 

I've got the engine up and running and I'm able to insert event facts at
specific entry points. Drools is outputting an "OBJECT ASSERTED" in the
logs when this happens so this appears to be working correctly. I can
also see that one of my rules is being hit correctly because I see a
"ACTIVATION CREATED" fire. What I am not seeing however is the
associated "BEFORE ACTIVATION FIRED" and "AFTER ACTIVATION FIRED" that
generally follows.

 

I can only assume it's because I'm using the fireUntilHalt() function
which somehow behaves differently. What am I missing? Thanks again for
the help.

 

Cheers,

 

Jean-Philippe

 

From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Thursday, July 01, 2010 7:13 AM
To: Rules Users List
Subject: Re: [rules-users] CEP Stream Mode

 

   Good catch! ;)

 

   Edson

2010/7/1 Esteban Aliverti <esteban.aliverti at gmail.com>

You are invoking thread.run() instead of thread.start()... Huge
difference.

 

Best,

2010/7/1 Edson Tirelli <tirelli at post.com>

	 

	   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 at 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 at lists.jboss.org
	https://lists.jboss.org/mailman/listinfo/rules-users

	
	
	
	-- 
	 Edson Tirelli
	 JBoss Drools Core Development
	 JBoss by Red Hat @ www.jboss.com

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




-- 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti


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




-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100728/f73b77c6/attachment.html 


More information about the rules-users mailing list