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


Java ResourceUnavailableException类代码示例

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


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

示例1: fromClassName

import org.kuali.rice.kew.api.exception.ResourceUnavailableException; //导入依赖的package包/类
public static NodeType fromClassName(String className) throws ResourceUnavailableException {
    //Class typeClass = SpringServiceLocator.getExtensionService().loadClass(className);
    Object typeObject = GlobalResourceLoader.getResourceLoader().getObject(new ObjectDefinition(className));
    if (typeObject == null) {
    	throw new ResourceUnavailableException("Could not locate the node with the given class name '" + className + "'.");
    }
    //Class typeClass = typeObject.getClass();
	// depends upon the proper sorting of typeList
    for (Iterator iterator = typeList.iterator(); iterator.hasNext();) {
        NodeType type = (NodeType) iterator.next();
        //if (type.isAssignableFrom(typeClass)) {
        //if (ClassLoaderUtils.isInstanceOf(typeObject, type))
        if (type.isInstanceOf(typeObject)) {
            return type;
        }
    }
    return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:NodeType.java

示例2: getValidActions

import org.kuali.rice.kew.api.exception.ResourceUnavailableException; //导入依赖的package包/类
public org.kuali.rice.kew.api.action.ValidActions getValidActions(PrincipalContract principal, DocumentRouteHeaderValue document) {
	try {
		org.kuali.rice.kew.api.action.ValidActions.Builder builder = org.kuali.rice.kew.api.action.ValidActions.Builder.create();
		List<ActionRequestValue> activeRequests = new ArrayList<ActionRequestValue>();
        // this looks like ActionRequestServiceImpl.findAllPendingRequests
		for ( ActionRequestValue ar : document.getActionRequests() ) {
			if ( (ar.getCurrentIndicator() != null && ar.getCurrentIndicator()) && StringUtils.equals( ar.getStatus(), ActionRequestStatus.ACTIVATED.getCode() ) ) {
				activeRequests.add(ar);
			}
		}
		for (String actionTakenCode : actionMap.keySet())
		{
			List<DataDefinition> parameters = new ArrayList<DataDefinition>();
			parameters.add(new DataDefinition(document));
			parameters.add(new DataDefinition(principal));
			ActionTakenEvent actionEvent = createAction(actionTakenCode, parameters);
			if (StringUtils.isEmpty(actionEvent.validateActionRules(activeRequests)))
			{
				builder.addValidAction(ActionType.fromCode(actionTakenCode));
			}
		}
		return builder.build();
	} catch (ResourceUnavailableException e) {
		throw new WorkflowRuntimeException(e);
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:ActionRegistryImpl.java

示例3: getCustomActionListAttribute

import org.kuali.rice.kew.api.exception.ResourceUnavailableException; //导入依赖的package包/类
public CustomActionListAttribute getCustomActionListAttribute() throws ResourceUnavailableException {
    CustomActionListAttribute result = null;
    RuleAttribute customActionListRuleAttribute = getCustomActionListRuleAttribute();

    if (customActionListRuleAttribute != null) {
        try {
            ExtensionDefinition extensionDefinition =
                    KewApiServiceLocator.getExtensionRepositoryService().getExtensionById(customActionListRuleAttribute.getId());

            if (extensionDefinition != null) {
                result = ExtensionUtils.loadExtension(extensionDefinition, customActionListRuleAttribute.getApplicationId());
            } else {
                LOG.warn("Could not load ExtensionDefinition for " + customActionListRuleAttribute);
            }

        } catch (RiceRemoteServiceConnectionException e) {
            LOG.warn("Unable to connect to load custom action list attribute for " + customActionListRuleAttribute, e);
        }
    }

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

示例4: findRouteModule

import org.kuali.rice.kew.api.exception.ResourceUnavailableException; //导入依赖的package包/类
public RouteModule findRouteModule(RouteNode node) throws ResourceUnavailableException {
    String routeMethodName = node.getRouteMethodName();
    LOG.debug("Finding route module for routeMethodName="+routeMethodName+" at route level "+node.getRouteNodeName());
    RouteModule routeModule = null;
    // default to FlexRM module if the routeMethodName is null
    if (node.isRulesEngineNode()) {
        routeModule = getRulesEngineRouteModule();
    } else if (node.isPeopleFlowNode()) {
        routeModule = getPeopleFlowRouteModule();
    } else if (routeMethodName == null || node.isFlexRM()) {
        routeModule = getFlexRMRouteModule(routeMethodName);
    } else {
        routeModule = getRouteModule(routeMethodName);
    }
    return routeModule;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:RouteModuleServiceImpl.java

示例5: findActionRequests

import org.kuali.rice.kew.api.exception.ResourceUnavailableException; //导入依赖的package包/类
public List findActionRequests(DocumentRouteHeaderValue routeHeader) throws ResourceUnavailableException, WorkflowException {
    TestRouteLevel routeLevel = TestRouteModuleXMLHelper.parseCurrentRouteLevel(routeHeader);
    List actionRequests = new ArrayList();
    if (routeLevel == null) {
        return actionRequests;
    }
    for (Iterator iterator = routeLevel.getResponsibilities().iterator(); iterator.hasNext();) {
        TestResponsibility responsibility = (TestResponsibility) iterator.next();
        TestRecipient recipient = responsibility.getRecipient();
        Recipient realRecipient = getRealRecipient(recipient);
        ActionRequestFactory arFactory = new ActionRequestFactory(routeHeader);
        String responsibilityId = KEWServiceLocator.getResponsibilityIdService().getNewResponsibilityId();
        ActionRequestValue request = arFactory.addRootActionRequest(responsibility.getActionRequested(), new Integer(responsibility.getPriority()), realRecipient, "", responsibilityId, Boolean.FALSE, null, null);
        responsibilityMap.put(request.getResponsibilityId(), recipient);
        for (Iterator delIt = responsibility.getDelegations().iterator(); delIt.hasNext();) {
            TestDelegation delegation = (TestDelegation) delIt.next();
            TestRecipient delegationRecipient = delegation.getResponsibility().getRecipient();
            Recipient realDelegationRecipient = getRealRecipient(delegationRecipient);
            responsibilityId = KEWServiceLocator.getResponsibilityIdService().getNewResponsibilityId();
            ActionRequestValue delegationRequest = arFactory.addDelegationRequest(request, realDelegationRecipient, responsibilityId, Boolean.FALSE, delegation.getType(), "", null);
            responsibilityMap.put(delegationRequest.getResponsibilityId(), delegationRecipient);
        }
        actionRequests.add(request);
    }
    return actionRequests;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:TestRouteModule.java

示例6: resolveResponsibilityId

import org.kuali.rice.kew.api.exception.ResourceUnavailableException; //导入依赖的package包/类
public ResponsibleParty resolveResponsibilityId(String responsibilityId) throws ResourceUnavailableException, WorkflowException {
    TestRecipient recipient = (TestRecipient)responsibilityMap.get(responsibilityId);
    if (recipient == null) {
        return null;
    }
    ResponsibleParty responsibleParty = new ResponsibleParty();
    if (recipient.getType().equals(RecipientType.PRINCIPAL.getCode())) {
        responsibleParty.setPrincipalId(recipient.getId());
    } else if (recipient.getType().equals(RecipientType.GROUP.getCode())) {
    	responsibleParty.setGroupId(recipient.getId());
    } else if (recipient.getType().equals(RecipientType.ROLE.getCode())) {
        responsibleParty.setRoleName(recipient.getId());
    } else {
        throw new WorkflowException("Invalid recipient type code of '"+recipient.getType()+"' for responsibility id "+responsibilityId);
    }
    return responsibleParty;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:TestRouteModule.java

示例7: isRoleNode

import org.kuali.rice.kew.api.exception.ResourceUnavailableException; //导入依赖的package包/类
public boolean isRoleNode() {
	try {
		return nodeType != null && NodeType.fromNode(this).isTypeOf(NodeType.ROLE);
	} catch( ResourceUnavailableException ex ) {
		Logger.getLogger( RouteNode.class ).info( "isRoleNode(): Unable to determine node type: " + ex.getMessage() );
		return false;
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:RouteNode.java

示例8: createAction

import org.kuali.rice.kew.api.exception.ResourceUnavailableException; //导入依赖的package包/类
public ActionTakenEvent createAction(String actionCode, List<DataDefinition> parameters) throws ResourceUnavailableException {
	String actionClassName = actionMap.get(actionCode);
	if (actionClassName == null) {
		throw new IllegalArgumentException("No action has been registered for the given action code of '" + actionCode + "'.");
	}
	ObjectDefinition actionDefinition = new ObjectDefinition(actionClassName);
	if (parameters != null && !parameters.isEmpty()) {
		actionDefinition.setConstructorParameters(parameters);
	}
	try {
		//ActionTakenEvent actionTaken = (ActionTakenEvent)GlobalResourceLoader.getResourceLoader().getObject(actionDefinition);
		// TODO ActionTakenEvent is not an interface so we can't fetch them through the GlobalResourceLoader, for now, just use
		// the ObjectDefinitionResolver
		ActionTakenEvent actionTaken = (ActionTakenEvent) ObjectDefinitionResolver.createObject(actionDefinition, ClassLoaderUtils.getDefaultClassLoader(), false);
		if (actionTaken == null) {
			// TODO the exception handling here is a bit wonky
			throw new ResourceUnavailableException("Could not locate action taken class '" + actionClassName + "'");
		}
		return actionTaken;
	} catch (Exception e) {
           LOG.debug("createAction() Exception thrown while working with action class name '" + actionClassName + "'");
		if (e instanceof ResourceUnavailableException) {
			throw (ResourceUnavailableException)e;
		}
		throw new ResourceUnavailableException(e);
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:ActionRegistryImpl.java

示例9: isValidAction

import org.kuali.rice.kew.api.exception.ResourceUnavailableException; //导入依赖的package包/类
@Override
public boolean isValidAction(String actionTypeCode, PrincipalContract principal,
        DocumentRouteHeaderValue document) {
    boolean validAction = false;
    try {
        List<ActionRequestValue> activeRequests = new ArrayList<ActionRequestValue>();
        for (ActionRequestValue ar : document.getActionRequests()) {
            if ((ar.getCurrentIndicator() != null && ar.getCurrentIndicator()) && StringUtils.equals(ar.getStatus(),
                    ActionRequestStatus.ACTIVATED.getCode())) {
                activeRequests.add(ar);
            }
        }

        List<DataDefinition> parameters = new ArrayList<DataDefinition>();
        parameters.add(new DataDefinition(document));
        parameters.add(new DataDefinition(principal));

        ActionTakenEvent actionEvent = createAction(actionTypeCode, parameters);
        if (StringUtils.isEmpty(actionEvent.validateActionRules(activeRequests))) {
            validAction = true;
        }
    } catch (ResourceUnavailableException e) {
        throw new WorkflowRuntimeException(e);
    }

    return validAction;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:ActionRegistryImpl.java

示例10: getCustomEmailAttribute

import org.kuali.rice.kew.api.exception.ResourceUnavailableException; //导入依赖的package包/类
public CustomEmailAttribute getCustomEmailAttribute() throws ResourceUnavailableException {
    ObjectDefinition objDef = getAttributeObjectDefinition(KewApiConstants.EMAIL_ATTRIBUTE_TYPE);
    if (objDef == null) {
        return null;
    }
    return (CustomEmailAttribute) GlobalResourceLoader.getObject(objDef);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:DocumentType.java

示例11: getNodeTypeForNode

import org.kuali.rice.kew.api.exception.ResourceUnavailableException; //导入依赖的package包/类
private NodeType getNodeTypeForNode(RouteNode node) {
    NodeType nodeType = null;
    String errorMessage = "Could not determine proper XML element for the given node type: " + node.getNodeType();

    try {
        nodeType = NodeType.fromClassName(node.getNodeType());
    } catch (ResourceUnavailableException e) {
        throw new WorkflowRuntimeException(errorMessage, e);
    }
    if (nodeType == null) {
        throw new WorkflowRuntimeException(errorMessage);
    }
    return nodeType;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:15,代码来源:DocumentTypeXmlExporter.java

示例12: getRouteModule

import org.kuali.rice.kew.api.exception.ResourceUnavailableException; //导入依赖的package包/类
private RouteModule getRouteModule(String routeMethodName) throws ResourceUnavailableException {
    if (routeMethodName == null) {
        return null;
    } else if ("".equals(routeMethodName.trim()) || KewApiConstants.ROUTE_LEVEL_NO_ROUTE_MODULE.equals(routeMethodName)) {
            return null;
    }
    Object routeModule = GlobalResourceLoader.getObject(new ObjectDefinition(routeMethodName));//SpringServiceLocator.getExtensionService().getRouteModule(routeMethodName);
    if (routeModule instanceof RouteModule) {
        return (RouteModule)routeModule;
    }
    throw new WorkflowRuntimeException("Could not locate the Route Module with the given name: " + routeMethodName);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:RouteModuleServiceImpl.java

示例13: fromNode

import org.kuali.rice.kew.api.exception.ResourceUnavailableException; //导入依赖的package包/类
public static NodeType fromNode(RouteNode node) throws ResourceUnavailableException {
    return fromClassName(node.getNodeType());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:NodeType.java

示例14: fromNodeInstance

import org.kuali.rice.kew.api.exception.ResourceUnavailableException; //导入依赖的package包/类
public static NodeType fromNodeInstance(RouteNodeInstance nodeInstance) throws ResourceUnavailableException {
    return fromNode(nodeInstance.getRouteNode());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:NodeType.java


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