예제 #1
0
 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;
  }