It's funny because I would have agreed with S.Lott about just using Python as is for a rule engine. I have a COMPLETELY different perspective now having done it.
If you want a full rule engine, it needs a quite a few moving parts. We built a full Python/Django rules engine and you would be surprised what needs to be built in to get a great rule engine up and running. I will explain further, but first the website is http://nebrios.com.
A rule engine should atleast have:
- Acess Control Lists - Do you want everyone seeing everything?
- Key/Value pair API - KVP's store the state, and all the rules react to changed states.
- Debug mode - Being able to see every changed state, what changed it and why. Paramount.
- Interaction through web forms and email - Being able to quickly script a web form is a huge plus, along with parsing incoming emails consistently.
- Process ID's - These track a "thread" of business value. Otherwise processes would be continually overlapping.
- Sooo much more!
So try out Nebri, or the others I list below to see if they meet your needs.
Here's the debug mode

An auto generated form

A sample workflow rule:
class task_sender(NebriOS):
# send a task to the person it got assigned to
listens_to = ['created_date']
def check(self):
return (self.created_date is not None) and (self.creator_status != "complete") and (self.assigned is not None)
def action(self):
send_email (self.assigned,"""
The ""{{task_title}}"" task was just sent your way!
Once you finish, send this email back to log the following in the system:
i_am_finished := true
It will get assigned back to the task creator to look over.
Thank you!! - The Nebbs
""", subject="""{{task_title}}""")
So, no, it's not simple to build a rules based, event based workflow engine in Python alone. We have been at it over a year! I would recommend using tools like
- http://nebrios.com
- http://pyke.sourceforge.net (It's Python also!)
- http://decisions.com
- http://clipsrules.sourceforge.net