本文整理汇总了Java中org.kuali.rice.kew.api.WorkflowDocument.setDoNotReceiveFutureRequests方法的典型用法代码示例。如果您正苦于以下问题:Java WorkflowDocument.setDoNotReceiveFutureRequests方法的具体用法?Java WorkflowDocument.setDoNotReceiveFutureRequests怎么用?Java WorkflowDocument.setDoNotReceiveFutureRequests使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kew.api.WorkflowDocument
的用法示例。
在下文中一共展示了WorkflowDocument.setDoNotReceiveFutureRequests方法的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: testFutureRequestsWithRoutingAndWorkflowInfoActionRequestCheck
import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
* Tests future requests operation
*
* @throws Exception
*/
@Test
public void testFutureRequestsWithRoutingAndWorkflowInfoActionRequestCheck() throws Exception {
this.loadXmlFile(this.getClass(), "FutureRequestsConfig.xml");
String user1PrincipalId = getPrincipalIdForName("user1");
String user2PrincipalId = getPrincipalIdForName("user2");
WorkflowDocument document = WorkflowDocumentFactory.createDocument(user1PrincipalId, "FutureRequestsDoc");
document.route("");
// Node1
//user1 should have approval requested
document = WorkflowDocumentFactory.loadDocument(user1PrincipalId, document.getDocumentId());
WorkflowDocumentActionsService actionService = KewApiServiceLocator.getWorkflowDocumentActionsService();
RoutingReportCriteria.Builder reportCriteria = RoutingReportCriteria.Builder.createByDocumentId(document.getDocumentId());
reportCriteria.setTargetPrincipalIds(Collections.singletonList(user1PrincipalId));
String actionToTakeNode = "Node1";
reportCriteria.setActionsToTake(Collections.singletonList(RoutingReportActionToTake.Builder.create(
KewApiConstants.ACTION_TAKEN_APPROVED_CD, user1PrincipalId, actionToTakeNode)));
assertTrue("User " + user1PrincipalId + " should have approval requests on the document",
actionService.documentWillHaveAtLeastOneActionRequest(reportCriteria.build(),
Collections.singletonList(KewApiConstants.ACTION_REQUEST_APPROVE_REQ), false));
reportCriteria = RoutingReportCriteria.Builder.createByDocumentId(document.getDocumentId());
reportCriteria.setTargetPrincipalIds(Collections.singletonList(user1PrincipalId));
actionToTakeNode = "Node1";
reportCriteria.setActionsToTake(Collections.singletonList(RoutingReportActionToTake.Builder.create(KewApiConstants.ACTION_TAKEN_APPROVED_CD, user1PrincipalId, actionToTakeNode)));
DocumentDetail documentVO = KewApiServiceLocator.getWorkflowDocumentActionsService().executeSimulation(reportCriteria.build());
assertTrue("User " + user1PrincipalId + " should have one or more approval requests on the document", documentVO.getActionRequests().size() > 0);
reportCriteria = RoutingReportCriteria.Builder.createByDocumentId(document.getDocumentId());
String delyeaPrincipalId = getPrincipalIdForName("delyea");
reportCriteria.setTargetPrincipalIds(Collections.singletonList(user1PrincipalId));
actionToTakeNode = "Node1";
reportCriteria.setActionsToTake(Collections.singletonList(RoutingReportActionToTake.Builder.create(KewApiConstants.ACTION_TAKEN_APPROVED_CD, user1PrincipalId, actionToTakeNode)));
documentVO = actionService.executeSimulation(reportCriteria.build());
assertTrue("User " + delyeaPrincipalId + " should not have any requests on the document but executeSimulation() method should return all action requests anyway", documentVO.getActionRequests().size() > 0);
document = WorkflowDocumentFactory.createDocument(user1PrincipalId, "FutureRequestsDoc");
document.setDoNotReceiveFutureRequests();
document.route("");
document = WorkflowDocumentFactory.loadDocument(user1PrincipalId, document.getDocumentId());
assertFalse(document.isApprovalRequested());
// user1 should not have approval requested
reportCriteria = RoutingReportCriteria.Builder.createByDocumentId(document.getDocumentId());
reportCriteria.setTargetPrincipalIds(Collections.singletonList(user1PrincipalId));
assertFalse("User " + user1PrincipalId + " should not have any approval request on the document", actionService.documentWillHaveAtLeastOneActionRequest(reportCriteria.build(), Collections.singletonList(KewApiConstants.ACTION_REQUEST_APPROVE_REQ), false));
// user2 should have approval requested
reportCriteria = RoutingReportCriteria.Builder.createByDocumentId(document.getDocumentId());
reportCriteria.setTargetPrincipalIds(Collections.singletonList(user2PrincipalId));
assertTrue("User " + user2PrincipalId + " should have any approval request on the document", actionService.documentWillHaveAtLeastOneActionRequest(reportCriteria.build(), Collections.singletonList(KewApiConstants.ACTION_REQUEST_APPROVE_REQ), false));
}