本文整理汇总了Java中org.kuali.rice.kew.engine.node.RouteNode类的典型用法代码示例。如果您正苦于以下问题:Java RouteNode类的具体用法?Java RouteNode怎么用?Java RouteNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RouteNode类属于org.kuali.rice.kew.engine.node包,在下文中一共展示了RouteNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRouteNodesByDocumentType
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的package包/类
/**
* Return route nodes based on the document
*
* @param documentType
* @return List
*/
protected List<RouteNode> getRouteNodesByDocumentType(DocumentType documentType, boolean includeBlankNodes) {
List<RouteNode> nodes = KEWServiceLocator.getRouteNodeService().getFlattenedNodes(documentType, true);
// Blank check can be removed if no longer included in RouteNodeService getFlattenedNodes
if(nodes.size() > 0 && !includeBlankNodes) {
List<RouteNode> namedNodes = new ArrayList<RouteNode>();
for (RouteNode node : nodes) {
if (StringUtils.isNotBlank(node.getName())) {
namedNodes.add(node);
}
}
return namedNodes;
}
return nodes;
}
示例2: isNodeNameInPath
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的package包/类
private boolean isNodeNameInPath(String nodeName, RouteNode node, Set<String> inspected) {
boolean isInPath = !inspected.contains(node.getRouteNodeId()) && node.getRouteNodeName().equals(nodeName);
inspected.add(node.getRouteNodeId());
if (helper.isSubProcessNode(node)) {
ProcessDefinitionBo subProcess = node.getDocumentType().getNamedProcess(node.getRouteNodeName());
RouteNode subNode = subProcess.getInitialRouteNode();
if (subNode != null) {
isInPath = isInPath || isNodeNameInPath(nodeName, subNode, inspected);
}
}
for (Iterator<RouteNode> iterator = node.getNextNodes().iterator(); iterator.hasNext();) {
RouteNode nextNode = (RouteNode) iterator.next();
isInPath = isInPath || isNodeNameInPath(nodeName, nextNode, inspected);
}
return isInPath;
}
示例3: createTransitionEngine
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的package包/类
public static TransitionEngine createTransitionEngine(RouteNodeInstance nodeInstance) throws Exception {
RouteHelper helper = new RouteHelper();
RouteNode routeNode = nodeInstance.getRouteNode();
TransitionEngine engine = null;
if (helper.isSimpleNode(routeNode)) {
engine = new SimpleTransitionEngine();
} else if (helper.isSplitNode(routeNode)) {
engine = new SplitTransitionEngine();
} else if (helper.isJoinNode(routeNode)) {
engine = new JoinTransitionEngine();
} else if (helper.isDynamicNode(routeNode)) {
engine = new DynamicTransitionEngine();
} else if (helper.isSubProcessNode(routeNode)) {
engine = new SubProcessTransitionEngine();
} else {
throw new WorkflowException("Could not locate transition engine for node " + routeNode.getNodeType());
}
engine.setRouteHelper(helper);
return engine;
}
示例4: transitionFrom
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的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);
}
示例5: isNodeNameInPath
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的package包/类
private boolean isNodeNameInPath(String nodeName, RouteNode node, Set<String> inspected) throws Exception {
boolean isInPath = !inspected.contains(node.getRouteNodeId()) && node.getRouteNodeName().equals(nodeName);
inspected.add(node.getRouteNodeId());
if (helper.isSubProcessNode(node)) {
ProcessDefinitionBo subProcess = node.getDocumentType().getNamedProcess(node.getRouteNodeName());
RouteNode subNode = subProcess.getInitialRouteNode();
if (subNode != null) {
isInPath = isInPath || isNodeNameInPath(nodeName, subNode, inspected);
}
}
for (RouteNode nextNode : node.getNextNodes())
{
isInPath = isInPath || isNodeNameInPath(nodeName, nextNode, inspected);
}
return isInPath;
}
示例6: getNewlyAddedOrgRouteInstances
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的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;
}
示例7: getSplitNode
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的package包/类
/**
* @param process
* @return Route Node of the JoinNode that will be prototype for the split RouteNodeInstances generated by this component
*/
private static RouteNode getSplitNode(RouteNodeInstance process) {
RouteNode dynamicNode = process.getRouteNode();
RouteNode splitNode = new RouteNode();
splitNode.setActivationType(dynamicNode.getActivationType());
splitNode.setDocumentType(dynamicNode.getDocumentType());
splitNode.setFinalApprovalInd(dynamicNode.getFinalApprovalInd());
splitNode.setExceptionWorkgroupId(dynamicNode.getExceptionWorkgroupId());
splitNode.setMandatoryRouteInd(dynamicNode.getMandatoryRouteInd());
splitNode.setNodeType(SimpleSplitNode.class.getName());
splitNode.setRouteMethodCode("FR");
splitNode.setRouteMethodName(null);
splitNode.setRouteNodeName(SPLIT_PROCESS_NAME);
return splitNode;
//SubRequests
}
示例8: getRequestNode
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的package包/类
/**
* @param process
* @return RouteNode of RequestsNode that will be prototype for RouteNodeInstances having requets that are generated by this component
*/
private RouteNode getRequestNode(HierarchyProvider provider, RouteNodeInstance process) {
RouteNode dynamicNode = process.getRouteNode();
RouteNode requestsNode = new RouteNode();
requestsNode.setActivationType(dynamicNode.getActivationType());
requestsNode.setDocumentType(dynamicNode.getDocumentType());
requestsNode.setFinalApprovalInd(dynamicNode.getFinalApprovalInd());
requestsNode.setExceptionWorkgroupId(dynamicNode.getExceptionWorkgroupId());
requestsNode.setMandatoryRouteInd(dynamicNode.getMandatoryRouteInd());
requestsNode.setNodeType(RequestsNode.class.getName());
requestsNode.setRouteMethodCode("FR");
requestsNode.setRouteMethodName(process.getRouteNode().getRouteMethodName());
requestsNode.setRouteNodeName(REQUEST_PROCESS_NAME);
provider.configureRequestNode(process, requestsNode);
return requestsNode;
}
示例9: testRouteNodeServiceDeleteByRouteNodeInstance
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的package包/类
@Test
public void testRouteNodeServiceDeleteByRouteNodeInstance() throws Exception{
DocumentType documentType = setupDocumentType();
RouteNode rn = setupRouteNode(documentType);
RouteNodeInstance routeNodeInstance = setupRouteNodeInstance(rn);
routeNodeInstance.setRouteNode(rn);
routeNodeInstance = KRADServiceLocator.getDataObjectService().save(routeNodeInstance);
assertTrue("Route node instance persisted with route node",
routeNodeInstance != null && StringUtils.isNotBlank(routeNodeInstance.getRouteNodeId()));
String routeNodeInstanceId = routeNodeInstance.getRouteNodeInstanceId();
KEWServiceLocator.getRouteNodeService().deleteByRouteNodeInstance(routeNodeInstance);
routeNodeInstance = KradDataServiceLocator.getDataObjectService().find(RouteNodeInstance.class,
routeNodeInstanceId);
assertTrue("RouteNodeInstanceDeleted successfully", routeNodeInstance == null);
}
示例10: findNextRouteNodesInPath
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的package包/类
private List<RouteNode> findNextRouteNodesInPath(String nodeName, RouteNode node, Set<String> inspected) {
List<RouteNode> nextNodesInPath = new ArrayList<RouteNode>();
if (inspected.contains(node.getRouteNodeId())) {
return nextNodesInPath;
}
inspected.add(node.getRouteNodeId());
if (node.getRouteNodeName().equals(nodeName)) {
nextNodesInPath.add(node);
} else {
if (helper.isSubProcessNode(node)) {
ProcessDefinitionBo subProcess = node.getDocumentType().getNamedProcess(node.getRouteNodeName());
RouteNode subNode = subProcess.getInitialRouteNode();
if (subNode != null) {
nextNodesInPath.addAll(findNextRouteNodesInPath(nodeName, subNode, inspected));
}
}
for (Iterator<RouteNode> iterator = node.getNextNodes().iterator(); iterator.hasNext();) {
RouteNode nextNode = iterator.next();
nextNodesInPath.addAll(findNextRouteNodesInPath(nodeName, nextNode, inspected));
}
}
return nextNodesInPath;
}
示例11: testDeprecatedExceptionWorkgroupNameElements
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的package包/类
/**
* Tests if the deprecated "defaultExceptionWorkgroupName", "exceptionWorkgroupName", and "exceptionWorkgroup" elements are still being
* parsed and utilized properly.
*
* @throws Exception
*/
@Test
public void testDeprecatedExceptionWorkgroupNameElements() throws Exception {
DocumentType docType = KEWServiceLocator.getDocumentTypeService().findByName("SeqDocType");
RouteNode rtNode = docType.getPrimaryProcess().getInitialRouteNode();
String[] descriptiveNames = {"defaultExceptionWorkgroupName", "exceptionWorkgroupName", "defaultExceptionWorkgroupName", "exceptionWorkgroup"};
String[] expectedNames = {"TestWorkgroup", "NonSIT", "TestWorkgroup" , "NonSIT"};
String[] expectedNamespaces = {"KR-WKFLW", "KR-WKFLW", "KR-WKFLW", "KR-WKFLW"};
int i = 0;
// Verify that the exception groups, whether default or explicit, are being set properly.
assertTrue("No exception group was defined for node " + rtNode.getRouteNodeName(), rtNode.isExceptionGroupDefined());
assertGroupIsCorrect(descriptiveNames[i], expectedNames[i], expectedNamespaces[i], rtNode.getExceptionWorkgroup());
while (!rtNode.getNextNodes().isEmpty()) {
i++;
rtNode = rtNode.getNextNodes().get(0);
assertTrue("No exception group was defined for node " + rtNode.getRouteNodeName(), rtNode.isExceptionGroupDefined());
assertGroupIsCorrect(descriptiveNames[i], expectedNames[i], expectedNamespaces[i], rtNode.getExceptionWorkgroup());
}
assertEquals("Final route node index is incorrect", 3, i);
}
示例12: getLevelForNode
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的package包/类
private static Integer getLevelForNode(RouteNode node, String nodeName, Integer currentLevel) {
if (node == null) {
throw new WorkflowRuntimeException("Could not locate node with name '"+nodeName+"'");
}
// TODO potential for infinite recursion here if their document type has loops in it. Should this be a concern?
// If their routing version is really "route level" then there should be no cycles.
if (node.getRouteNodeName().equals(nodeName)) {
return currentLevel;
}
List<RouteNode> nextNodes = node.getNextNodes();
if (nextNodes.isEmpty()) {
throw new WorkflowRuntimeException("Could not locate node with name '"+nodeName+"'");
}
if (nextNodes.size() > 1) {
throw new WorkflowRuntimeException("Can only determine route level for document types with no splitting");
}
RouteNode nextNode = (RouteNode)nextNodes.get(0);
return getLevelForNode(nextNode, nodeName, new Integer(currentLevel.intValue()+1));
}
示例13: returnDocumentToPreviousRouteLevel
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的package包/类
public DocumentRouteHeaderValue returnDocumentToPreviousRouteLevel(String principalId, DocumentRouteHeaderValue routeHeader, Integer destRouteLevel, String annotation)
throws InvalidActionTakenException {
DocumentRouteHeaderValue result = null;
if (destRouteLevel != null) {
RouteNode node = CompatUtils.getNodeForLevel(routeHeader.getDocumentType(), destRouteLevel);
if (node == null) {
throw new InvalidActionTakenException("Could not locate node for route level " + destRouteLevel);
}
Principal principal = loadPrincipal(principalId);
ReturnToPreviousNodeAction action = new ReturnToPreviousNodeAction(routeHeader, principal, annotation, node.getRouteNodeName(), true);
action.performAction();
result = finish(routeHeader);
}
return result;
}
示例14: getCurrentRouteLevelName
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的package包/类
public String getCurrentRouteLevelName() {
String name = "Not Found";
// TODO the isRouteLevelDocument junk can be ripped out
if(routingReport){
name = "Routing Report";
} else if (CompatUtils.isRouteLevelDocument(this)) {
int routeLevelInt = getDocRouteLevel().intValue();
if ( LOG.isInfoEnabled() ) {
LOG.info("Getting current route level name for a Route level document: " + routeLevelInt+CURRENT_ROUTE_NODE_NAME_DELIMITER+documentId);
}
List<RouteNode> routeLevelNodes = CompatUtils.getRouteLevelCompatibleNodeList(getDocumentType());
if ( LOG.isInfoEnabled() ) {
LOG.info("Route level compatible node list has " + routeLevelNodes.size() + " nodes");
}
if (routeLevelInt < routeLevelNodes.size()) {
name = routeLevelNodes.get(routeLevelInt).getRouteNodeName();
}
} else {
List<String> currentNodeNames = getCurrentNodeNames();
name = StringUtils.join(currentNodeNames, CURRENT_ROUTE_NODE_NAME_DELIMITER);
}
return name;
}
示例15: validateRouting
import org.kuali.rice.kew.engine.node.RouteNode; //导入依赖的package包/类
/**
* Determines whether the doc's type appears to statically define any routing. If not, then Recall action
* doesn't make much sense, and should not be available. Checks whether any document type processes are defined,
* and if so, whether are are any non-"adhoc" nodes (based on literal node name check).
* @param rh the DocumentRouteHeaderValue
* @return error message if it looks like it's this doc will not route to a person based on static route definition, null (valid) otherwise
*/
protected String validateRouting(DocumentRouteHeaderValue rh) {
List<ProcessDefinitionBo> processes = rh.getDocumentType().getProcesses();
String errMsg = null;
if (processes.size() == 0) {
// if no processes are present then this doc isn't going to route to anyone
errMsg = "No processes are defined for document type. Recall is not applicable.";
} else {
// if there is not at least one route node not named "ADHOC", then assume this doc will not route to anybody
RouteNode initialRouteNode = rh.getDocumentType().getPrimaryProcess().getInitialRouteNode();
if (initialRouteNode.getName().equalsIgnoreCase("ADHOC") && initialRouteNode.getNextNodeIds().isEmpty()) {
errMsg = "No non-adhoc route nodes defined for document type. Recall is not applicable";
}
}
return errMsg;
}