Search in sources :

Example 1 with DocumentProcessingQueue

use of org.kuali.kfs.kew.api.document.DocumentProcessingQueue in project cu-kfs by CU-CommunityApps.

the class DocumentOperationAction method queueDocument.

public ActionForward queueDocument(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
    try {
        DocumentOperationForm docForm = (DocumentOperationForm) form;
        DocumentRouteHeaderValue document = docForm.getRouteHeader();
        DocumentProcessingQueue documentProcessingQueue = KewApiServiceLocator.getDocumentProcessingQueue(document.getDocumentId());
        documentProcessingQueue.process(docForm.getDocumentId());
        ActionMessages messages = new ActionMessages();
        messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("general.message", "Document was successfully queued"));
        saveMessages(request, messages);
        return mapping.findForward("basic");
    } catch (Exception e) {
        throw new WorkflowRuntimeException(e);
    }
}
Also used : ActionMessages(org.apache.struts.action.ActionMessages) ActionMessage(org.apache.struts.action.ActionMessage) WorkflowRuntimeException(org.kuali.kfs.kew.api.WorkflowRuntimeException) DocumentRouteHeaderValue(org.kuali.kfs.kew.routeheader.DocumentRouteHeaderValue) ServletException(javax.servlet.ServletException) WorkflowRuntimeException(org.kuali.kfs.kew.api.WorkflowRuntimeException) ParseException(java.text.ParseException) WorkflowServiceErrorException(org.kuali.kfs.kew.exception.WorkflowServiceErrorException) IOException(java.io.IOException) DocumentProcessingQueue(org.kuali.kfs.kew.api.document.DocumentProcessingQueue)

Aggregations

IOException (java.io.IOException)1 ParseException (java.text.ParseException)1 ServletException (javax.servlet.ServletException)1 ActionMessage (org.apache.struts.action.ActionMessage)1 ActionMessages (org.apache.struts.action.ActionMessages)1 WorkflowRuntimeException (org.kuali.kfs.kew.api.WorkflowRuntimeException)1 DocumentProcessingQueue (org.kuali.kfs.kew.api.document.DocumentProcessingQueue)1 WorkflowServiceErrorException (org.kuali.kfs.kew.exception.WorkflowServiceErrorException)1 DocumentRouteHeaderValue (org.kuali.kfs.kew.routeheader.DocumentRouteHeaderValue)1