private int findSalesRep(MRequest request){
  String QText=request.getSummary();
  if (QText == null)   QText="";
 else   QText=QText.toUpperCase();
  MRequestProcessorRoute[] routes=m_model.getRoutes(false);
  for (int i=0; i < routes.length; i++) {
    MRequestProcessorRoute route=routes[i];
    if (request.getR_RequestType_ID() == route.getR_RequestType_ID() && route.getR_RequestType_ID() != 0)     return route.getAD_User_ID();
    String keyword=route.getKeyword();
    if (keyword != null) {
      StringTokenizer st=new StringTokenizer(keyword.toUpperCase()," ,;\t\n\r\f");
      while (st.hasMoreElements()) {
        if (QText.indexOf(st.nextToken()) != -1)         return route.getAD_User_ID();
      }
    }
  }
  return m_model.getSupervisor_ID();
}

private int findSalesRep ( MRequest request ) { String QText = request . getSummary ( ) ; if ( QText == null ) QText = "" ; else QText = QText . toUpperCase ( ) ; MRequestProcessorRoute [ ] routes = m_model . getRoutes ( false ) ; for ( int i = 0 ; i < routes . length ; i ++ ) { MRequestProcessorRoute route = routes [ i ] ; if ( request . getR_RequestType_ID ( ) == route . getR_RequestType_ID ( ) && route . getR_RequestType_ID ( ) != 0 ) return route . getAD_User_ID ( ) ; String keyword = route . getKeyword ( ) ; if ( keyword != null ) { StringTokenizer st = new StringTokenizer ( keyword . toUpperCase ( ) , " ,;\t\n\r\f" ) ; while ( st . hasMoreElements ( ) ) { if ( QText . indexOf ( st . nextToken ( ) ) != - 1 ) return route . getAD_User_ID ( ) ; } } } return m_model . getSupervisor_ID ( ) ; }
find salesrep / user based on request type and question .
