[rules-users] Rules Firing / Java Objects Not Manipulated

Michael Anstis michael.anstis at gmail.com
Tue Apr 9 14:52:14 EDT 2013


Facts inserted into WorkingMemory within rules are not automagically added
to anywhere else.

To retrieve Facts created inside rules there are different options
available; the simplest probably being to use a global that is a collection.

You can add new Facts to the global inside rules' RHS and also examine the
content of the global in regular Java.

Have a read about using globals.



On 9 April 2013 19:45, dfsmith <dfsmith at llbean.com> wrote:

> Thanks for the quick reply!
>
> This is where I'm confused. My Then looks like this:
>
>         SearchActions fact0 = new SearchActions();
>         fact0.setUrlRedirect( "junk" );
>         insert( fact0 );
>         System.out.println("Created junk!!!");
>
> There must be a SearchActions object created somewhere in memory as a
> result
> of the rule. I was thinking it would be added to the list that was passed
> into the knowledge session.
>
> How / where do I check for and access the inserted object after the
> execution of the rules?
>
> Something simple I'm just not seeing in the examples I've googled.
>
> Thanks,
>
> David
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Rules-Firing-Java-Objects-Not-Manipulated-tp4023270p4023272.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130409/35bf9788/attachment-0001.html 


More information about the rules-users mailing list