[rules-users] CEP Stream Mode

Edson Tirelli tirelli at post.com
Thu Jul 1 10:12:56 EDT 2010


   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/20100701/13545d87/attachment.html 


More information about the rules-users mailing list