Tuesday, August 10, 2010

The rete network does not update the modified data

This is a case where there is a dictionary D1 which is being invoked from BPEL. A set of facts F1, is passed to D1 and the same is returned from D1. There also exists D2, which uses the same set of facts as D1. D2 is invoked from the decision function of D1 (after D2 has been linked to D1, obviously !). I get F1 into D1 and I make a call to D2. D2 modifies F1 to F1.1 and returns call to D1. However, D1 does not understand F1 has changed to F1.1 and since it has been initialized with F1, continues to process the rules with F1 and F1.1 is not all considered.

This has been confirmed to be an inconsistent behavior from the rete network and rules engine and it has been identified as a bug. It would be fixed in the future releases (not sure of the release). Till if you face the same issue, you can survive with two workarounds:

A: Make call outs to rules from BPEL
  1. Call D1 from BPEL, execute rules in D1
  2. Instead of calling D2 from D1, call D2 from BPEL
  3. Then call D1 again. The rete network in this case initializes D1 with facts available in Step2
B: Assert the facts in D2 before returning control to D1
  1. Call D1, then D2 from decision function of D1
  2. Modify F1 to F1.1 in D2
  3. Using advanced functions do a assert and return of F1.1 (this makes the rete refresh the facts)
  4. Return control to D1 and proceed

Keep tracking this thread for the update on the bug and fix for the same !

Peace!

Cheers,
- AR

No comments:

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License