• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RouteContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: resolveQualifiedRole

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
public ResolvedQualifiedRole resolveQualifiedRole(RouteContext routeContext, String roleName, String qualifiedRole) {
	ResolvedQualifiedRole resolved = new ResolvedQualifiedRole();
	Map qualifiedRoles = (Map)roles.get(roleName);
	if (qualifiedRoles != null) {
		List recipients = (List)qualifiedRoles.get(qualifiedRole);
		if (recipients != null) {
			resolved.setQualifiedRoleLabel(qualifiedRole);
			resolved.setRecipients(recipients);
		} else {
			throw new IllegalArgumentException("TestRuleAttribute does not support the qualified role " + qualifiedRole);
		}
	} else {
		throw new IllegalArgumentException("TestRuleAttribute does not support the given role " + roleName);
	}
	return resolved;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:TestRuleAttributeDuex.java


示例2: saveRoutingData

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
public DocumentRouteHeaderValue saveRoutingData(String principalId, DocumentRouteHeaderValue routeHeader) {
	KEWServiceLocator.getRouteHeaderService().saveRouteHeader(routeHeader);
	
	// save routing data should invoke the post processor doActionTaken for SAVE
	 	ActionTakenValue val = new ActionTakenValue();
	 	val.setActionTaken(KewApiConstants.ACTION_TAKEN_SAVED_CD);
	 	val.setDocumentId(routeHeader.getDocumentId());
       val.setPrincipalId(principalId);
	 	PostProcessor postProcessor = routeHeader.getDocumentType().getPostProcessor();
	 	try {
	 		postProcessor.doActionTaken(new org.kuali.rice.kew.framework.postprocessor.ActionTakenEvent(routeHeader.getDocumentId(), routeHeader.getAppDocId(), ActionTakenValue.to(val)));
	 	} catch (Exception e) {
	 		if (e instanceof RuntimeException) {
	 			throw (RuntimeException)e;
	 		}
	 		throw new WorkflowRuntimeException(e);
	 	}

	 	RouteContext routeContext = RouteContext.getCurrentRouteContext();
	 	if (routeHeader.getDocumentType().hasSearchableAttributes() && !routeContext.isSearchIndexingRequestedForContext()) {
	 		routeContext.requestSearchIndexingForContext();
           DocumentAttributeIndexingQueue queue = KewApiServiceLocator.getDocumentAttributeIndexingQueue(routeHeader.getDocumentType().getApplicationId());
           queue.indexDocument(routeHeader.getDocumentId());
	}
	return finish(routeHeader);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:WorkflowDocumentServiceImpl.java


示例3: resolve

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
public List<Map<String, String>> resolve(RouteContext context) {
		ResolverConfig config = parseResolverConfig();
		Document xmlContent = context.getDocumentContent().getDocument();
		XPath xPath = XPathHelper.newXPath();
		boolean isCompoundMap = config.getExpressionMap().size() > 1;
		try {
			List<Map<String, String>> maps = new ArrayList<Map<String, String>>();
			NodeList baseElements = (NodeList)xPath.evaluate(config.getBaseXPathExpression(), xmlContent, XPathConstants.NODESET);
			if (LOG.isDebugEnabled()) {
				LOG.debug("Found " + baseElements.getLength() + " baseElements to parse for Map<String, String>s using document XML:" + XmlJotter.jotDocument(xmlContent));
			}
			for (int index = 0; index < baseElements.getLength(); index++) {
				Node baseNode = baseElements.item(index);
				if (isCompoundMap) {
					handleCompoundMap(baseNode, maps, config, xPath);
				} else {
					handleSimpleMap(baseNode, maps, config, xPath);
				}
			}
			return maps;
		} catch (XPathExpressionException e) {
			throw new RiceRuntimeException("Encountered an issue executing XPath.", e);
		}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:XPathQualifierResolver.java


示例4: processPotentialActionsTaken

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
private List<ActionTakenValue> processPotentialActionsTaken(RouteContext routeContext, DocumentRouteHeaderValue routeHeader, RouteNodeInstance justProcessedNode, SimulationCriteria criteria) {
    	List<ActionTakenValue> actionsTaken = new ArrayList<ActionTakenValue>();
    	List<ActionRequestValue> requestsToCheck = new ArrayList<ActionRequestValue>();
    	requestsToCheck.addAll(routeContext.getEngineState().getGeneratedRequests());
        requestsToCheck.addAll(routeHeader.getActionRequests());
    	List<ActionRequestValue> pendingActionRequestValues = getCriteriaActionsToDoByNodeName(requestsToCheck, justProcessedNode.getName());
        List<ActionTakenValue> actionsToTakeForNode = generateActionsToTakeForNode(justProcessedNode.getName(), routeHeader, criteria, pendingActionRequestValues);

        for (ActionTakenValue actionTaken : actionsToTakeForNode)
        {
            KEWServiceLocator.getActionRequestService().deactivateRequests(actionTaken, pendingActionRequestValues, routeContext.getActivationContext());
            actionsTaken.add(actionTaken);
//            routeContext.getActivationContext().getSimulatedActionsTaken().add(actionTaken);
        }
    	return actionsTaken;
    }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:SimulationEngine.java


示例5: saveNode

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
private RouteNodeInstance saveNode(RouteContext context, RouteNodeInstance nodeInstance) {
    if (!context.isSimulation()) {
        return KEWServiceLocator.getRouteNodeService().save(nodeInstance);
    } else {
        // if we are in simulation mode, lets go ahead and assign some id
        // values to our beans
        for (RouteNodeInstance routeNodeInstance : nodeInstance.getNextNodeInstances()) {
            if (routeNodeInstance.getRouteNodeInstanceId() == null) {
                routeNodeInstance.setRouteNodeInstanceId(context.getEngineState().getNextSimulationId());
            }
        }
        if (nodeInstance.getProcess() != null && nodeInstance.getProcess().getRouteNodeInstanceId() == null) {
            nodeInstance.getProcess().setRouteNodeInstanceId(context.getEngineState().getNextSimulationId());
        }
        if (nodeInstance.getBranch() != null && nodeInstance.getBranch().getBranchId() == null) {
            nodeInstance.getBranch().setBranchId(context.getEngineState().getNextSimulationId());
        }
        return nodeInstance;
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:BasicJoinEngine.java


示例6: transitionTo

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
public RouteNodeInstance transitionTo(RouteNodeInstance dynamicNodeInstance, RouteContext context) throws Exception {
    dynamicNodeInstance.setInitial(false);
    dynamicNodeInstance.setActive(false);
    DynamicNode dynamicNode = (DynamicNode) getNode(dynamicNodeInstance.getRouteNode(), DynamicNode.class);
    DynamicResult result = dynamicNode.transitioningInto(context, dynamicNodeInstance, getRouteHelper());
    RouteNodeInstance nextNodeInstance = result.getNextNodeInstance();
    RouteNodeInstance finalNodeInstance = null;
    if (result.isComplete()) {
        dynamicNodeInstance.setComplete(true);
        finalNodeInstance = getFinalNodeInstance(dynamicNodeInstance, context); 
        if (nextNodeInstance == null) {
            nextNodeInstance = finalNodeInstance;
        }
    }
  
    if (nextNodeInstance !=null) {
        initializeNodeGraph(context, dynamicNodeInstance, nextNodeInstance, new HashSet<RouteNodeInstance>(), finalNodeInstance);
    }
    return nextNodeInstance;   
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:DynamicTransitionEngine.java


示例7: resolve

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
/**
 * Given the RouteContext, determines the document type of the document being routed and the current
 * route nodes; generates a List of qualifier Map<String, String>s based on the the contents of the document.
 * @see org.kuali.rice.kew.role.QualifierResolver#resolve(org.kuali.rice.kew.engine.RouteContext)
 */
public List<Map<String, String>> resolve(RouteContext context) {
    final String routeLevel = context.getNodeInstance().getName();
    final DocumentEntry documentEntry = getDocumentEntry(context);
    final RoutingTypeDefinition routingTypeDefinition = getWorkflowAttributeDefintion(documentEntry, routeLevel);
    final Document document = getDocument(context);
    List<Map<String, String>> qualifiers = null;
    
    if (document != null && routingTypeDefinition != null) {
        qualifiers = KNSServiceLocator.getWorkflowAttributePropertyResolutionService().resolveRoutingTypeQualifiers(document, routingTypeDefinition);
    } else {
        qualifiers = new ArrayList<Map<String, String>>();
        Map<String, String> basicQualifier = new HashMap<String, String>();
        qualifiers.add(basicQualifier);
    }
    decorateWithCommonQualifiers(qualifiers, document, documentEntry, routeLevel);
    return qualifiers;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:DataDictionaryQualifierResolver.java


示例8: process

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
public SimpleResult process(RouteContext context, RouteHelper helper) throws Exception {
   	if (context.isSimulation()) {
           if (!context.getActivationContext().isActivateRequests()) {
           	return new SimpleResult(true);
           }
       } 
loadConfiguration(context);
Document document = generateXmlInput(context);
if (LOG.isDebugEnabled()) {
    LOG.debug("XML input for email tranformation:\n" + XmlJotter.jotNode(document));
}
Templates style = loadStyleSheet(styleName);
EmailContent emailContent = emailStyleHelper.generateEmailContent(style, document);
if (!StringUtils.isBlank(to)) {
	CoreApiServiceLocator.getMailer().sendEmail(new EmailFrom(from), new EmailTo(to), new EmailSubject(emailContent.getSubject()), new EmailBody(emailContent.getBody()), emailContent.isHtml());
}
return new SimpleResult(true);
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:EmailNode.java


示例9: process

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
@Override
public SimpleResult process(RouteContext routeContext, RouteHelper routeHelper) throws Exception {
    DocumentRouteHeaderValue document = routeContext.getDocument();
    RouteNodeInstance nodeInstance = routeContext.getNodeInstance();
    if (routeContext.isSimulation()) {
        if (routeContext.getActivationContext().isActivateRequests()) {
            activateRequests(routeContext, document, nodeInstance);
        }
        return new SimpleResult(true);
    } else if (!activateRequests(routeContext, document, nodeInstance) && shouldTransition(document,
            nodeInstance)) {
        return new SimpleResult(true);
    } else {
        return new SimpleResult(false);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:RequestActivationNode.java


示例10: testResolve_simpleMap_noBaseXPath

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
@Test
public void testResolve_simpleMap_noBaseXPath() throws Exception {
       /** Build a set of configs to check, we have 2 currently
        *  1 - using 'attributes' xml element
        *  2 - using 'qualifier' xml element ("legacy")
        *  We need to validate BOTH configurations are supported and interpreted correctly.
        *  https://jira.kuali.org/browse/KULRICE-7044
        * */
       Set<String> configStrings = new HashSet<String>();
       configStrings.add(SIMPLE_CONFIG_2);
       configStrings.add(StringUtils.replace(SIMPLE_CONFIG_2, "attributes", "qualifier"));

       for (String currentTestConfig : configStrings){
           XPathQualifierResolver resolver = new XPathQualifierResolver();
           ExtensionDefinition.Builder extensionDefinition = ExtensionDefinition.Builder.create("fakeName", "fakeType", "fakeResourceDescriptor");
           extensionDefinition.setConfiguration(Collections.singletonMap(KewApiConstants.ATTRIBUTE_XML_CONFIG_DATA, currentTestConfig));
           resolver.setExtensionDefinition(extensionDefinition.build());

           RouteContext context = new RouteContext();
           DocumentContent docContent = new StandardDocumentContent(SIMPLE_DOC_XML_1);
           context.setDocumentContent(docContent);

           List<Map<String, String>> maps = resolver.resolve(context);
           verifyAccountmaps(maps);
       }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:XPathQualifierResolverTest.java


示例11: activateRequest

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
protected boolean activateRequest(RouteContext context, ActionRequestValue actionRequest,
        RouteNodeInstance nodeInstance, List<ActionItem> generatedActionItems) {
    if (actionRequest.isRoleRequest()) {
        List<ActionRequestValue> actionRequests =
                KEWServiceLocator.getActionRequestService().findPendingRootRequestsByDocIdAtRouteNode(
                        actionRequest.getDocumentId(), nodeInstance.getRouteNodeInstanceId());
        for (ActionRequestValue siblingRequest : actionRequests) {
            if (actionRequest.getRoleName().equals(siblingRequest.getRoleName())) {
                KEWServiceLocator.getActionRequestService().activateRequestNoNotification(siblingRequest,
                        context.getActivationContext());
                // the generated action items can be found in the activation context
                generatedActionItems.addAll(context.getActivationContext().getGeneratedActionItems());
            }
        }
    }
    actionRequest = KEWServiceLocator.getActionRequestService().activateRequestNoNotification(actionRequest,
            context.getActivationContext());
    // the generated action items can be found in the activation context
    generatedActionItems.addAll(context.getActivationContext().getGeneratedActionItems());
    return actionRequest.isApproveOrCompleteRequest() && !actionRequest.isDone();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:RequestActivationNode.java


示例12: generateXmlInput

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
protected Document generateXmlInput(RouteContext context) throws Exception {
DocumentBuilder db = getDocumentBuilder(true);
       Document doc = db.newDocument();
       Element emailNodeElem = doc.createElement("emailNode");
       doc.appendChild(emailNodeElem);
       String principalId = null;  // Added to the convertRouteHeader is not ambigious.
       org.kuali.rice.kew.api.document.Document routeHeaderVO = DocumentRouteHeaderValue.to(context.getDocument());
       RouteNodeInstance routeNodeInstanceVO = org.kuali.rice.kew.engine.node.RouteNodeInstance.to(context.getNodeInstance());
       Document documentContent = context.getDocumentContent().getDocument();
       XStream xstream = new XStream();
       Element docElem = XmlHelper.readXml(xstream.toXML(routeHeaderVO)).getDocumentElement();
       Element nodeElem = XmlHelper.readXml(xstream.toXML(routeNodeInstanceVO)).getDocumentElement();
       emailNodeElem.appendChild(doc.importNode(docElem, true));
       emailNodeElem.appendChild(doc.importNode(nodeElem, true));
       emailNodeElem.appendChild(doc.importNode(documentContent.getDocumentElement(), true));
       Element dConElem = context.getDocumentContent().getApplicationContent();//Add document Content element for
	 	emailNodeElem.appendChild(doc.importNode(dConElem, true));//access by the stylesheet when creating the email
       return doc;
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:EmailNode.java


示例13: resolveQualifiedRole

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
public ResolvedQualifiedRole resolveQualifiedRole(RouteContext routeContext, String roleName, String qualifiedRole) {
	ResolvedQualifiedRole resolved = new ResolvedQualifiedRole();
	Map<String, List<String>> qualifiedRoles = (Map<String, List<String>>)roles.get(roleName);
	if (qualifiedRoles != null) {
		List<String> recipients = (List<String>)qualifiedRoles.get(qualifiedRole);
		if (recipients != null) {
			resolved.setQualifiedRoleLabel(qualifiedRole);
			resolved.setRecipients(convertPrincipalIdList(recipients));
		} else {
			throw new IllegalArgumentException("TestRuleAttribute does not support the qualified role " + qualifiedRole);
		}
	} else {
		throw new IllegalArgumentException("TestRuleAttribute does not support the given role " + roleName);
	}
	return resolved;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:TestRuleAttribute.java


示例14: getNewlyAddedOrgRouteInstances

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
/**
 * Check the xml and determine there are any orgs declared that we will not travel through on our current trajectory.
 * @param context
 * @param helper
 * @return RouteNodeInstances for any orgs we would not have traveled through that are now in the xml.
 * @throws Exception
 */
private List<RouteNodeInstance> getNewlyAddedOrgRouteInstances(HierarchyProvider provider, RouteContext context, RouteHelper helper) throws Exception {
    RouteNodeInstance processInstance = context.getNodeInstance().getProcess();
    RouteNodeInstance chartOrgNode = context.getNodeInstance();
    //check for new stops in the xml
    List<Stop> stops = provider.getLeafStops(context);
    List<RouteNodeInstance> newStopsRoutingTo = new ArrayList<RouteNodeInstance>();
    for (Stop stop: stops) {
        if (isNewStop(provider, stop, processInstance)) {
            //the idea here is to always use the object referenced by the engine so simulation can occur
            List<RouteNodeInstance> processNodes = chartOrgNode.getPreviousNodeInstances();
            for (RouteNodeInstance splitNodeInstance: processNodes) {
                if (isInitialSplitNode(splitNodeInstance)) {                        
                    RouteNode requestsNode = getStopRequestNode(stop, context.getDocument().getDocumentType());
                    RouteNodeInstance newOrgRequestNode = createInitialRequestNodeInstance(provider, stop, splitNodeInstance, processInstance, requestsNode);
                    newStopsRoutingTo.add(newOrgRequestNode);
                }
            }
        }
    }
    return newStopsRoutingTo;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:HierarchyRoutingNode.java


示例15: applyPoliciesOnExit

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
/**
 * Applies policies that should get checked prior to transitioning out of this node.  The default implementation of
 * this method checks the "mandatory" policy.
 *
 * @param requestsGenerated the requests generated on the current iteration of the route module
 * @param routeContext the current route context
 */
protected void applyPoliciesOnExit(List<ActionRequestValue> requestsGenerated, RouteContext routeContext) {
    DocumentRouteHeaderValue document = routeContext.getDocument();
    RouteNodeInstance nodeInstance = routeContext.getNodeInstance();
    RouteNode node = nodeInstance.getRouteNode();
    // for mandatory routes, requests must be generated
    if (node.isMandatory() && !isSuppressingPolicyErrors(routeContext) && CollectionUtils.isEmpty(requestsGenerated)) {
        List<ActionRequestValue> actionRequests = KEWServiceLocator.getActionRequestService().findRootRequestsByDocIdAtRouteNode(document.getDocumentId(), nodeInstance.getRouteNodeInstanceId());
        if (actionRequests.isEmpty()) {
            LOG.warn("no requests generated for mandatory route - " + node.getRouteNodeName());
            throw new RouteManagerException(
                "No requests generated for mandatory route " + node.getRouteNodeName() + ":" + node
                        .getRouteMethodName(), routeContext);
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:RequestsNode.java


示例16: queueDeferredWork

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
protected void queueDeferredWork(ActionTakenValue actionTaken) {
    try {
    	final boolean shouldIndex = getRouteHeader().getDocumentType().hasSearchableAttributes() && RouteContext.getCurrentRouteContext().isSearchIndexingRequestedForContext();

        String applicationId = routeHeader.getDocumentType().getApplicationId();
        DocumentOrchestrationQueue blanketApprove = KewApiServiceLocator.getDocumentOrchestrationQueue(
                routeHeader.getDocumentId(), applicationId);
        org.kuali.rice.kew.api.document.OrchestrationConfig orchestrationConfig =
                org.kuali.rice.kew.api.document.OrchestrationConfig.create(actionTaken.getActionTakenId(), nodeNames);
        DocumentProcessingOptions options = DocumentProcessingOptions.create(true, shouldIndex);
        blanketApprove.orchestrateDocument(routeHeader.getDocumentId(), getPrincipal().getPrincipalId(),
                orchestrationConfig, options);
    } catch (Exception e) {
        LOG.error(e);
        throw new WorkflowRuntimeException(e);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:BlanketApproveAction.java


示例17: selectRules

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
public List<Rule> selectRules(RouteContext context, DocumentRouteHeaderValue routeHeader,
        RouteNodeInstance nodeInstance, String selectionCriterion, Timestamp effectiveDate) {

    String ruleName = getName(context, routeHeader, nodeInstance, selectionCriterion, effectiveDate);

    if (ruleName == null) {
        throw new RiceIllegalStateException("No 'ruleName' configuration parameter present on route node definition: " + nodeInstance.getRouteNode());
    }

    org.kuali.rice.kew.api.rule.Rule ruleDef = KewApiServiceLocator.getRuleService().getRuleByName(ruleName);
    if (ruleDef == null) {
        throw new RiceIllegalStateException("No rule found with name '" + ruleName + "'");
    }

    List<Rule> rules = new ArrayList<Rule>(1);
    rules.add(new RuleImpl(ruleDef));
    return rules;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:NamedRuleSelector.java


示例18: resolveQualifiedRole

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
public ResolvedQualifiedRole resolveQualifiedRole(RouteContext routeContext, String roleName, String qualifiedRole) {
	List userIds = new ArrayList();
	if (MAIN_ROLE.equals(roleName)) {
		userIds = MAIN_USERS;
	} else if (PRIMARY_DELEGATE_ROLE.equals(roleName)) {
		userIds = new ArrayList((List)PRIMARY_DELEGATES.get(qualifiedRole));
	} else if (SECONDARY_DELEGATE_ROLE.equals(roleName)) {
		userIds = new ArrayList((List)SECONDARY_DELEGATES.get(qualifiedRole));
	} else {
		throw new IllegalArgumentException("Can't resolve qualified role for role '" + roleName +"'");
	}
	List recipients = new ArrayList();
	for (Iterator iterator = userIds.iterator(); iterator.hasNext();) {
		String networkId = (String) iterator.next();
		recipients.add(new PrincipalName(networkId));
	}
	return new ResolvedQualifiedRole(roleName, recipients);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:RoleToRoleDelegationRole.java


示例19: load

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
public Object load(Property property, final RouteContext context) {
    XPath xpath = XPathHelper.newXPath();
    final BranchService branchService = KEWServiceLocator.getBranchService();
    xpath.setXPathVariableResolver(new XPathVariableResolver() {
        public Object resolveVariable(QName name) {
            LOG.debug("Resolving XPath variable: " + name);
            String value = branchService.getScopedVariableValue(context.getNodeInstance().getBranch(), BranchState.VARIABLE_PREFIX + name.getLocalPart());
            LOG.debug("Resolved XPath variable " + name + " to " + value);
            return value;
        }
    });
    try {
        String docContent = context.getDocument().getDocContent();
        LOG.debug("Executing xpath expression '" + property.locator + "' in doc '" + docContent + "'");
        return xpath.evaluate(property.locator, new InputSource(new StringReader(docContent)), XPathConstants.STRING);
    } catch (XPathExpressionException xpee) {
        throw new RuntimeException("Error evaluating xpath expression '" + property.locator + "'", xpee);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:XPathScheme.java


示例20: activateRequests

import org.kuali.rice.kew.engine.RouteContext; //导入依赖的package包/类
/**
 * Activates any pending requests and returns whether there are outstanding blocking requests
 * @param context the RouteContext
 * @throws org.kuali.rice.kew.api.exception.WorkflowException if anything goes wrong...
 * @return whether there are outstanding blocking requests
 */
protected boolean activateRequests(RouteContext routeContext) throws WorkflowException {
    DocumentRouteHeaderValue document = routeContext.getDocument();
    RouteNodeInstance nodeInstance = routeContext.getNodeInstance();
    if (routeContext.isSimulation()) {
        // this seems to indicate whether, when we are simulating, to activate requests...
        if (routeContext.getActivationContext().isActivateRequests()) {
            activateRequests(routeContext, document, nodeInstance);
        }
        // if we are in simulation, don't block, just transition out
        return false;
    } else {
        // activate any unactivated pending requests on this node instance
        return activateRequests(routeContext, document, nodeInstance);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:IteratedRequestActivationNode.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SqlConformance类代码示例发布时间:2022-05-22
下一篇:
Java DiagramEditor类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap