コード例 #1
0
  public boolean run(final ProcessParameters params, final XmlNode processNode) {

    if (processNode == null) {

      throw new DSSException(
          String.format(EXCEPTION_TCOPPNTBI, getClass().getSimpleName(), "processNode"));
    }
    prepareParameters(params);

    /** 5.2. Validation Context Initialisation (VCI) */
    subProcessNode = processNode.addChild(VCI);
    final XmlNode conclusionNode = new XmlNode(CONCLUSION);

    final boolean valid = process(params, conclusionNode);

    if (valid) {

      conclusionNode.addChild(INDICATION, VALID);
      conclusionNode.setParent(subProcessNode);
    } else {

      subProcessNode.addChild(conclusionNode);
      processNode.addChild(conclusionNode);
    }
    return valid;
  }
コード例 #2
0
  /** @param constraintNode */
  private void addNoPolicyNode(final XmlNode constraintNode, final XmlNode conclusionNode) {

    constraintNode.addChild(STATUS, KO);
    conclusionNode.addChild(INDICATION, INDETERMINATE);
    conclusionNode.addChild(SUB_INDICATION, NO_POLICY);
  }
コード例 #3
0
  /**
   * @param label
   * @param nameId
   * @return
   */
  private XmlNode addConstraint(final String label, final String nameId) {

    final XmlNode constraintNode = subProcessNode.addChild(CONSTRAINT);
    constraintNode.addChild(NAME, label).setAttribute(NAME_ID, nameId);
    return constraintNode;
  }
コード例 #4
0
  /**
   * @param constraintNode
   * @param policy
   */
  private void addPolicyNode(final XmlNode constraintNode, final String policy) {

    constraintNode.addChild(STATUS, OK);
    constraintNode.addChild(INFO, policy).setAttribute(FIELD, POLICY);
  }