Search in sources :

Example 1 with RouteNode

use of org.kuali.kfs.kew.engine.node.RouteNode in project cu-kfs by CU-CommunityApps.

the class DocumentTypeServiceImpl method hasRouteNodeForDocumentTypeId.

@Override
public boolean hasRouteNodeForDocumentTypeId(String routeNodeName, String documentTypeId) throws IllegalArgumentException {
    if (StringUtils.isBlank(routeNodeName)) {
        throw new IllegalArgumentException("routeNodeName was null or blank");
    }
    if (StringUtils.isBlank(documentTypeId)) {
        throw new IllegalArgumentException("documentTypeId was null or blank");
    }
    DocumentType documentType = getDocumentTypeById(documentTypeId);
    if (documentType == null) {
        throw new IllegalArgumentException("Failed to locate a document type for the given id: " + documentTypeId);
    }
    RouteNode routeNode = KEWServiceLocator.getRouteNodeService().findRouteNodeByName(documentType.getId(), routeNodeName);
    if (routeNode == null) {
        if (documentType.getParentId() == null) {
            return false;
        } else {
            return hasRouteNodeForDocumentTypeId(routeNodeName, documentType.getParentId());
        }
    } else {
        return true;
    }
}
Also used : RouteNode(org.kuali.kfs.kew.engine.node.RouteNode) DocumentType(org.kuali.kfs.kew.doctype.bo.DocumentType)

Example 2 with RouteNode

use of org.kuali.kfs.kew.engine.node.RouteNode in project cu-kfs by CU-CommunityApps.

the class DocumentTypeServiceImpl method hasRouteNodeForDocumentTypeName.

@Override
public boolean hasRouteNodeForDocumentTypeName(String routeNodeName, String documentTypeName) throws IllegalArgumentException {
    if (StringUtils.isBlank(routeNodeName)) {
        throw new IllegalArgumentException("routeNodeName was null or blank");
    }
    if (StringUtils.isBlank(documentTypeName)) {
        throw new IllegalArgumentException("documentTypeName was null or blank");
    }
    DocumentType documentType = getDocumentTypeByName(documentTypeName);
    if (documentType == null) {
        throw new IllegalArgumentException("Failed to locate a document type for the given name: " + documentTypeName);
    }
    RouteNode routeNode = KEWServiceLocator.getRouteNodeService().findRouteNodeByName(documentType.getId(), routeNodeName);
    if (routeNode == null) {
        if (documentType.getParentId() == null) {
            return false;
        } else {
            return hasRouteNodeForDocumentTypeId(routeNodeName, documentType.getParentId());
        }
    } else {
        return true;
    }
}
Also used : RouteNode(org.kuali.kfs.kew.engine.node.RouteNode) DocumentType(org.kuali.kfs.kew.doctype.bo.DocumentType)

Aggregations

DocumentType (org.kuali.kfs.kew.doctype.bo.DocumentType)2 RouteNode (org.kuali.kfs.kew.engine.node.RouteNode)2