Thanks guys,

this sort of advice was what I was after.

My problem is that I'm using the rule engine to do a calculation. I'd like
to be able to change the calculation easily after deploying the code so a
rule engine looks like a good fit. The calculation is a business-defined
bit of info. I also want to describe/log the calculation, which I am doing
in the consequence.

If I put the calc and the logging in a class, I lose the ability to change
it without re-releasing the supporting code...

That's why I'm asserting a logger etc.



                                                                                
                                                                 
                      Mark Proctor                                              
                                                                 
                      <[EMAIL PROTECTED]         To:      
[email protected]                                                        
         
                      us.org>                  cc:                              
                                                                 
                                               Subject: Re: [drools-user] 
should we be logging inside a rule consequence at all?                 
                      10/11/2005 14:31                                          
                                                                 
                      Please respond                                            
                                                                 
                      to user                                                   
                                                                 
                                                                                
                                                                 
                                                                                
                                                                 




Good advice. I further advocate that the real business logic should
happen in methods outside of the consequence, the consequence is just
the minimal plumbing to call methods to get the job done. A consequence
is declaring what you want done, not how you want it done - although
thats just a guide line.

Mark
Chalakanth Reddy wrote:
> Our team is new to Drools too and we are in the process of figuring out
> coding guidelines for the rules.
>
> We decided never use a logger inside the consequence.
>
> The consequence must express business rules only and there should be no
> extra "plumbing" type code.
>
> Something like this ....
>
> <rule>
>       <condition>order.isCompleted()</condition>
>       <consequence>workflow.archiveOrder(order)</consequence>
> </rule>
>
>
> The logs from a WorkingMemoryEventListener, and the logs from the Java
> classes that actually implements the business rule statements should give
> us all the information we need.  Or so we hope.
>
> Does this make sense?
>
>
> This communication, including any attachments, may contain privileged or
> confidential information.  It is intended for a specific individual and
> purpose and is protected by law.  If you have received this communication
> in error, please immediately notify me and destroy the communication.
Any
> wrongful interception, disclosure, copying or distribution of this
> communication, or the taking of any action based on this communication by
> anyone other than the intended recipient is strictly prohibited and
> punishable under federal law.
>
>
>
>






**********************************************************************
This e-mail and any attachment is intended for the named addressee(s) only, or 
person authorised to receive it on their behalf. The content should be treated 
as confidential and the recipient may not disclose this message or any 
attachment to anyone else without authorisation. Unauthorised use, copying or 
disclosure may be unlawful. If this transmission is received in error please 
notify the sender immediately and delete this message from your e-mail system. 
Any view expressed by the sender of this message or any attachment may be 
personal and may not represent the view held by First Choice Holidays PLC and 
its subsidiaries. All electronic transmissions to and from First Choice are 
recorded, may be monitored and are scanned for viruses and content.  E-mails 
containing viruses will be deleted without notification. Whilst we maintain 
virus checks on inbound e-mails we accept no liability for viruses or other 
material introduced with this message.

All companies form part of the First Choice Holidays PLC group of companies.

First Choice Holidays PLC Company Registration No: 48967 (England)

Registered Office: First Choice House, London Road, Crawley, WestSussex RH10 9GX
**********************************************************************

Reply via email to