public String allocateRoute(List<BlockOrder> orders){
  if (_totalAllocated) {
    return null;
  }
  if (orders == null) {
    _orders=getBlockOrders();
  }
 else {
    _orders=orders;
  }
  _allocated=false;
  _totalAllocated=true;
  String msg=checkInService();
  if (msg != null) {
    _totalAllocated=false;
    return msg;
  }
  OBlock block=getBlockAt(0);
  msg=block.allocate(this);
  if (msg != null) {
    return msg;
  }
  allocateFromIndex(1);
  return null;
}

public String allocateRoute ( List < BlockOrder > orders ) { if ( _totalAllocated ) { return null ; } if ( orders == null ) { _orders = getBlockOrders ( ) ; } else { _orders = orders ; } _allocated = false ; _totalAllocated = true ; String msg = checkInService ( ) ; if ( msg != null ) { _totalAllocated = false ; return msg ; } OBlock block = getBlockAt ( 0 ) ; msg = block . allocate ( this ) ; if ( msg != null ) { return msg ; } allocateFromIndex ( 1 ) ; return null ; }
allocate as many blocks as possible from the start of the warrant . installs listeners for the entire route . sets this warrant into allocated blocks
