yes, I am pretty sure rules can solve that problem, probably in just a few rules, but I can't do it for you right now !
Best bet it to think in terms of how you may solve this with SQL. And also think of asserting facts individually, let the engine join them up on userId etc... Michael. On 12/10/06, ramki <[EMAIL PROTECTED]> wrote:
Hi, I have 2 problems to solve and both are chain-reaction like problems. Problem 1: Lets assume there is one Product with many "Terms & Conditions." And every "T & C", could consist of hundreds of "Term" (String Object). So initially when the system creats the first product, it would have an association with a TC and that would have the association with all the Terms (1000s of it) in the system. When the second product is created, we look for all the Terms that are associated (by user) for the second product and create T&C with those Terms, create another T&C with the differences between first T&C and the second T&C's Terms, remove the old T&C with all the Terms and Now associate both the new T&Cs with first product and the intersecting one with the second product. Yes, perfectly right, this is a Set problem. So in more simple terms, create T&Cs by finding the intersections and differences in all T&Cs in the system and associate them appropriately to the products so that there is no change in the final "Terms" associated with the Product. Its not a endless chain-reaction though. So, thats the requirement I have. Given that I'm new to Rules style (this is first rule I'm writing :) ) programming, I'm kinda stuck. I do not know how to have multiple T&C in rules memory and access them and call a function that takes 2 T&Cs and will give the intersections and diff'ed new T&Cs. Assert the new ones and go on and on. Please help. Problem 2: A change in given object triggers changes in many objects and those changes trigger changes in another set of objects... It finally ends when there is no more object to change. Again a chain reaction with an end. So, the question would be how to handle chain-reactions effectively in the rules-engine? Thanks in advance, -ramki