* @param workgroup the workgroup where a queue will be searched.
* @param request the user request to be handled.
* @return the best RequestQueue in the specified Workgroup.
*/
public RequestQueue getBestQueue(Workgroup workgroup, UserRequest request) {
WordMatchRouter router = new WordMatchRouter();
for (RoutingRule rule : getRoutingRules(workgroup)) {
String query = rule.getQuery();
boolean handled = router.checkForHits(request.getMetaData(), query);
if (handled) {
// Retrieve queue and route to it.
try {
return workgroup.getRequestQueue(rule.getQueueID());
}