Design and implementation of a business process rules engine