@Override
  protected void initFields() throws Exception {
    File dataDir = getDataDirectory();

    if (!dataDir.exists()) {
      Files.createDirectories(dataDir.toPath());
    }

    dataColumn = context.getDataColumn().getColumnData();
    columnIndex =
        SharedApplication.getInstance().getPredictData(context.getModelID()).getTopo().getIndex();
    outputFile =
        new File(
            dataDir,
            NamingConventions.convertContextIdToXMLSafeName(
                    context.getModelID().intValue(), context.getId())
                + ".dbf");
    outputFile.createNewFile();

    DataSeriesType type = context.getAnalysis().getDataSeries();

    // grab the delivery fraction map if this is a delivery data series.
    // This is used to weed out the reaches that are not upstream of the
    // user selected terminal reaches.
    if (type.isDeliveryRequired()) {

      TerminalReaches tReaches = context.getTerminalReaches();

      assert (tReaches != null) : "client should not submit a delivery request without reaches";

      reachRowValueMap = SharedApplication.getInstance().getDeliveryFractionMap(tReaches);

      if (reachRowValueMap == null) {
        throw new Exception("Unable to find or calculate the delivery fraction map");
      }
    } else {
      reachRowValueMap = null;
    }
  }