Wrote function to evaluate rule condition.