Women in Technology

Hear us Roar



Article:
  Give Your Business Logic a Framework with Drools
Subject:   rule contexts
Date:   2005-08-08 09:00:36
From:   brjado
Very timely contribution ... kudos Paul ...


How do establish rule contexts for single object?


Lets say for your StockOffer object you had 2 separate rule contexts to be executed prior to their respective business operations, e.g. "Sell" "Buy" actions.


You wouldnt want the "Sell" rule context to be exercised when performing the "Buy" operation on the StockOffer object.


Please excuse me if I missed such an explanation.


Again, great contribution ... this subject matter is weighted heavily in our technology suite for improving application development.

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • rule contexts
    2005-08-08 09:20:47  paul_browne [View]


    No , you didn't miss anything - the example(s) were kept very simple for clarity.



    For the example you are talking about , you would probably split the Rules into two Sets (.drl files) - one for sell and one for buy.



    If your question is more 'how do I model more complex rules , you would either (a) make your preconditions more complex - more conditions to be satisified before the rule fires or (b) Arrange it so that Rule 2 would only fire of a change made to working memory by Rule 1.



    The www.drools.org site has a lot of additional information on this subject.



    Paul Browne - www.firstpartners.net/rp