(Note: This was cross-posted earlier to the Jess User Group as well)

We wrote code to solve this problem (described later) many years ago, when I was not aware of rule based approaches. However, I wonder if a rules based solution  might represent a better  approach to solve this problem... and if so, how would one do it? 

BACKGROUND
We have departments setup in a hierarchical structure (i.e. parent departments) 
An employee can belong to one and only one department.
An employee can  be the manager of one or more departments; a manager  may or not belong to that department.
A department can have many employees and many managers.

PROBLEM
Find the approver for an employee's expenses.
An approver is a 'higher level' manager relative to employee in the organizational hierarchy.
Note that since the manager is employee as well, this includes the problem of finding the manager of a manager.

RULES
1. The approver  the nearest manager to the employee (traversing up the department hierarchy)
Typical cases then are:
- for a non-manager employee, the approver is the manager of the employee's department
- for a manager who manages a single department and belongs to that department, the approver is the manager of the parent unit 

2. The approver for a manager cannot the manager himself or a peer manager (in the same department).

3. An approver cannot report to the employee 
This sometimes happens when the manager is an employee in one department but manager for a department a few levels up in the hierarchy

3a. An approver cannot be the peer to someone who reports to the manager



SAMPLE DATA
A              (manager Hillary)      
   A1         (manager John  and Jane )                
       A11   
       A12   (manager Mike; employees John and Mike)
       A13
   A2          (manager Kate)
       A21    (manager Jessica, employee Janet)
       A22    (manager Erica, employee Jane)

1. Approver for Janet is Jessica
2. Approver for Jessica is Kate
3.Approver for John  is Hillary (cannot be Mike, John himself or Jane)
4. Approver for Jane is Erica via A22 (no reporting relationship).

ALGORITHMIC SOLUTION
Define the department  reporting vector  starting from the employee department
    e.g. for (1) it would be A21 -> A2 -> A and 
           for (3) it would be A12 -> A1 -> A
Then for each, define managers and then employees
        (1) : A21( jessica/ janet )    -> A2: ( Kate)  -> A(  Hillary)
        (2):  A12 (Mike/  John, Mike)   -> A1 (John, Jane)  -> A (Hillary)
Then starting from the top (i.e. A), move down looking for the employee (in manager or employee list)
If  the employee is found in  the manager list, approver is the manager of the parent department
If the employee is found in the employee list, the approver is the manager of this unit (not the parent)
(I may have missed a few rules in the algorithmic solution)


RULE BASED SOLUTION?
Is this a good problem for rule bases solution?
I started to model this and will post my solution if I can come up with something useful but would absolutely welcome your inputs.