/** Check the start activity, make sure it exists and is positioned correctly. */
  @SuppressWarnings("boxing")
  public void checkStartActivityPositioning() {

    // examine the parent of pick. It can only be a
    //   <sequence>, <scope>, or <flow>
    //
    // for it to be valid start activity
    //

    IProblem problem;

    INode context = mNode;
    INode parent = context.parentNode();
    boolean bSequenceChecked = false;

    while (parent != null) {

      QName pnn = parent.nodeName();

      if (ND_FLOW.equals(pnn)) {
        // OK
      } else if (ND_SCOPE.equals(pnn)) {
        // OK
      } else if (ND_PROCESS.equals(pnn)) {
        // OK
        break;

      } else if (ND_SEQUENCE.equals(pnn)) {
        if (bSequenceChecked == false) {
          // check to see that I am the first element in the sequence
          List<INode> nodes = mSelector.selectNodes(parent, Selector.ALL, Filters.ACTIVITIES);
          int index = nodes.indexOf(context) + 1;
          if (index != 1) {
            problem = createError();
            problem.fill("BPELC__START_ACTIVITY", toString(mNode.nodeName()), index);
          }

          bSequenceChecked = true;
        }

      } else {
        problem = createError();
        problem.fill("BPELC__START_ACTIVITY", toString(mNode.nodeName()), -1);
      }

      context = parent;
      parent = context.parentNode();
    }
  }
  /**
   * Check the supressJoinFailure attribute. It checks if it is set and has a value of yes or no.
   */
  @ARule(
      date = "10/05/2006",
      desc =
          "Check the supressJoinFailure attribute. "
              + " It checks if it is set and has a value of yes or no.",
      author = "*****@*****.**",
      errors = "BPELC__UNSET_ATTRIBUTE,BPELC__INVALID_ATTRIBUTE_VALUE")
  public void rule_CheckSuppressJoinFailure_1() {

    fSuppressJoinFailre =
        getAttribute(mNode, AT_SUPPRESS_JOIN_FAILURE, KIND_ACTIVITY, Filters.BOOLEAN_FILTER, false);

    if (isEmpty(fSuppressJoinFailre)) {

      // ask parent
      INode parent = fParentNode;
      while (parent != null && isEmpty(fSuppressJoinFailre)) {
        fSuppressJoinFailre = getValue(parent, AT_SUPPRESS_JOIN_FAILURE, null);
        parent = parent.parentNode();
      }
    }

    setValue(AT_SUPPRESS_JOIN_FAILURE, fSuppressJoinFailre);
  }