if you don't put any timestamp fusion will automatically assign the timestamp at the insertion time.
I see the problem now. You are probably not using the entry points for events.
In your rules you need to add for example:
Alarm() from entry-point "alarmsEntryPoint"
and then you need to insert the events in:
ksession.getWorkingMemoryEntryPoint("alarmsEntryPoint").insert(new Alarm());
that will treat your POJO as event in fusion.
Please read the fusion documentation:
http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-fusion/html_single/index.html#d0e523
Hi Mauricio,
Of course I did. What about the timestamps , agenda and jobs that were used in the example , are they necessary ?
Thanks,
k-
Mauricio Salatino wrote:you need to call ksession.fireAllRules() after: ksession.insert(new Event(a))
On Sun, Jan 10, 2010 at 6:29 PM, Khalil Hafsi <hafsi@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@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
- http://salaboy.wordpress.com
- http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users