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


Java WorkflowDocument.recall方法代码示例

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


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

示例1: testRecallAsInitiatorBeforeAnyApprovals

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testRecallAsInitiatorBeforeAnyApprovals() throws Exception {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(EWESTFAL, RECALL_TEST_DOC);
    document.route("");

    document.recall("recalling", true);

    assertTrue("Document should be recalled", document.isRecalled());
    assertAfterActionTakenCalled(ActionType.RECALL, ActionType.RECALL);

    //verify that the document is truly dead - no more action requests or action items.

    List requests = KEWServiceLocator.getActionRequestService().findPendingByDoc(document.getDocumentId());
    assertEquals("Should not have any active requests", 0, requests.size());

    Collection<ActionItem> actionItems = KEWServiceLocator.getActionListService().findByDocumentId(document.getDocumentId());
    assertEquals("Should not have any action items", 0, actionItems.size());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:RecallActionTest.java

示例2: testRecallAsInitiatorAfterSingleApproval

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testRecallAsInitiatorAfterSingleApproval() throws Exception {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(EWESTFAL, RECALL_TEST_DOC);
    document.route("");

    document = WorkflowDocumentFactory.loadDocument(JHOPF, document.getDocumentId());
    document.approve("");

    document = WorkflowDocumentFactory.loadDocument(EWESTFAL, document.getDocumentId());
    document.recall("recalling", true);

    assertTrue("Document should be recalled", document.isRecalled());
    assertAfterActionTakenCalled(ActionType.RECALL, ActionType.RECALL);

    //verify that the document is truly dead - no more action requests or action items.

    List requests = KEWServiceLocator.getActionRequestService().findPendingByDoc(document.getDocumentId());
    assertEquals("Should not have any active requests", 0, requests.size());

    Collection<ActionItem> actionItems = KEWServiceLocator.getActionListService().findByDocumentId(document.getDocumentId());
    assertEquals("Should not have any action items", 0, actionItems.size());

    // can't recall recalled doc
    assertFalse(document.getValidActions().getValidActions().contains(ActionType.RECALL));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:RecallActionTest.java

示例3: testRecallToActionListAsInitiatorBeforeAnyApprovals

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testRecallToActionListAsInitiatorBeforeAnyApprovals() throws Exception {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(EWESTFAL, RECALL_TEST_DOC);
    document.route("");

    document.recall("recalling", false);

    assertTrue("Document should be saved", document.isSaved());
    assertEquals(1, document.getCurrentNodeNames().size());
    assertTrue(document.getCurrentNodeNames().contains("AdHoc"));
    assertAfterActionTakenCalled(ActionType.RECALL, ActionType.COMPLETE);

    // initiator has completion request
    assertTrue(document.isCompletionRequested());
    // can't recall saved doc
    assertFalse(document.getValidActions().getValidActions().contains(ActionType.RECALL));

    // first approver has FYI
    assertTrue(WorkflowDocumentFactory.loadDocument(JHOPF, document.getDocumentId()).isFYIRequested());

    document.complete("completing");

    assertTrue("Document should be enroute", document.isEnroute());

    assertTrue(WorkflowDocumentFactory.loadDocument(JHOPF, document.getDocumentId()).isApprovalRequested());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:RecallActionTest.java

示例4: recall

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Override
public void recall(WorkflowDocument workflowDocument, String annotation, boolean cancel) throws WorkflowException {
    if (LOG.isDebugEnabled()) {
        LOG.debug("recalling document(" + workflowDocument.getDocumentId() + ",'" + annotation + "', '" + cancel + "')");
    }

    workflowDocument.recall(annotation, cancel);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:WorkflowDocumentServiceImpl.java

示例5: testRecallValidActionsTaken

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testRecallValidActionsTaken() throws Exception {
    // just complete
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(EWESTFAL, RECALL_TEST_RESTRICTED_DOC);
    document.route("routing");
    document.recall("recalling", true);

    // save and complete
    document = WorkflowDocumentFactory.createDocument(EWESTFAL, RECALL_TEST_RESTRICTED_DOC);
    document.saveDocument("saving");
    document.route("routing");
    document.recall("recalling", true);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:RecallActionTest.java

示例6: testRecallInvalidActionsTaken

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test
public void testRecallInvalidActionsTaken() throws Exception {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(EWESTFAL, RECALL_TEST_RESTRICTED_DOC);
    document.route("");

    document = WorkflowDocumentFactory.loadDocument(JHOPF, document.getDocumentId());
    document.approve("");

    try {
        document.recall("recalling", true);
        fail("Recall should NOT have succeeded.  Expected InvalidActionTakenException due to invalid 'APROVE' prior action taken.");
    } catch (InvalidActionTakenException iate) {
        assertTrue(iate.getMessage().contains("Invalid prior action taken: 'APPROVE'"));
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:RecallActionTest.java

示例7: testRecallOnlyAdhocRouting

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testRecallOnlyAdhocRouting() throws Exception {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(EWESTFAL, RECALL_TEST_ONLYADHOC_DOC);
    // adhoc it to someone to prevent doc from going final - final is itself an invalid state for recall
    document.adHocToPrincipal(ActionRequestType.APPROVE, "adhoc approve to JHOPF", JHOPF, "adhocing to prevent finalization", true);
    document.route("routing");
    try {
        document.recall("recalling", true);
        fail("Recall should NOT have succeeded.  Expected InvalidActionTakenException due to absence of non-adhoc route nodes.");
    } catch (InvalidActionTakenException iate) {
        assertTrue(iate.getMessage().contains("No non-adhoc route nodes defined"));
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:RecallActionTest.java

示例8: testRecallDoesNotRecallDocumentWhenProcessed

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test
public void testRecallDoesNotRecallDocumentWhenProcessed() throws Exception {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(EWESTFAL, RECALL_TEST_DOC);
    document.route("");

    for (String user: new String[] { JHOPF, EWESTFAL, RKIRKEND, NATJOHNS, BMCGOUGH }) {
        document = WorkflowDocumentFactory.loadDocument(user, document.getDocumentId());
        document.approve("");
    }

    document.refresh();
    assertTrue("Document should be processed", document.isProcessed());
    assertTrue("Document should be approved", document.isApproved());
    assertFalse("Document should not be final", document.isFinal());

    document = WorkflowDocumentFactory.loadDocument(EWESTFAL, document.getDocumentId());
    document.recall("recalling when processed should not recall the document", true);

    Map<String, List<ErrorMessage>> errorMessages =  GlobalVariables.getMessageMap().getErrorMessages();
    assertTrue(errorMessages.size() == 1);
    for (Map.Entry<String, List<ErrorMessage>> errorMessage : errorMessages.entrySet()) {
        assertTrue(errorMessage.getValue().get(0).getErrorKey().equals(RiceKeyConstants.MESSAGE_RECALL_NOT_SUPPORTED));
    }

    // Verify the document status is still PROCESSED
    assertTrue("Document should be processed", document.isProcessed());
    assertTrue("Document should be approved", document.isApproved());
    assertFalse("Document should not be final", document.isFinal());

    GlobalVariables.getMessageMap().clearErrorMessages();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:32,代码来源:RecallActionTest.java

示例9: testCantRecallUnroutedDoc

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test(expected=InvalidActionTakenException.class) public void testCantRecallUnroutedDoc() {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(EWESTFAL, RECALL_TEST_DOC);
    document.recall("recalling", true);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:5,代码来源:RecallActionTest.java

示例10: testRecallDoesNotRecallDocumentWhenFinal

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test
public void testRecallDoesNotRecallDocumentWhenFinal() throws Exception {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(EWESTFAL, RECALL_TEST_DOC);
    document.route("");

    for (String user: new String[] { JHOPF, EWESTFAL, RKIRKEND, NATJOHNS, BMCGOUGH }) {
        document = WorkflowDocumentFactory.loadDocument(user, document.getDocumentId());
        document.approve("");
    }
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("xqi"), document.getDocumentId());
    document.acknowledge("");

    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("jthomas"), document.getDocumentId());
    document.fyi();

    for (ActionRequest a: document.getRootActionRequests()) {
        System.err.println(a);
        if (a.isAcknowledgeRequest() || a.isFyiRequest()) {
            System.err.println(a.getPrincipalId());
            System.err.println(KimApiServiceLocator.getIdentityService().getPrincipal(a.getPrincipalId()).getPrincipalName());
        }
    }

    assertFalse("Document should not be processed", document.isProcessed());
    assertTrue("Document should be approved", document.isApproved());
    assertTrue("Document should be final", document.isFinal());

    document = WorkflowDocumentFactory.loadDocument(EWESTFAL, document.getDocumentId());
    document.recall("recalling when final should not recall the document", true);

    Map<String, List<ErrorMessage>> errorMessages =  GlobalVariables.getMessageMap().getErrorMessages();
    assertTrue(errorMessages.size() == 1);
    for (Map.Entry<String, List<ErrorMessage>> errorMessage : errorMessages.entrySet()) {
        assertTrue(errorMessage.getValue().get(0).getErrorKey().equals(RiceKeyConstants.MESSAGE_RECALL_NOT_SUPPORTED));
    }

    // Verify the document status is still FINAL
    assertFalse("Document should not be processed", document.isProcessed());
    assertTrue("Document should be approved", document.isApproved());
    assertTrue("Document should be final", document.isFinal());

    GlobalVariables.getMessageMap().clearErrorMessages();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:44,代码来源:RecallActionTest.java


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