/*
   * (non-Javadoc)
   * @see
   * au.org.aurin.wif.svc.ManualDemandScenarioService#updateManualDemandScenario
   * (au.org.aurin.wif.model.allocation.ManualDemandScenario, java.lang.String)
   */
  public void updateDemandOutcome(final DemandOutcome demandOutcome, final String projectId)
      throws WifInvalidInputException, WifInvalidConfigException, ParsingException {
    LOGGER.info(
        "updating ManualDemandScenario: {}, with id: {}",
        demandOutcome.getLabel(),
        demandOutcome.getId());
    try {
      if (demandOutcome.getProjectId().equals(projectId)) {
        demandOutcome.setRevision(
            demandOutcomeDao.findDemandOutcomeById(demandOutcome.getId()).getRevision());
        demandOutcomeDao.updateDemandOutcome(demandOutcome);
      } else {
        LOGGER.error(
            "illegal argument, the ManualDemandScenario supplied doesn't belong to project: "
                + projectId);
        throw new WifInvalidInputException(
            "illegal argument, the ManualDemandScenario supplied doesn't belong to project: "
                + projectId);
      }
    } catch (final IllegalArgumentException e) {

      LOGGER.error("illegal argument, the ManualDemandScenario supplied is invalid ");
      throw new WifInvalidInputException(
          "illegal argument, the ManualDemandScenario supplied is invalid ", e);
    }
  }