code: private int countTries() throws ActivityException {
          Integer[] statuses = { WorkStatus.STATUS_FAILED };
          // note the current activity is at in-progress status. Failed status must be counted
          // It is debatable if we should include other statuses
          int count;
          try {
              count = this.getEngine().countActivityInstances(getProcessInstanceId(),
                      this.getActivityId(), statuses);
              count += 1;        // add the current instance - it is not yet in failed status
          } catch (Exception e) {
              setReturnCode(null);    // override "RETRY"
              throw new ActivityException(-1, "Failed to get count on failed tries", e);
          }
          return count;
      }
docs: This is only used by activities, not connection pools
  @return