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


Java WorkflowDocument.setDoNotReceiveFutureRequests方法代码示例

本文整理汇总了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());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:45,代码来源:FutureRequestsTest.java

示例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));

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


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