Function applyRoutingRule