That's exactly it - and very close to what I'm doing.

I've suggested using Prolog in general for our work because the proofs that
it generates form useful explanations - I think our business wants to see
proofs behind actions. When I joined the project, JRules had been selected
to do the business logic - and it works OK. We are considering Drools
because the source code is available, mainly. We can fix things or add new
functions etc.

The logging I'm doing is basically trying to create a proof to show the
business to explain why a particular score was generated, and why it lead
to a particular action.



                                                                                
                                                                  
                      Geoffrey Wiseman                                          
                                                                  
                      <geoffrey.wiseman         To:      
[email protected]                                                        
         
                      @gmail.com>               cc:                             
                                                                  
                                                Subject: Re: [drools-user] 
should we be logging inside a rule consequence at all?                 
                      10/11/2005 16:17                                          
                                                                  
                      Please respond to                                         
                                                                  
                      user                                                      
                                                                  
                                                                                
                                                                  
                                                                                
                                                                  




On 11/10/05, Hamu, Dave <[EMAIL PROTECTED]> wrote:
>
> What does a calculator have to do with a logger???


I can't speak for Adrian, but if I were going to define a complex (ie
multi-step) calculation in a Drools rule (which I might), and save only the
final result in a domain object (which I might), then I might also want to
log the intermediate steps so that, in the case of failures, I have some
diagnosis.

The event system would not be sufficient to cover that.

In Drools pseudocode:
<parameter>insurancePolicy<parameter>
<condition>insurancePolicy.isValid()</condition>
<condition>insurancePolicy.isFinal()</condition>
<consequence>
float customerValue = insurancePolicy.getVehicle
().getCustomerReportedCost();
float marketValue = insurancePolicy.getVehicle().getMarketValue();
float customerDelta = customerValue - marketValue;
logger.log( "Policy #" + insurancePolicy.getId() + ", Customer Delta: " +
customerDelta );
float premium = PremiumCalculator.annualizedPremium( marketValue );
logger.log( "Policy #" + insurancePolicy.getId() + ", Market Value Premium:
" + premium );
premium += PremiumCalculator.annualizedCustomerDeltaPremium(
insurancePolicy.setPremium( premium );
drools.modifyObject( insurancePolicy );
</consequence>

- Geoffrey
--
Geoffrey Wiseman







**********************************************************************
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