本文整理汇总了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());
}
示例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");
}