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


Java RouteNodeLookupLogic类代码示例

本文整理汇总了Java中org.kuali.rice.kew.api.document.search.RouteNodeLookupLogic的典型用法代码示例。如果您正苦于以下问题:Java RouteNodeLookupLogic类的具体用法?Java RouteNodeLookupLogic怎么用?Java RouteNodeLookupLogic使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RouteNodeLookupLogic类属于org.kuali.rice.kew.api.document.search包,在下文中一共展示了RouteNodeLookupLogic类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runPerformDocumentSearch_RouteNodeSearch

import org.kuali.rice.kew.api.document.search.RouteNodeLookupLogic; //导入依赖的package包/类
private void runPerformDocumentSearch_RouteNodeSearch(String principalId, String routeNodeName, String documentTypeName, int countBeforeNode, int countAtNode, int countAfterNode) throws RemoteException, WorkflowException {

        DocumentSearchCriteria.Builder criteria = DocumentSearchCriteria.Builder.create();
        criteria.setDocumentTypeName(documentTypeName);
        criteria.setRouteNodeName(routeNodeName);
        DocumentSearchResults results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId,
                criteria.build());
        assertEquals("Wrong number of search results when checking docs at default node logic.", countAtNode, results.getSearchResults().size());

        criteria.setRouteNodeLookupLogic(RouteNodeLookupLogic.EXACTLY);
        results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId, criteria.build());
        assertEquals("Wrong number of search results when checking docs at exact node.", countAtNode, results.getSearchResults().size());

        criteria.setRouteNodeLookupLogic(RouteNodeLookupLogic.BEFORE);
        results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId, criteria.build());
        assertEquals("Wrong number of search results when checking docs before node.", countBeforeNode, results.getSearchResults().size());

        criteria.setRouteNodeLookupLogic(RouteNodeLookupLogic.AFTER);
        results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId, criteria.build());
        assertEquals("Wrong number of search results when checking docs after node.", countAfterNode, results.getSearchResults().size());
    }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:WorkflowUtilityTest.java

示例2: getDocRouteNodeSql

import org.kuali.rice.kew.api.document.search.RouteNodeLookupLogic; //导入依赖的package包/类
public String getDocRouteNodeSql(String documentTypeFullName, String routeNodeName, RouteNodeLookupLogic docRouteLevelLogic, String whereClausePredicatePrefix) {
    // -1 is the default 'blank' choice from the route node drop down a number is used because the ojb RouteNode object is used to
    // render the node choices on the form.
    String returnSql = "";
    if (StringUtils.isNotBlank(routeNodeName)) {
        if (docRouteLevelLogic == null) {
            docRouteLevelLogic = RouteNodeLookupLogic.EXACTLY;
        }
        StringBuilder routeNodeCriteria = new StringBuilder("and " + ROUTE_NODE_TABLE + ".NM ");
        if (RouteNodeLookupLogic.EXACTLY == docRouteLevelLogic) {
    		routeNodeCriteria.append("= '" + getDbPlatform().escapeString(routeNodeName) + "' ");
        } else {
            routeNodeCriteria.append("in (");
            // below buffer used to facilitate the addition of the string ", " to separate out route node names
            StringBuilder routeNodeInCriteria = new StringBuilder();
            boolean foundSpecifiedNode = false;
            List<RouteNode> routeNodes = KEWServiceLocator.getRouteNodeService().getFlattenedNodes(getValidDocumentType(documentTypeFullName), true);
            for (RouteNode routeNode : routeNodes) {
                if (routeNodeName.equals(routeNode.getRouteNodeName())) {
                    // current node is specified node so we ignore it outside of the boolean below
                    foundSpecifiedNode = true;
                    continue;
                }
                // below logic should be to add the current node to the criteria if we haven't found the specified node
                // and the logic qualifier is 'route nodes before specified'... or we have found the specified node and
                // the logic qualifier is 'route nodes after specified'
                if ( (!foundSpecifiedNode && RouteNodeLookupLogic.BEFORE == docRouteLevelLogic) ||
                     (foundSpecifiedNode && RouteNodeLookupLogic.AFTER == docRouteLevelLogic) ) {
                    if (routeNodeInCriteria.length() > 0) {
                        routeNodeInCriteria.append(", ");
                    }
                    routeNodeInCriteria.append("'" + routeNode.getRouteNodeName() + "'");
                }
            }
            if (routeNodeInCriteria.length() > 0) {
                routeNodeCriteria.append(routeNodeInCriteria);
            } else {
                routeNodeCriteria.append("''");
            }
            routeNodeCriteria.append(") ");
        }
        returnSql = whereClausePredicatePrefix + "DOC_HDR.DOC_HDR_ID = " + ROUTE_NODE_INST_TABLE + ".DOC_HDR_ID and " + ROUTE_NODE_INST_TABLE + ".RTE_NODE_ID = " + ROUTE_NODE_TABLE + ".RTE_NODE_ID and " + ROUTE_NODE_INST_TABLE + ".ACTV_IND = 1 " + routeNodeCriteria.toString() + " ";
    }
    return returnSql;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:46,代码来源:DocumentSearchGeneratorImpl.java

示例3: RouteNodeLookupLogicValuesFinder

import org.kuali.rice.kew.api.document.search.RouteNodeLookupLogic; //导入依赖的package包/类
public RouteNodeLookupLogicValuesFinder() {
    super(RouteNodeLookupLogic.class);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:RouteNodeLookupLogicValuesFinder.java

示例4: createDocSearchCriteria

import org.kuali.rice.kew.api.document.search.RouteNodeLookupLogic; //导入依赖的package包/类
private DocumentSearchCriteria createDocSearchCriteria(String saveName) {
    DocumentSearchCriteria.Builder builder = DocumentSearchCriteria.Builder.create();
    builder.setApplicationDocumentId(RandomStringUtils.randomAlphanumeric(5));
    builder.setApplicationDocumentStatus(RandomStringUtils.randomAlphanumeric(5));
    builder.setApproverPrincipalName(RandomStringUtils.randomAlphanumeric(5));
    builder.setApproverPrincipalId(RandomStringUtils.randomAlphanumeric(5));
    builder.setDocumentId( RandomStringUtils.randomAlphanumeric(5));
    builder.setDocumentTypeName(RandomStringUtils.randomAlphanumeric(5));
    builder.setDocumentStatusCategories(Arrays.asList(DocumentStatusCategory.PENDING, DocumentStatusCategory.SUCCESSFUL));
    builder.setDocumentStatuses(Arrays.asList(DocumentStatus.ENROUTE, DocumentStatus.INITIATED, DocumentStatus.SAVED));
    builder.setInitiatorPrincipalName(RandomStringUtils.randomAlphanumeric(10));
    builder.setInitiatorPrincipalId(RandomStringUtils.randomAlphanumeric(10));
    builder.setMaxResults(500);
    builder.setRouteNodeName(RandomStringUtils.randomAlphanumeric(5));
    builder.setSaveName(saveName);
    builder.setStartAtIndex(1);
    builder.setTitle(RandomStringUtils.randomAlphanumeric(10));
    builder.setGroupViewerId(RandomStringUtils.randomAlphanumeric(5));
    builder.setViewerPrincipalName(RandomStringUtils.randomAlphanumeric(10));
    builder.setViewerPrincipalId(RandomStringUtils.randomAlphanumeric(10));
    builder.setRouteNodeLookupLogic(RouteNodeLookupLogic.EXACTLY);

    builder.setDateApplicationDocumentStatusChangedFrom(new DateTime());
    builder.setDateApplicationDocumentStatusChangedTo(new DateTime());
    builder.setDateApprovedFrom(new DateTime());
    builder.setDateApprovedTo(new DateTime());
    builder.setDateCreatedFrom(new DateTime());
    builder.setDateCreatedTo(new DateTime());
    builder.setDateFinalizedFrom(new DateTime());
    builder.setDateFinalizedTo(new DateTime());
    builder.setDateLastModifiedFrom(new DateTime());
    builder.setDateLastModifiedTo(new DateTime());

    Map<String, List<String>> attrs = new HashMap<String, List<String>>();
    for (int i = 1;i<6;i++) {
        ArrayList<String> list = new ArrayList<String>();
        for (int j = 1;j<6;j++) {
            list.add(RandomStringUtils.randomAlphanumeric(5));
        }
        attrs.put(RandomStringUtils.randomAlphanumeric(5), list);
    }
    builder.setDocumentAttributeValues(attrs);

    return builder.build();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:46,代码来源:DocSearchSavingTest.java

示例5: testDocSearch_RouteNodeName

import org.kuali.rice.kew.api.document.search.RouteNodeLookupLogic; //导入依赖的package包/类
@Test public void testDocSearch_RouteNodeName() throws Exception {
    loadXmlFile("DocSearchTest_RouteNode.xml");
    String documentTypeName = "SearchDocType_RouteNodeTest";
    DocumentType docType = ((DocumentTypeService)KEWServiceLocator.getService(KEWServiceLocator.DOCUMENT_TYPE_SERVICE)).findByName(documentTypeName);
    String userNetworkId = "rkirkend";

    // route a document to enroute and route one to final
    WorkflowDocument workflowDocument = WorkflowDocumentFactory.createDocument(getPrincipalId(userNetworkId), documentTypeName);
    workflowDocument.setTitle("Routing style");
    workflowDocument.route("routing this document.");
    // verify the document is enroute for jhopf
    workflowDocument = WorkflowDocumentFactory.loadDocument(getPrincipalId("jhopf"),workflowDocument.getDocumentId());
    assertTrue(workflowDocument.isEnroute());
    assertTrue(workflowDocument.isApprovalRequested());
    workflowDocument.approve("");
    workflowDocument = WorkflowDocumentFactory.loadDocument(getPrincipalId("jhopf"),workflowDocument.getDocumentId());
    assertTrue(workflowDocument.isFinal());
    workflowDocument = WorkflowDocumentFactory.createDocument(getPrincipalId(userNetworkId), documentTypeName);
    workflowDocument.setTitle("Routing style");
    workflowDocument.route("routing this document.");
    // verify the document is enroute for jhopf
    workflowDocument = WorkflowDocumentFactory.loadDocument(getPrincipalId("jhopf"),workflowDocument.getDocumentId());
    assertTrue(workflowDocument.isEnroute());
    assertTrue(workflowDocument.isApprovalRequested());


    Person user = KimApiServiceLocator.getPersonService().getPersonByPrincipalName(userNetworkId);
    DocumentSearchCriteria.Builder criteria = DocumentSearchCriteria.Builder.create();
    criteria.setDocumentTypeName(documentTypeName);
    DocumentSearchResults results = docSearchService.lookupDocuments(user.getPrincipalId(),
            criteria.build());
    assertEquals("Search returned invalid number of documents", 2, results.getSearchResults().size());

    criteria.setRouteNodeName(getRouteNodeForSearch(documentTypeName,workflowDocument.getNodeNames()));
    criteria.setRouteNodeLookupLogic(RouteNodeLookupLogic.EXACTLY);
    results = docSearchService.lookupDocuments(user.getPrincipalId(), criteria.build());
    assertEquals("Search returned invalid number of documents", 1, results.getSearchResults().size());

    // load the document type again to change the route node ids
    loadXmlFile("DocSearchTest_RouteNode.xml");

    workflowDocument = WorkflowDocumentFactory.loadDocument(getPrincipalId("jhopf"),workflowDocument.getDocumentId());
    assertTrue(workflowDocument.isEnroute());
    assertTrue(workflowDocument.isApprovalRequested());
    criteria.setRouteNodeName(getRouteNodeForSearch(documentTypeName, workflowDocument.getNodeNames()));
    results = docSearchService.lookupDocuments(user.getPrincipalId(), criteria.build());
    assertEquals("Search returned invalid number of documents", 1, results.getSearchResults().size());

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


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