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


Java RoutingReportActionToTake.Builder方法代码示例

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


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

示例1: runDocumentWillHaveApproveOrCompleteRequestAtNode

import org.kuali.rice.kew.api.action.RoutingReportActionToTake; //导入方法依赖的package包/类
private void runDocumentWillHaveApproveOrCompleteRequestAtNode(String documentType,ReportCriteriaGenerator generator) throws Exception {
      /*
        name="WorkflowDocument"
          -  bmcgough - Approve - false
          -  rkirkend - Approve - false
        name="WorkflowDocument2"
          -  pmckown - Approve - false
        name="Acknowledge1"
          -  temay - Ack - false
        name="Acknowledge2"
          -  jhopf - Ack - false
      */
        WorkflowDocumentActionsService wdas = KewApiServiceLocator.getWorkflowDocumentActionsService();

        WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), documentType);
        RoutingReportCriteria.Builder builder = RoutingReportCriteria.Builder.createByDocumentId(document.getDocumentId());
        builder.setXmlContent(document.getDocumentContent().getApplicationContent());
        builder.setTargetNodeName("WorkflowDocument2");
        builder.setRoutingPrincipalId(getPrincipalIdForName("bmcgough"));
        assertTrue("Document should have one unfulfilled approve/complete request", wdas.documentWillHaveAtLeastOneActionRequest(builder.build(), Arrays.asList(new String[]{KewApiConstants.ACTION_REQUEST_APPROVE_REQ,KewApiConstants.ACTION_REQUEST_COMPLETE_REQ}), false));
        builder.setTargetPrincipalIds(Collections.singletonList(getPrincipalIdForName("bmcgough")));
        assertFalse("Document should not have any unfulfilled approve/complete requests", wdas.documentWillHaveAtLeastOneActionRequest(builder.build(), Arrays.asList(new String[]{KewApiConstants.ACTION_REQUEST_APPROVE_REQ,KewApiConstants.ACTION_REQUEST_COMPLETE_REQ}), false));

        builder = RoutingReportCriteria.Builder.createByDocumentId(document.getDocumentId());
        builder.setXmlContent(document.getDocumentContent().getApplicationContent());
        builder.setTargetNodeName("WorkflowDocument2");
        builder.setRoutingPrincipalId(getPrincipalIdForName("bmcgough"));
        List<RoutingReportActionToTake.Builder> actionsToTake = new ArrayList<RoutingReportActionToTake.Builder>();
//        actionsToTake[0] = new ReportActionToTakeDTO(KewApiConstants.ACTION_TAKEN_APPROVED_CD,getPrincipalIdForName("rkirkend"),"WorkflowDocument");
        actionsToTake.add(RoutingReportActionToTake.Builder.create(KewApiConstants.ACTION_TAKEN_APPROVED_CD,getPrincipalIdForName("pmckown"),"WorkflowDocument2"));
        builder.setActionsToTake(actionsToTake);
        assertFalse("Document should not have any unfulfilled approve/complete requests", wdas.documentWillHaveAtLeastOneActionRequest(builder.build(), Arrays.asList(new String[]{KewApiConstants.ACTION_REQUEST_APPROVE_REQ,KewApiConstants.ACTION_REQUEST_COMPLETE_REQ}), false));

        builder = RoutingReportCriteria.Builder.createByDocumentId(document.getDocumentId());
        builder.setXmlContent(document.getDocumentContent().getApplicationContent());
        builder.setTargetNodeName("WorkflowDocument2");
        actionsToTake = new ArrayList<RoutingReportActionToTake.Builder>();
        actionsToTake.add(RoutingReportActionToTake.Builder.create(KewApiConstants.ACTION_TAKEN_APPROVED_CD,getPrincipalIdForName("bmcgough"),"WorkflowDocument"));
        actionsToTake.add(RoutingReportActionToTake.Builder.create(KewApiConstants.ACTION_TAKEN_APPROVED_CD,getPrincipalIdForName("rkirkend"),"WorkflowDocument"));
        builder.setActionsToTake(actionsToTake);
        builder.setRoutingPrincipalId(getPrincipalIdForName("pmckown"));
        assertFalse("Document should not have any unfulfilled approve/complete requests", wdas.documentWillHaveAtLeastOneActionRequest(builder.build(), Arrays.asList(new String[]{KewApiConstants.ACTION_REQUEST_APPROVE_REQ,KewApiConstants.ACTION_REQUEST_COMPLETE_REQ}), false));

        document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), documentType);
        document.route("");
        assertTrue(document.isEnroute());

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

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

        builder = RoutingReportCriteria.Builder.createByDocumentId(document.getDocumentId());
        builder.setXmlContent(document.getDocumentContent().getApplicationContent());
        builder.setTargetNodeName("WorkflowDocument2");
        assertTrue("Document should have one unfulfilled approve/complete request", wdas.documentWillHaveAtLeastOneActionRequest(builder.build(), Arrays.asList(new String[]{KewApiConstants.ACTION_REQUEST_APPROVE_REQ,KewApiConstants.ACTION_REQUEST_COMPLETE_REQ}), false));

        document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("pmckown"), document.getDocumentId());
        document.approve("");
        assertTrue(document.isProcessed());

        builder = RoutingReportCriteria.Builder.createByDocumentId(document.getDocumentId());
        builder.setXmlContent(document.getDocumentContent().getApplicationContent());
        builder.setTargetNodeName("Acknowledge1");
        assertFalse("Document should not have any unfulfilled approve/complete requests when in processed status", wdas.documentWillHaveAtLeastOneActionRequest(builder.build(), Arrays.asList(new String[]{KewApiConstants.ACTION_REQUEST_APPROVE_REQ,KewApiConstants.ACTION_REQUEST_COMPLETE_REQ}), false));

        builder = RoutingReportCriteria.Builder.createByDocumentId(document.getDocumentId());
        builder.setXmlContent(document.getDocumentContent().getApplicationContent());
        builder.setTargetNodeName("Acknowledge1");
        assertTrue("Document should have one unfulfilled Ack request when in final status", wdas.documentWillHaveAtLeastOneActionRequest(builder.build(), Arrays.asList(new String[]{KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ}), false));
        if (generator.isCriteriaRouteHeaderBased()) {
            assertFalse("Document should have no unfulfilled Ack request generated when in final status", wdas.documentWillHaveAtLeastOneActionRequest(builder.build(), Arrays.asList(new String[]{KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ}), true));
        }

        // if temay acknowledges the document here it will move to processed and no more simulations would need to be tested
        document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("temay"), document.getDocumentId());
        document.acknowledge("");
        assertTrue(document.isProcessed());
    }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:81,代码来源:WorkflowUtilityTest.java


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