当前位置: 首页>>代码示例>>Java>>正文


Java KewApiServiceLocator.getDocumentProcessingQueue方法代码示例

本文整理汇总了Java中org.kuali.rice.kew.api.KewApiServiceLocator.getDocumentProcessingQueue方法的典型用法代码示例。如果您正苦于以下问题:Java KewApiServiceLocator.getDocumentProcessingQueue方法的具体用法?Java KewApiServiceLocator.getDocumentProcessingQueue怎么用?Java KewApiServiceLocator.getDocumentProcessingQueue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.kew.api.KewApiServiceLocator的用法示例。


在下文中一共展示了KewApiServiceLocator.getDocumentProcessingQueue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: queueDocumentProcessing

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
/**
 * Asynchronously queues the documented to be processed by the workflow engine.
 */
protected void queueDocumentProcessing() {
   	DocumentRouteHeaderValue document = getRouteHeader();
       String applicationId = document.getDocumentType().getApplicationId();
       DocumentProcessingQueue documentProcessingQueue = (DocumentProcessingQueue) KewApiServiceLocator.getDocumentProcessingQueue(
           document.getDocumentId(), applicationId);
       DocumentProcessingOptions options = DocumentProcessingOptions.create(isRunPostProcessorLogic(), RouteContext.getCurrentRouteContext().isSearchIndexingRequestedForContext());
       documentProcessingQueue.processWithOptions(getDocumentId(), options);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:12,代码来源:ActionTakenEvent.java

示例2: queueDocument

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
public ActionForward queueDocument(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
	try {
		DocumentOperationForm docForm = (DocumentOperationForm) form;
           DocumentRouteHeaderValue document = docForm.getRouteHeader();
           String applicationId = document.getDocumentType().getApplicationId();
           DocumentProcessingQueue documentProcessingQueue = KewApiServiceLocator.getDocumentProcessingQueue(document.getDocumentId(), applicationId);
		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);
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:DocumentOperationAction.java

示例3: requeueDocument

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
protected void requeueDocument(DocumentRouteHeaderValue document) {
    String applicationId = document.getDocumentType().getApplicationId();
    DocumentProcessingQueue documentProcessingQueue = KewApiServiceLocator.getDocumentProcessingQueue(document.getDocumentId(), applicationId);
    documentProcessingQueue.process(document.getDocumentId());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:6,代码来源:RoleServiceImpl.java

示例4: testRequeueOfExceptionDocument

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
/**
 * Test to verify the fix for KULWF-669.
 *
 * This tests that if we requeue an exception document (through the RouteQueueService) that it doesn't transition
 * out of exception routing.  Then check that, if we complete it, it properly transitions out of exception routing.
 */
@Test public void testRequeueOfExceptionDocument() throws Exception {
	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("rkirkend"), "AdhocTransitionTestDocument");
	document.route("");
    assertFalse("Document should not be in exception routing.", document.isException());

    // in fact, at this point it should be routed to jhopf
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("jhopf"), document.getDocumentId());
    assertTrue("Jhopf should have an approve.", document.isApprovalRequested());

    // let's tell it to blow up on level change
    ExceptionRoutingTestPostProcessor.THROW_ROUTE_STATUS_CHANGE_EXCEPTION = true;
    try {
    	document.approve("");
    	fail("We should be in exception routing");
	} catch (Exception e) {
	}

	TestUtilities.waitForExceptionRouting();
	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId());
    assertEquals("document should be in exception routing", DocumentStatus.EXCEPTION, document.getStatus());

	// now requeue the document it should stay at exception routing and the status change callback should not
	// indicate a transition out of exception routing (this is to make sure it's not going out of exception
	// routing and then right back in)
	ExceptionRoutingTestPostProcessor.THROW_ROUTE_STATUS_CHANGE_EXCEPTION = false;
	assertFalse("Should not have transitioned out of exception routing yet.", ExceptionRoutingTestPostProcessor.TRANSITIONED_OUT_OF_EXCEPTION_ROUTING);
	// the requeue here should happen synchronously because we are using the SynchronousRouteQueue
	DocumentRouteHeaderValue routeHeaderValue = KEWServiceLocator.getRouteHeaderService().getRouteHeader(document.getDocumentId());
    String applicationId = routeHeaderValue.getDocumentType().getApplicationId();
    DocumentProcessingQueue documentProcessingQueue = KewApiServiceLocator.getDocumentProcessingQueue(document.getDocumentId(), applicationId);
	documentProcessingQueue.process(String.valueOf(document.getDocumentId()));

	// the document should still be in exception routing
	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId());
    assertEquals("document should be in exception routing", DocumentStatus.EXCEPTION, document.getStatus());
    assertFalse("document shouldn't have transitioned out of exception routing.", ExceptionRoutingTestPostProcessor.TRANSITIONED_OUT_OF_EXCEPTION_ROUTING);

    // now turn status change exceptions off and complete the exception request
    ExceptionRoutingTestPostProcessor.THROW_ROUTE_STATUS_CHANGE_EXCEPTION = false;
    assertTrue("rkirkend should be in the exception workgroup.", document.isCompletionRequested());
    document.complete("Completing out of exception routing.");

    // Note: The behavior here will be a bit different then in a real setting because in these tests the route queue is synchronous so jhopf's original
    // Approve never actually took place because the transaction was rolled back (because of the exception in the post process).  Therefore, we still
    // need to take action as him again to push the document to FINAL
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("jhopf"), document.getDocumentId());
    assertTrue(document.isApprovalRequested());
    document.approve("");

    // document should now be FINAL
    assertTrue("Document should be FINAL.", document.isFinal());

    // the status change out of exception routing should have happened
    assertTrue("Document should have transitioned out of exception routing.", ExceptionRoutingTestPostProcessor.TRANSITIONED_OUT_OF_EXCEPTION_ROUTING);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:62,代码来源:ExceptionRoutingTest.java


注:本文中的org.kuali.rice.kew.api.KewApiServiceLocator.getDocumentProcessingQueue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。