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


Java WorkflowDocument.getNodeNames方法代码示例

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


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

示例1: testGetPreviousRouteNodeNames

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testGetPreviousRouteNodeNames() throws Exception {

    	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("rkirkend"), "UnitTestDocument");
        document.route("");

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

        document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("jhopf"), document.getDocumentId());
        List<String> previousNodeNames = document.getPreviousNodeNames();
        assertEquals("Should have 2 previous Node Names", 2, previousNodeNames.size());
        assertEquals("Last node name should be the first visisted", "Initiated", previousNodeNames.get(0));
        assertEquals("First node name should be last node visited", "Template1", previousNodeNames.get(1));
        Set<String> currentNodes = document.getNodeNames();
        assertEquals("Should have 1 current node name", 1, currentNodes.size());
        assertEquals("Current node name incorrect", "Template2", currentNodes.iterator().next());
        document.returnToPreviousNode("", "Template1");
        previousNodeNames = document.getPreviousNodeNames();
        assertEquals("Should have 1 previous Node Name", 1, previousNodeNames.size());
        assertEquals("Previous Node name incorrect", "Initiated", previousNodeNames.get(0));

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

示例2: getCurrentRouteNodeNames

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Override
public String getCurrentRouteNodeNames(WorkflowDocument workflowDocument) {
    Set<String> nodeNames = workflowDocument.getNodeNames();
    if (nodeNames.isEmpty()) {
        return "";
    }
    StringBuilder builder = new StringBuilder();
    for (String nodeName : nodeNames) {
        builder.append(nodeName).append(", ");
    }
    builder.setLength(builder.length() - 2);
    return builder.toString();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:14,代码来源:WorkflowDocumentServiceImpl.java

示例3: isDocumentPostProcessable

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
private boolean isDocumentPostProcessable(WorkflowDocument doc, List<String> validNodeNames) throws WorkflowException {
    Set<String> nodeNames = doc.getNodeNames();
    if (nodeNames != null && nodeNames.size() > 0) {
    	String nodeName = nodeNames.iterator().next();
    	return validNodeNames.contains(nodeName) || (nodeName.equals("AdHoc")) || (nodeName.equals("WorkflowDocument"));
    }
    return false;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:SuperUserActionInvalidPostProcessor.java

示例4: dumpInfoAboutDoc

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
private void dumpInfoAboutDoc(WorkflowDocument doc) throws WorkflowException {
    LOG.info("\tDoc: class=" + doc.getDocumentTypeName() + " title=" + doc.getTitle() + " status=" + doc.getStatus());
    LOG.info("\tActionRequests:");
    for (ActionRequest ar: doc.getRootActionRequests()) {
        LOG.info("\t\tId: " + ar.getId() + " PrincipalId: " + ar.getPrincipalId() + " ActionRequested: " + ar.getActionRequested() + " ActionTaken: " + (ar.getActionTaken() != null ? ar.getActionTaken().getActionTaken() : null) + " NodeName: " + ar.getNodeName() + " Status:" + ar.getStatus());
    }
    LOG.info("\tActionTakens:");
    for (ActionTaken at: doc.getActionsTaken()) {
        LOG.info("\t\tId: " + at.getId() + " PrincipalId: " + at.getPrincipalId() + " ActionTaken: " + at.getActionTaken());
    }
    LOG.info("\tNodeNames:");
    for (String name: doc.getNodeNames()) {
        LOG.info("\t\t" + name);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:VariablesTest.java

示例5: assertAtNode

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
    * Checks that the document is at a node with the given name.  This does not check that the document is at
    * the given node and only the given node, the document can be at other nodes as well and this assertion
    * will still pass.
    */
   public static void assertAtNode(String message, WorkflowDocument document, String nodeNameToAssert) {
	Set<String> nodeNames = document.getNodeNames();
	for (String nodeName : nodeNames) {
		if (nodeNameToAssert.equals(nodeName)) {
			return;
		}
	}
	fail((org.apache.commons.lang.StringUtils.isEmpty(message) ? "" : message + ": ") + "Was [" + StringUtils.join(nodeNames, ", ") + "], Expected " + nodeNameToAssert);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:15,代码来源:TestUtilities.java

示例6: testEmptyParallelBranchesSwitched

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * This runs the test with the adhoc approvers branch second instead of first
 *//*
public void testEmptyParallelBranchesSwitched() throws Exception {
    
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(new NetworkIdVO("ewestfal"), PARALLEL_EMPTY_DOCUMENT_TYPE_2_NAME);
    document.saveDocumentData();
    assertTrue("Document should be initiated", document.isInitiated());
    assertEquals("Should be no action requests.", 0, document.getActionRequests().length);
    assertEquals("Invalid route level.", new Integer(0), document.getRouteHeader().getDocRouteLevel());
    Collection nodeInstances = SpringServiceLocator.getRouteNodeService().getActiveNodeInstances(document.getDocumentId());
    assertEquals("Wrong number of active nodes.", 1, nodeInstances.size());
    document.route("");
    
    // should have generated a request to "bmcgough"
    document = WorkflowDocumentFactory.loadDocument(new NetworkIdVO("bmcgough"), document.getDocumentId());
    assertTrue("Document should be enroute", document.isEnroute());
    List actionRequests = TestUtilities.getActionRequestService().findPendingByDoc(document.getDocumentId());
    assertEquals("Incorrect pending action requests.", 1, actionRequests.size());
    ActionRequestValue bRequest = (ActionRequestValue)actionRequests.get(0);
    assertNotNull("Should have been routed through node instance.", bRequest.getRouteNodeInstance());
    assertTrue(document.isApprovalRequested());
    
    document.approve("");
    
    // now the document should have split, passed through nodes in each branch which didn't generate requests,
    // and then passed the join node and generated requests at WorkflowDocumentFinal
    document = WorkflowDocumentFactory.loadDocument(new NetworkIdVO("xqi"), document.getDocumentId());
    assertTrue("Document should be enroute", document.isEnroute());
    assertTrue(document.isApprovalRequested());
    
}*/

@Test public void testAdhocApproversJoinScenario() throws Exception {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), "AdHocApproversDocType");
    document.route("");
    
    // should send an approve to bmcgough
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("bmcgough"), document.getDocumentId());
    assertTrue("Bmcgough should have approve request.", document.isApprovalRequested());
    document.approve("");
    
    // at this point the document should pass the split, and end up at the WorkflowDocument2 node and the AdHocApproversJoin node
    // after bypassing the AdHocJoinPoint
    Set<String> nodeNames = document.getNodeNames();
    assertEquals("There should be two node names.", 2, nodeNames.size());
    assertTrue("Should be at WorkflowDocument2 node.", nodeNames.contains("WorkflowDocument2"));
    assertTrue("Should be at WorkflowDocument2 node.", nodeNames.contains("AdHocApproversJoin"));
    
    // pmckown has the request at the adhoc approvers node, if we approve as him then the document should _not_ transition out
    // of it's current nodes
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("pmckown"), document.getDocumentId());
    assertTrue("Pmckown should have approve request.", document.isApprovalRequested());
    document.approve("");
    
    // the document should still be at the same nodes
    nodeNames = document.getNodeNames();
    assertEquals("There should be two node names.", 2, nodeNames.size());
    assertTrue("Should be at WorkflowDocument2 node.", nodeNames.contains("WorkflowDocument2"));
    assertTrue("Should be at WorkflowDocument2 node.", nodeNames.contains("AdHocApproversJoin"));

    // at WorkflowDocument2, rkirkend is the approver, if we approve as him we should end up at the WorkflowDocumentFinal node
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId());
    assertTrue("Rkirkend should have approve request.", document.isApprovalRequested());
    document.approve("");
    
    // the document should now be at WorkflowDocumentFinal with a request to xqi
    nodeNames = document.getNodeNames();
    assertEquals("There should be one node name.", 1, nodeNames.size());
    assertTrue("Should be at WorkflowDocumentFinal node.", nodeNames.contains("WorkflowDocumentFinal"));
    
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("xqi"), document.getDocumentId());
    assertTrue("Document should still be enroute.", document.isEnroute());
    document.approve("");
    assertTrue("Document should now be final.", document.isFinal());
    
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:78,代码来源:ParallelRoutingTest.java


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