Uploaded image for project: 'JBoss Enterprise BRMS Platform 5'
  1. JBoss Enterprise BRMS Platform 5
  2. BRMS-178

update(fact) doesn't work in ruleflow

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Done
    • None
    • 5.0.1
    • None
    • Workaround Exists
    • Hide

      As a workaround one can do (in a on-exit action):
      drools.getIdentityMap().put(someFact, drools.getWorkingMemory().getFactHandle(someFact));
      and then it is safe to call
      update(someFact);

      Show
      As a workaround one can do (in a on-exit action): drools.getIdentityMap().put(someFact, drools.getWorkingMemory().getFactHandle(someFact)); and then it is safe to call update(someFact);

    Description

      Hi,
      org.drools.base.DefaultKnowledgeHelper uses newly added identityMap to keep track of fact handles. It looks like this identityMap is updated before a rule's consequence is called. However it is not updated before a Drools Flow on-exit action. This means that calling update(someFact) in a on-exit ruleflow action causes exception ("org.drools.FactException: Update error: handle not found for object: XXXXX. Is it in the working memory?").

      this was tested on drools-core-5.0.0.20090417.044049-485.jar

      Thanking you in advance.
      Best Regards,
      Michal

      Attachments

        Issue Links

          Activity

            People

              kverlaen@redhat.com Kris Verlaenen
              neilwallace@redhat.com Neil Wallace
              Archiver:
              samahaja@redhat.com Sagar Mahajan

              Dates

                Created:
                Updated:
                Resolved:
                Archived: