public static EDLController createEDLController(
     EDocLiteAssociation edlAssociation,
     EDLGlobalConfig edlGlobalConfig,
     DocumentRouteHeaderValue document) {
   EDLController edlController = createEDLController(edlAssociation, edlGlobalConfig);
   try {
     Document defaultDom = edlController.getDefaultDOM();
     Document documentDom = XmlHelper.readXml(document.getDocContent());
     // get the data node and import it into our default DOM
     Element documentData = (Element) documentDom.getElementsByTagName(EDLXmlUtils.DATA_E).item(0);
     if (documentData != null) {
       Element defaultDomEDL = EDLXmlUtils.getEDLContent(defaultDom, false);
       Element defaultDomData =
           (Element) defaultDomEDL.getElementsByTagName(EDLXmlUtils.DATA_E).item(0);
       defaultDomEDL.replaceChild(defaultDom.importNode(documentData, true), defaultDomData);
     }
     if (LOG.isDebugEnabled()) {
       LOG.debug(
           "Created default Node from document id "
               + document.getDocumentId()
               + " content "
               + XmlJotter.jotNode(defaultDom));
     }
   } catch (Exception e) {
     throw new WorkflowRuntimeException(
         "Problems creating controller for EDL "
             + edlAssociation.getEdlName()
             + " document "
             + document.getDocumentId(),
         e);
   }
   return edlController;
 }
  /** Copied from org.kuali.rice.kew.routelog.web.RouteLogAction. */
  @SuppressWarnings("unchecked")
  private Set<String> getActionRequestIds(DocumentRouteHeaderValue document) {
    Set<String> actionRequestIds = new HashSet<String>();

    List<ActionRequestValue> actionRequests =
        KEWServiceLocator.getActionRequestService()
            .findAllActionRequestsByDocumentId(document.getDocumentId());

    if (actionRequests != null) {
      for (ActionRequestValue actionRequest : actionRequests) {
        if (actionRequest.getActionRequestId() != null) {
          actionRequestIds.add(actionRequest.getActionRequestId());
        }
      }
    }
    return actionRequestIds;
  }
  public ActionRequestValue deepCopy(Map<Object, Object> visited) {
    if (visited.containsKey(this)) {
      return (ActionRequestValue) visited.get(this);
    }
    ActionRequestValue copy = new ActionRequestValue();
    visited.put(this, copy);
    copy.actionRequestId = actionRequestId;
    copy.actionRequested = actionRequested;
    copy.documentId = documentId;
    copy.ruleBaseValuesId = ruleBaseValuesId;
    copy.status = status;
    copy.responsibilityId = responsibilityId;
    copy.groupId = groupId;
    copy.roleName = roleName;
    copy.qualifiedRoleName = qualifiedRoleName;
    copy.qualifiedRoleNameLabel = qualifiedRoleNameLabel;
    copy.recipientTypeCd = recipientTypeCd;
    copy.priority = priority;
    copy.routeLevel = routeLevel;
    copy.docVersion = docVersion;
    if (createDate != null) {
      copy.createDate = new Timestamp(createDate.getTime());
    }
    copy.responsibilityDesc = responsibilityDesc;
    copy.annotation = annotation;
    copy.jrfVerNbr = jrfVerNbr;
    copy.principalId = principalId;
    copy.forceAction = forceAction;
    copy.currentIndicator = currentIndicator;
    copy.approvePolicy = approvePolicy;
    copy.delegationTypeCode = delegationTypeCode;
    copy.requestLabel = requestLabel;
    if (parentActionRequest != null) {
      copy.parentActionRequest = parentActionRequest.deepCopy(visited);
    }
    if (actionTaken != null) {
      copy.actionTaken = actionTaken.deepCopy(visited);
    }
    if (nodeInstance != null) {
      copy.nodeInstance = nodeInstance.deepCopy(visited);
    }
    if (childrenRequests != null) {
      List<ActionRequestValue> copies = new ArrayList<ActionRequestValue>();
      for (ActionRequestValue childRequest : childrenRequests) {
        copies.add(childRequest.deepCopy(visited));
      }
      copy.childrenRequests = copies;
    }

    copy.createDateString = createDateString;
    copy.displayStatus = displayStatus;
    copy.resolveResponsibility = resolveResponsibility;
    if (routeHeader != null) {
      copy.routeHeader = routeHeader.deepCopy(visited);
    }
    if (simulatedActionItems != null) {
      List<ActionItem> copies = new ArrayList<ActionItem>();
      for (ActionItem simulatedActionItem : simulatedActionItems) {
        copies.add(simulatedActionItem.deepCopy(visited));
      }
      copy.simulatedActionItems = copies;
    }
    return copy;
  }