Zope Business Rules Engine

Brian Corrigan bcorrigan at tagcorporate.com
Mon Aug 12 17:20:06 CEST 2002


Heres an example of the rules engine..

We have job codes, category codes, and cost codes that basically look
something like VERIZON0256.43.20  (JobCode.CatCode.PhaseCode) 
Normally each job.cat.phase defaults to a specific GL account.  So, in
my zope program I can use a database lookup to find out what the
general ledger account happens to be.  Sometimes though, there are
special cases where we manually map certain employees to a different
general ledger code.  The payroll input team does this manually right
now, but I would like to be able to add a rule into my time/expense
program that does this automatically.  The idea is that the rules
would be capable of being changed by the payroll department, but the
engine runs through every rule each time for a given piece of input to
determine the corrrect output.  This will cut down on IS involvement
in the future and create a more successful project.  I was hoping to
find something that processes rules prebuilt.  Ive found several in
Java, but nothing so far in python..  Im not sure exactly how to
implement the java beans within the Zope system, nor do I want to get
into creating a java application to do this.  On a low level I think
it would be as simple as creating an input page that creates SQL or
Python statements that are then stored in a SQL table as a "rule". 
When someone submits time. there is a for look that submits the input
to each rule in order of entry.  THe java systems are nice because
they display rules as english instead of code.  Im not sure I am
capable (or interested) in creating something that complicated should
I be forced to code the whole thing myself.

Does this make sense? 

Peter Hansen <peter at engcorp.com> wrote in message news:<3D545844.1AD87C0 at engcorp.com>...
> Brian Corrigan wrote:
> > 
> > Im looking to develop a payroll application for my company.  Basically
> > we want to allow time/expense entry from the field via a web site,
> > process the information based on a set of defineable rules, and output
> > a text file for input into out accounting system.  I've been trying to
> > figure out what the best plan of attack would be, but Im having
> > trouble finding the pieces I (think) i need.
> > 
> > We use ZOPE as our intranet server.  I would like to find some kind of
> > rules engine that would work within Zope and allow different people
> > (depending on their user rights) to edit the rules that define how
> > input is processed into output.  (We have defined about 100 rules at
> > least, and they change every few months or so)  It seems to me like I
> > need an input screen, a rules engine, and some means to output the
> > text file.  Is anyone familiar with a Zope product or something that
> > would work as a rules/data processing engine that would take input and
> > prodcue output in this fashion?  Maybe something with a predfined
> > rules gui?
> 
> Not sure exactly what you envision, but here's one thought based
> on experience doing similar things (although I _would_ like to have
> a nice time-tracking system in Zope).
> 
> Don't bother with the "output a text file" part in the usual sense.
> Just make sure your object in Zope has the ability to render itself as
> text, or a simple CSV file, or perhaps XML (depending on the complexity
> of the subsequent processing).  Then just have an external script which
> when needed retrieves the data from Zope via urllib.urlopen or something.
> 
> If you make the exporting part generic, as in independent of your
> accounting system's own special input format, you can decouple the
> intranet site from the accounting system.  You would have the 
> external script do any necessary conversion.
> 
> If you can expand more on the whole "rules" thing we might have 
> some other ideas.  It all seems pretty vague to me.
> 
> -Peter



More information about the Python-list mailing list