コード例 #1
0
  public String addSorPerson(
      final ReconciliationCriteria reconciliationCriteria, final RequestContext context) {
    reconciliationCriteria.getSorPerson().setSourceSor(AbstractPersonServiceAction.STATIC_SOR_NAME);
    try {
      final ServiceExecutionResult<Person> result =
          getPersonService().addPerson(reconciliationCriteria);

      getSpringErrorValidationErrorConverter()
          .convertValidationErrors(result.getValidationErrors(), context.getMessageContext());

      if (context.getMessageContext().hasErrorMessages()) {
        return "validationError";
      }

      context.getFlowScope().put("serviceExecutionResult", result);
      return "success";
    } catch (final ReconciliationException e) {
      context.getFlowScope().put("reconciliationResult", e);
      return "reconciliation";
    }
    // TODO Need to add logic here to handle case where SoR already provided an SorPerson.
    // For example if OR is the SoR and reconciliation determines that OR
    // get the sorPerson that already exists from SorPersonAlreadyExistsException, update it with
    // the values from reconciliation.SorPerson
    // call updateSorPerson
    catch (final SorPersonAlreadyExistsException e) {
      return "error";
    }
  }
コード例 #2
0
  public ServiceExecutionResult addSorPerson(
      final ReconciliationCriteria reconciliationCriteria, final MessageContext context) {
    reconciliationCriteria.getSorPerson().setSourceSor(AbstractPersonServiceAction.STATIC_SOR_NAME);
    final ServiceExecutionResult<Person> result =
        getPersonService().forceAddPerson(reconciliationCriteria);
    getSpringErrorValidationErrorConverter()
        .convertValidationErrors(result.getValidationErrors(), context);

    return result;
  }
コード例 #3
0
  public void setConfirmationMessage(
      final ServiceExecutionResult<Person> serviceExecutionResult,
      final ReconciliationResult reconciliationResult,
      final MessageContext context) {
    // if reconciliation result is EXACT or MAYBE then only a role was added, not a new person.
    // a force add, would result in no reconciliationResult.

    if (reconciliationResult != null) {
      if (reconciliationResult.getReconciliationType()
              == ReconciliationResult.ReconciliationType.EXACT
          || reconciliationResult.getReconciliationType()
              == ReconciliationResult.ReconciliationType.MAYBE) {
        context.addMessage(new MessageBuilder().info().code("roleAdded").build());
        return;
      }
    }

    final Person person = serviceExecutionResult.getTargetObject();
    final Identifier netId =
        person.getPrimaryIdentifiersByType().get(this.preferredPersonIdentifierType);

    if (person.getCurrentActivationKey() != null) {
      final MessageResolver message =
          new MessageBuilder()
              .info()
              .code("personAddedFinalConfirm")
              .arg(netId.getValue())
              .arg(person.getCurrentActivationKey().asString())
              .build();
      context.addMessage(message);
    } else {
      context.addMessage(
          new MessageBuilder()
              .info()
              .code("personAddedFinalConfirm")
              .arg(netId.getValue())
              .arg("TempKey")
              .build());
    }
  }