Q:

Replace if/else on certain order with a proper design (rule/priority based if/else)

I have a class method that implements a logic based on rules.  The structure is as follows:  
sub process {  
   # declarations etc    
   # other code     
   # core logic:    
   if($conditions->{size} == $item_size) {  
     #do something here as it matches the rule based on size
     return $result;  
     }  

     if($conditions->{area} == $item_area_dispatch) {  
      #do something that matches the area criteria
      return $result;  
      }   

      if($conditions->{country} == $item_country) {  
      #do something that matches the country criteria   
      return $result;
     }    
}    

Basically there is a series of if/else statement that validate whether certain conditions apply and execute the corresponding logic. 
The series of the if/elses from top to bottom is the most specific criteria to the most generic that apply
and if no rule applies do nothing. 
This works but the order depends on the if/elses and whenever I want to add a new rule I add a new if/else in the "proper" location. 
So this is not the ideal solution.  I am wondering what would be the best way to restructure my code for this? 

A:

You are not specifying any language so my answer will be mostly related to C++/Java but I guess every other oop language should provide same features.  You should encapsulate your criterion inside an object.  Something like:
enum Priority {
  HIGHEST = 0,
  HIGHER = 1,
  ...
  LOWEST = 9
}

class Criterion {
  public final Priority priority;

  public abstract boolean evaluate(YourObject object);

  Criterion(Priority priority) { this.priority = priority; }
}

class SearchCriteria {
  List<Criterion>[] criteria = new ArrayList<Criterion>[10];

  void addCriterion(Criterion criterion) {
    criteria[criterion.priority].add(criterion;
  }

  boolean evaluate(YourObject object) {
    for (List<Criterion> list : criteria)
      for (Criterion c : list)
        if (c.evaluate(object))
          return true;

    return false;
  }
}

class CountryCriterion extends Criterion {
  public final Country country;
  CountryCriterion(Country country) { super(Priority. HIGHER); this.country = country; }

  boolean evaluate(YourObject object) { return object.country.equals(country); }
}

Now, this is just to give you an example of how this might work, you could decide a different way to store priorities or something to be able to pass parameters to current criteria.