use of org.kuali.kfs.kew.api.action.ActionInvocationQueue in project cu-kfs by CU-CommunityApps.
the class DocumentOperationAction method queueActionInvocation.
public ActionForward queueActionInvocation(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
try {
DocumentOperationForm docForm = (DocumentOperationForm) form;
String principalId = KEWServiceLocator.getIdentityHelperService().getIdForPrincipalName(docForm.getActionInvocationUser());
ActionInvocation invocation = ActionInvocation.create(ActionType.fromCode(docForm.getActionInvocationActionCode()), docForm.getActionInvocationActionItemId());
DocumentRouteHeaderValue document = docForm.getRouteHeader();
ActionInvocationQueue actionInvocationQueue = KewApiServiceLocator.getActionInvocationProcessorService(document.getDocumentId());
actionInvocationQueue.invokeAction(principalId, docForm.getRouteHeader().getDocumentId(), invocation);
ActionMessages messages = new ActionMessages();
messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("general.message", "Action Invocation Processor was successfully scheduled"));
saveMessages(request, messages);
return mapping.findForward("basic");
} catch (Exception e) {
throw new WorkflowRuntimeException(e);
}
}
Aggregations