Example #1
0
  /**
   * Reads in a decision stored in XML.
   *
   * @param decN - the XML element.
   */
  public void fromXML(Element decN) {
    this.fromXML = true;

    RationaleDB db = RationaleDB.getHandle();

    String rid = decN.getAttribute("rid");
    id = Integer.parseInt(rid.substring(2));

    name = decN.getAttribute("name");

    type = DecisionType.fromString(decN.getAttribute("type"));

    devPhase = Phase.fromString(decN.getAttribute("phase"));

    status = DecisionStatus.fromString(decN.getAttribute("status"));

    Node child = decN.getFirstChild();
    importHelper(child);

    Node nextNode = child.getNextSibling();
    while (nextNode != null) {
      importHelper(nextNode);
      nextNode = nextNode.getNextSibling();
    }

    db.addPatternDecisionFromXML(this);
  }