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