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


Java ProcessResult类代码示例

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


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

示例1: transitionFrom

import org.kuali.rice.kew.engine.node.ProcessResult; //导入依赖的package包/类
public Transition transitionFrom(RouteContext context, ProcessResult processResult) throws Exception {
	RouteNodeInstance processInstance = context.getNodeInstance().getProcess();
       processInstance.setComplete(true);
	SubProcessNode node = (SubProcessNode)getNode(processInstance.getRouteNode(), SubProcessNode.class);
	SubProcessResult result = node.process(context);
	List<RouteNodeInstance> nextNodeInstances = new ArrayList<RouteNodeInstance>();
	if (result.isComplete()) {
		List<RouteNode> nextNodes = processInstance.getRouteNode().getNextNodes();
           for (RouteNode nextNode : nextNodes)
           {
               RouteNodeInstance nextNodeInstance = getRouteHelper().getNodeFactory().createRouteNodeInstance(processInstance.getDocumentId(), nextNode);
               nextNodeInstance.setBranch(processInstance.getBranch());
               nextNodeInstance.setProcess(processInstance.getProcess());
               nextNodeInstances.add(nextNodeInstance);
           }
	}
	return new Transition(nextNodeInstances);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:SubProcessTransitionEngine.java

示例2: invokeTransition

import org.kuali.rice.kew.engine.node.ProcessResult; //导入依赖的package包/类
/**
 * Invokes the transition and returns the next node instances to transition
 * to from the current node instance on the route context.
 *
 * This is a 3-step process:
 *
 * <pre>
 *  1) If the node instance already has next nodes, return those,
 *  2) otherwise, invoke the transition engine for the node, if the resulting node instances are not empty, return those,
 *  3) lastly, if our node is in a process and no next nodes were returned from it's transition engine, invoke the
 *     transition engine of the process node and return the resulting node instances.
 * </pre>
 */
private List<RouteNodeInstance> invokeTransition(RouteContext context, RouteNodeInstance nodeInstance, ProcessResult processResult, TransitionEngine transitionEngine) throws Exception {
	List<RouteNodeInstance> nextNodeInstances = nodeInstance.getNextNodeInstances();
	if (nextNodeInstances.isEmpty()) {
		Transition result = transitionEngine.transitionFrom(context, processResult);
		nextNodeInstances = result.getNextNodeInstances();
		if (nextNodeInstances.isEmpty() && nodeInstance.isInProcess()) {
			transitionEngine = TransitionEngineFactory.createTransitionEngine(nodeInstance.getProcess());
			context.setNodeInstance(nodeInstance);
			nextNodeInstances = invokeTransition(context, nodeInstance.getProcess(), processResult, transitionEngine);
		}
	}
       // if this nodeInstance already has next node instance we can just return them
       return nextNodeInstances;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:StandardWorkflowEngine.java

示例3: invokeTransition

import org.kuali.rice.kew.engine.node.ProcessResult; //导入依赖的package包/类
/**
 * Invokes the transition and returns the next node instances to transition
 * to from the current node instance on the route context.
 *
 * This is a 3-step process:
 *
 * <pre>
 *  1) If the node instance already has next nodes, return those,
 *  2) otherwise, invoke the transition engine for the node, if the resulting node instances are not empty, return those,
 *  3) lastly, if our node is in a process and no next nodes were returned from it's transition engine, invoke the
 *     transition engine of the process node and return the resulting node instances.
 * </pre>
 */
/*
 * private List invokeTransition(RouteContext context, RouteNodeInstance
 * nodeInstance, ProcessResult processResult, TransitionEngine
 * transitionEngine) throws Exception { List nextNodeInstances =
 * nodeInstance.getNextNodeInstances(); if (nextNodeInstances.isEmpty()) {
 * Transition result = transitionEngine.transitionFrom(context,
 * processResult); nextNodeInstances = result.getNextNodeInstances(); if
 * (nextNodeInstances.isEmpty() && nodeInstance.isInProcess()) {
 * transitionEngine =
 * TransitionEngineFactory.createTransitionEngine(nodeInstance.getProcess());
 * nextNodeInstances = invokeTransition(context, nodeInstance.getProcess(),
 * processResult, transitionEngine); } } return nextNodeInstances; }
 */

private List invokeTransition(RouteContext context, RouteNodeInstance nodeInstance, ProcessResult processResult, TransitionEngine transitionEngine) throws Exception {
	List nextNodeInstances = nodeInstance.getNextNodeInstances();
	if (nextNodeInstances.isEmpty()) {
		Transition result = transitionEngine.transitionFrom(context, processResult);
		nextNodeInstances = result.getNextNodeInstances();
		if (nextNodeInstances.isEmpty() && nodeInstance.isInProcess()) {
			transitionEngine = TransitionEngineFactory.createTransitionEngine(nodeInstance.getProcess());
			context.setNodeInstance(nodeInstance);
			nextNodeInstances = invokeTransition(context, nodeInstance.getProcess(), processResult, transitionEngine);
		}
	}
	return nextNodeInstances;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:41,代码来源:StandardWorkflowEngine.java

示例4: isComplete

import org.kuali.rice.kew.engine.node.ProcessResult; //导入依赖的package包/类
public ProcessResult isComplete(RouteContext context) throws Exception {
      RouteNodeInstance nodeInstance = context.getNodeInstance();
      SimpleNode node = (SimpleNode)getNode(nodeInstance.getRouteNode(), SimpleNode.class);
return node.process(context, getRouteHelper());
  }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:6,代码来源:SimpleTransitionEngine.java

示例5: isComplete

import org.kuali.rice.kew.engine.node.ProcessResult; //导入依赖的package包/类
public ProcessResult isComplete(RouteContext context) throws Exception {
      RouteNodeInstance nodeInstance = context.getNodeInstance();
JoinNode node = (JoinNode)getNode(nodeInstance.getRouteNode(), JoinNode.class);
return node.process(context, getRouteHelper());
  }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:6,代码来源:JoinTransitionEngine.java

示例6: isComplete

import org.kuali.rice.kew.engine.node.ProcessResult; //导入依赖的package包/类
public ProcessResult isComplete(RouteContext context) throws Exception {
    throw new UnsupportedOperationException("isComplete() should not be invoked on a SubProcess!");
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:SubProcessTransitionEngine.java

示例7: transitionFrom

import org.kuali.rice.kew.engine.node.ProcessResult; //导入依赖的package包/类
public Transition transitionFrom(RouteContext context, ProcessResult processResult) throws Exception {
    return new Transition(resolveNextNodeInstances(context.getNodeInstance()));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:TransitionEngine.java

示例8: processNodeInstance

import org.kuali.rice.kew.engine.node.ProcessResult; //导入依赖的package包/类
protected ProcessContext processNodeInstance(RouteContext context, RouteHelper helper) throws Exception {
	RouteNodeInstance nodeInstance = context.getNodeInstance();
       // first, let's make sure this node instance is "managed" in our persistence context
       nodeInstance = saveNode(context, nodeInstance);
	if ( LOG.isDebugEnabled() ) {
		LOG.debug("Processing node instance: " + nodeInstance.getRouteNode().getRouteNodeName());
	}
	if (checkAssertions(context)) {
		// returning an empty context causes the outer loop to terminate
		return new ProcessContext();
	}
	TransitionEngine transitionEngine = TransitionEngineFactory.createTransitionEngine(nodeInstance);
	ProcessResult processResult = transitionEngine.isComplete(context);

       // we've executed the node at least once now, if the initial flag has not already been cleared, do so now
       if (nodeInstance.isInitial()) {
           nodeInstance.setInitial(false);
       }

       // if the node is complete, let's transition
	if (processResult.isComplete()) {
		if ( LOG.isDebugEnabled() ) {
			LOG.debug("Routing node has completed: " + nodeInstance.getRouteNode().getRouteNodeName());
		}

           // route node instance id could be null if a flush didn't happen properly, let's verify
           if (nodeInstance.getRouteNodeInstanceId() == null) {
               throw new IllegalStateException("Encountered a node instance in the engine with no id: " + nodeInstance);
           }
		context.getEngineState().getCompleteNodeInstances().add(nodeInstance.getRouteNodeInstanceId());
		List<RouteNodeInstance> nextNodeCandidates =
                   invokeTransition(context, nodeInstance, processResult, transitionEngine);

		// iterate over the next node candidates sending them through the
		// transition engine's transitionTo method
		// one at a time for a potential switch. Place the transition
		// engines result back in the 'actual' next node
		// list which we put in the next node before doing work.
		List<RouteNodeInstance> nodesToActivate = new ArrayList<RouteNodeInstance>();
           if (!nextNodeCandidates.isEmpty()) {
               for (RouteNodeInstance nextNodeInstance : nextNodeCandidates) {
				transitionEngine = TransitionEngineFactory.createTransitionEngine(nextNodeInstance);
				RouteNodeInstance currentNextNodeInstance = nextNodeInstance;
				nextNodeInstance = transitionEngine.transitionTo(nextNodeInstance, context);
				// if the next node has changed, we need to remove our
				// current node as a next node of the original node
				if (!currentNextNodeInstance.equals(nextNodeInstance)) {
                       nodeInstance.getNextNodeInstances().remove(currentNextNodeInstance);
					currentNextNodeInstance.getPreviousNodeInstances().remove(nodeInstance);
				}
                   RouteNodeInstance savedNextNodeInstance = saveNode(context, nextNodeInstance);
                   if (savedNextNodeInstance != nextNodeInstance) {
                       nodeInstance.getNextNodeInstances().remove(nextNodeInstance);
                   }
                   if (!nodeInstance.getNextNodeInstances().contains(savedNextNodeInstance)) {
                       nodeInstance.addNextNodeInstance(savedNextNodeInstance);
                   }
				handleBackwardCompatibility(context, savedNextNodeInstance);
				// call the post processor
				notifyNodeChange(context, savedNextNodeInstance);
				nodesToActivate.add(savedNextNodeInstance);
				}
			}

			// deactive the current active node
		nodeInstance.setComplete(true);
		nodeInstance.setActive(false);
		// active the nodes we're transitioning into
		for (RouteNodeInstance nodeToActivate : nodesToActivate) {
			nodeToActivate.setActive(true);
		}
	} else {
	    nodeInstance.setComplete(false);
       }

	nodeInstance = saveNode(context, nodeInstance);
       // always be sure that we are changes are flushed with the database after every node instance processing
       flushDatabaseWork(context);
	return new ProcessContext(nodeInstance.isComplete(), nodeInstance.getNextNodeInstances());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:81,代码来源:StandardWorkflowEngine.java

示例9: isComplete

import org.kuali.rice.kew.engine.node.ProcessResult; //导入依赖的package包/类
/**
 * Tell the WorkflowEngine processing the activeNodeInstance if the node is complete and transitionFrom can 
 * be called.
 *
 * @return boolean
 * @param context for routing
 * @throws Exception
 */
public abstract ProcessResult isComplete(RouteContext context) throws Exception;
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:TransitionEngine.java


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