[rules-users] stream mode
Mauricio Salatino
salaboy at gmail.com
Sun Jan 10 16:22:24 EST 2010
you need to call ksession.fireAllRules() after: ksession.insert(new
Event(a))
On Sun, Jan 10, 2010 at 6:29 PM, Khalil Hafsi <hafsi at fzi.de> wrote:
> Hi Guys,
>
> I am using DROOLS FUSION last version
> It is very important for me that events arrive in the order i fire them
> , this is a part of the code used for stream mode :
> > KnowledgeBuilder kbuilder =
> > KnowledgeBuilderFactory.newKnowledgeBuilder();
> >
> > kbuilder.add(ResourceFactory.newClassPathResource("pol.drl"),
> > ResourceType.DRL);
> > if ( kbuilder.hasErrors() ) {
> > System.err.println( kbuilder.getErrors().toString() );
> > }
> > KnowledgeBaseConfiguration config =
> > KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
> > config.setOption(EventProcessingOption.STREAM);
> > KnowledgeBase kbase =
> > KnowledgeBaseFactory.newKnowledgeBase(config);
> > kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
> >
> > StatefulKnowledgeSession ksession =
> > kbase.newStatefulKnowledgeSession();
>
> after this part I just start inserting Events into the ksession , i.e
> ksession.insert(new Event(a)) ...
>
> does this suffice to make the the engine in stream mode and hence ordered ?
> In the example app , Events were fired as they arrive , but a timestamp
> was given , and also agenda and jobs were used.
> Is that necessary for the engine to work in stream mode ?
> I have a piece of code that gives me different results every time I run
> it ?! it is in stream mode , but for some reason the rule either do not
> fire , or do not print the output. is there a way to debug into this ?
>
> thank you .
> k-
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
--
- http://salaboy.wordpress.com
- http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100110/74899aa0/attachment.html
More information about the rules-users
mailing list