code: public String getServiceSummaryVariableName(Process processDefinition) {
          for (Activity activity : processDefinition.getActivities()) {
              String attr = activity.getAttribute("serviceSummaryVariable");
              if (attr != null)
                  return attr;
          }
          return null;
      }
docs: Walks through all activities looking for the attribute.