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


Java WorkflowDocument.setReceiveFutureRequests方法代码示例

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


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

示例1: testFutureRequestsWithRouting

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * Tests future requests work with routing and force action rules
 *
 * @throws Exception
 */
@Test
public void testFutureRequestsWithRouting() throws Exception {
    this.loadXmlFile(this.getClass(), "FutureRequestsConfig.xml");

    String user1PrincipalId = getPrincipalIdForName("user1");
    String user2PrincipalId = getPrincipalIdForName("user2");

    // Node 1 - user1 approval (forceAction true)
    //          user2 approval (forceAction false)
    // Node 2 - NonSIT approval (forceAction false)
    //          user1 approval (forceAction true)
    // Node 3 - user2 approval (forceAction false)
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(user1PrincipalId, "FutureRequestsDoc");
    document.setDoNotReceiveFutureRequests();
    document.route("");

    document = WorkflowDocumentFactory.loadDocument(user1PrincipalId, document.getDocumentId());
    assertFalse(document.isApprovalRequested());

    document = WorkflowDocumentFactory.loadDocument(user2PrincipalId, document.getDocumentId());
    assertTrue(document.isApprovalRequested());
    document.setReceiveFutureRequests();
    document.approve("");

    // should have another request from second rule that is not force action because
    // of policy
    document = WorkflowDocumentFactory.loadDocument(user2PrincipalId, document.getDocumentId());
    assertTrue(document.isApprovalRequested());

    // user2 should have action items. user1 should not
    assertEquals(1, KEWServiceLocator.getActionListService().getActionList(user2PrincipalId, new ActionListFilter()).size());
    assertEquals(1, KEWServiceLocator.getActionListService().getActionList(user1PrincipalId, new ActionListFilter()).size());

    document.approve("");

    // test for request to user2 and not a workgroup
    document = WorkflowDocumentFactory.loadDocument(user2PrincipalId, document.getDocumentId());
    assertTrue(document.isApprovalRequested());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:45,代码来源:FutureRequestsTest.java

示例2: testFutureRequestsWithDuplicateNodesImpl

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
private void testFutureRequestsWithDuplicateNodesImpl(String fileName) throws Exception{    	
	this.loadXmlFile(this.getClass(), fileName);
	

    String user1PrincipalId = getPrincipalIdForName("user1");
    String user2PrincipalId = getPrincipalIdForName("user2");
    String user3PrincipalId = getPrincipalIdForName("earl");

    WorkflowDocument document = WorkflowDocumentFactory.createDocument(user1PrincipalId, "FutureRequestsDoc");
    document.route("");
   

    // Node1
    //user1 should have approval requested
    document = WorkflowDocumentFactory.loadDocument(user3PrincipalId, document.getDocumentId());
    assertTrue("should have approval status", document.isApprovalRequested());

    document.setReceiveFutureRequests();
    
    /*
     *  Uncomment the following line to duplicate the error in KC
     */        
    document.saveDocumentData();
    
    document.approve("route node 1");

    document =WorkflowDocumentFactory.loadDocument(user1PrincipalId, document.getDocumentId());
    assertFalse("should not have approval status 1", document.isApprovalRequested());

    document = WorkflowDocumentFactory.loadDocument(user2PrincipalId, document.getDocumentId());
    assertTrue("should have approval status 2", document.isApprovalRequested());
    document.approve("routing node 2");
    
    // Node3
    //user1 should have approval requested bc of future action requests
    document = WorkflowDocumentFactory.loadDocument(user3PrincipalId, document.getDocumentId());
    assertTrue("should have approval status 3", document.isApprovalRequested());
    document.approve("routing node 3");

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:41,代码来源:FutureRequestsTest.java


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