[rules-users] Drools 4.0 problem: insert (drl) not reflected StatefulSession.

Michael Waluk mwaluk at gmail.com
Wed Aug 15 19:29:31 EDT 2007


I just upgraded to Drools 4.0 and changed my assertObject calls to insert.
I also switched from WorkingMemory to StatefulSession.  The rules seem to be
fine, but I am not able to retrieve any inserted objects from the working
memory for some reason.  Here is what I'm doing.  I'd appreciate any
suggestions...

StatefulSession *workingMemory* = getActiveWorkingMemories(id);
*workingMemory*.fireAllRules();

// Here is the rule that fires:
*

rule* "RecognizeBenefitsProgramEvent" *
**  when* $edit: BenefitsProgramModelEdit()
*  then*
*    insert* (*new* *BenefitsProgramEvent*("BenefitsProgramEvent",
$edit.getValidFrom(), "AnnualEnrollmentEvent")); *
**    System*.out.println("Rule RecognizeBenefitsProgramEvent fired "); *
**end*

I see the print statement in the console but the inserted object is not
actually in the working memory.  I look using this:

Iterator events = *workingMemory*.iterateObjects(new ClassObjectFilter(
BenefitsProgramEvent.class));

This iterator is empty.  I also debug and look at the assetMap inside
workingMemory and it never changes.

Thanks,

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070815/73ba53f5/attachment.html 


More information about the rules-users mailing list