本文整理匯總了Java中org.kuali.rice.kew.engine.node.NodeType類的典型用法代碼示例。如果您正苦於以下問題:Java NodeType類的具體用法?Java NodeType怎麽用?Java NodeType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
NodeType類屬於org.kuali.rice.kew.engine.node包,在下文中一共展示了NodeType類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: exportNodeGraph
import org.kuali.rice.kew.engine.node.NodeType; //導入依賴的package包/類
private void exportNodeGraph(Element parent, RouteNode node, SplitJoinContext splitJoinContext) {
NodeType nodeType = null;
if (node != null) {
String contentFragment = node.getContentFragment();
// some of the older versions of rice do not have content fragments
if(contentFragment == null || "".equals(contentFragment)){
nodeType = getNodeTypeForNode(node);
}else{
// I'm not sure if this should be the default implementation because
// it uses a string comparison instead of a classpath check.
nodeType = this.getNodeTypeForNodeFromFragment(node);
}
if (nodeType.isAssignableFrom(NodeType.SPLIT)) {
exportSplitNode(parent, node, nodeType, splitJoinContext);
} else if (nodeType.isAssignableFrom(NodeType.JOIN)) {
exportJoinNode(parent, node, nodeType, splitJoinContext);
} else {
exportSimpleNode(parent, node, nodeType, splitJoinContext);
}
}
}
示例2: exportSimpleNode
import org.kuali.rice.kew.engine.node.NodeType; //導入依賴的package包/類
private void exportSimpleNode(Element parent, RouteNode node, NodeType nodeType, SplitJoinContext splitJoinContext) {
Element simpleElement = renderNodeElement(parent, node, nodeType);
if (node.getNextNodes().size() > 1) {
throw new WorkflowRuntimeException("Simple node cannot have more than one next node: " + node.getRouteNodeName());
}
if (node.getNextNodes().size() == 1) {
RouteNode nextNode = (RouteNode)node.getNextNodes().get(0);
renderer.renderAttribute(simpleElement, NEXT_NODE, nextNode.getRouteNodeName());
if (node.getNextDocumentStatus() != null) {
renderer.renderAttribute(simpleElement, NEXT_APP_DOC_STATUS, node.getNextDocumentStatus());
}
exportNodeGraph(parent, nextNode, splitJoinContext);
}
}
示例3: exportJoinNode
import org.kuali.rice.kew.engine.node.NodeType; //導入依賴的package包/類
private void exportJoinNode(Element parent, RouteNode node, NodeType nodeType, SplitJoinContext splitJoinContext) {
if (splitJoinContext == null) {
// this is the case where a join node is defined as part of a sub process to be used by a dynamic node, in this case it is
// not associated with a proper split node.
if (!node.getNextNodes().isEmpty()) {
throw new WorkflowRuntimeException("Could not export join node with next nodes that is not contained within a split.");
}
renderNodeElement(parent, node, nodeType);
} else if (splitJoinContext.joinNode == null) {
// this is the case where we are "inside" the split node in the XML, by setting up this context, the calling code knows that
// when it renders all of the branches of the split node, it can then use this context info to render the join node before
// closing the split
splitJoinContext.joinNode = node;
splitJoinContext.joinNodeType = nodeType;
}
}
示例4: exportRouteNodeOld
import org.kuali.rice.kew.engine.node.NodeType; //導入依賴的package包/類
/**
* Exists for backward compatibility for nodes which don't have a content fragment.
*/
private void exportRouteNodeOld(Element parent, RouteNode node, boolean hasDefaultExceptionWorkgroup) {
NodeType nodeType = getNodeTypeForNode(node);
Element nodeElement = renderer.renderElement(parent, nodeType.getName());
renderer.renderAttribute(nodeElement, NAME, node.getRouteNodeName());
if (!hasDefaultExceptionWorkgroup) {
if (!StringUtils.isBlank(node.getExceptionWorkgroupName())) {
Element exceptionGroupElement = renderer.renderTextElement(nodeElement, EXCEPTION_GROUP_NAME, node.getExceptionWorkgroupName());
exceptionGroupElement.setAttribute(NAMESPACE, node.getExceptionWorkgroup().getNamespaceCode());
}
}
if (supportsActivationType(nodeType) && !StringUtils.isBlank(node.getActivationType())) {
renderer.renderTextElement(nodeElement, ACTIVATION_TYPE, node.getActivationType());
}
if (supportsRouteMethod(nodeType)) {
exportRouteMethod(nodeElement, node);
renderer.renderBooleanElement(nodeElement, MANDATORY_ROUTE, node.getMandatoryRouteInd(), false);
renderer.renderBooleanElement(nodeElement, FINAL_APPROVAL, node.getFinalApprovalInd(), false);
}
if (nodeType.isCustomNode(node.getNodeType())) {
renderer.renderTextElement(nodeElement, TYPE, node.getNodeType());
}
}
示例5: getNodeTypeForNodeFromFragment
import org.kuali.rice.kew.engine.node.NodeType; //導入依賴的package包/類
/**
*
* This method will find the base node type via the content fragment of the node.
* Basically, it reads the node type, start, split, join, etc and then assigns
* the base type to it. This is necessary because there are cases where the
* passed in nodeType will no be in the classpath. It should, in theory do
* the same thing as getNodeTypeForNode.
*
* @param node
* @return
*/
private NodeType getNodeTypeForNodeFromFragment(RouteNode node) {
NodeType nodeType = null;
String contentFragment = node.getContentFragment();
String errorMessage = "Could not determine proper XML element for the given node type: " + node.getNodeType();
for (Iterator<NodeType> iterator = NodeType.getTypeList().iterator(); iterator.hasNext();) {
NodeType nType = iterator.next();
// checks for something like <start
// or <split
// we may want to switch this out for something a little more robust.
if(contentFragment.startsWith("<" + nType.getName())){
nodeType = nType;
}
}
if (nodeType == null) {
throw new WorkflowRuntimeException(errorMessage);
}
return nodeType;
}
示例6: renderNodeElement
import org.kuali.rice.kew.engine.node.NodeType; //導入依賴的package包/類
private Element renderNodeElement(Element parent, RouteNode node, NodeType nodeType) {
String nodeName = nodeType.getName();
// if it's a request activation node, be sure to export it as a simple node
if (nodeType.equals(NodeType.REQUEST_ACTIVATION)) {
nodeName = NodeType.SIMPLE.getName();
}
Element nodeElement = renderer.renderElement(parent, nodeName);
renderer.renderAttribute(nodeElement, NAME, node.getRouteNodeName());
return nodeElement;
}
示例7: getNodeTypeForNode
import org.kuali.rice.kew.engine.node.NodeType; //導入依賴的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;
}
示例8: exportSimpleNode
import org.kuali.rice.kew.engine.node.NodeType; //導入依賴的package包/類
private void exportSimpleNode(Element parent, RouteNode node, NodeType nodeType, SplitJoinContext splitJoinContext) {
Element simpleElement = renderNodeElement(parent, node, nodeType);
if (node.getNextNodes().size() > 1) {
throw new WorkflowRuntimeException("Simple node cannot have more than one next node: " + node.getRouteNodeName());
}
if (node.getNextNodes().size() == 1) {
RouteNode nextNode = (RouteNode)node.getNextNodes().get(0);
renderer.renderAttribute(simpleElement, NEXT_NODE, nextNode.getRouteNodeName());
exportNodeGraph(parent, nextNode, splitJoinContext);
}
}
示例9: supportsActivationType
import org.kuali.rice.kew.engine.node.NodeType; //導入依賴的package包/類
/**
* Any node can support activation type, this use to not be the case but now it is.
*/
private boolean supportsActivationType(NodeType nodeType) {
return true;
}
示例10: supportsRouteMethod
import org.kuali.rice.kew.engine.node.NodeType; //導入依賴的package包/類
/**
* Any node can support route methods, this use to not be the case but now it is.
*/
private boolean supportsRouteMethod(NodeType nodeType) {
return true;
}
示例11: testDocumentTypeXmlParser
import org.kuali.rice.kew.engine.node.NodeType; //導入依賴的package包/類
/**
* Makes sure the DocumentTypeXmlParser is working. Compare the parsed 'DocumentType' doctype to it's expected values.
* This test does not include multiple processes.
*
* @throws Exception
*/
@Test public void testDocumentTypeXmlParser() throws Exception {
ConfigContext.getCurrentContextConfig().putProperty("test.base.url", "http://someurl/path");
DocumentType parsedDocument = KEWServiceLocator.getDocumentTypeService().findByName("DocumentType");
assertEquals("Wrong name", "DocumentType", parsedDocument.getName());
assertEquals("Wrong description", "TestDocumentType", parsedDocument.getDescription());
assertEquals("Wrong label", "TestDocumentType", parsedDocument.getLabel());
assertEquals("Wrong postprocessor", "org.kuali.rice.kew.postprocessor.DefaultPostProcessor", parsedDocument.getPostProcessorName());
assertEquals("Wrong su workgroup", "TestWorkgroup", parsedDocument.getSuperUserWorkgroup().getName());
// roundabout way of testing to see if the exception workgroup has been processed properly
DocumentTypeXmlExporter exporter = new DocumentTypeXmlExporter();
KewExportDataSet dataSet = new KewExportDataSet();
dataSet.getDocumentTypes().add(parsedDocument);
String regex = "(?s).*<defaultExceptionGroupName namespace=\"" + KimConstants.KIM_GROUP_WORKFLOW_NAMESPACE_CODE + "\">TestWorkgroup</defaultExceptionGroupName>.*";
LOG.warn("Using regex: " + regex);
assertTrue(XmlJotter.jotNode(exporter.export(dataSet.createExportDataSet())).matches(regex));
//assertNotNull(parsedDocument.getDefaultExceptionWorkgroup());
//assertEquals("Wrong default exception workgroup", "TestWorkgroup", parsedDocument.getDefaultExceptionWorkgroup().getDisplayName());
assertEquals("Wrong doc handler url", "http://someurl/path/_blank", parsedDocument.getResolvedDocumentHandlerUrl());
assertEquals("Wrong unresolved doc handler url", "${test.base.url}/_blank", parsedDocument.getUnresolvedDocHandlerUrl());
assertEquals("Wrong help def url", "/_help", parsedDocument.getHelpDefinitionUrl());
assertEquals("Wrong unresolved help def url", "/_help", parsedDocument.getUnresolvedHelpDefinitionUrl());
assertEquals("Wrong blanketApprover workgroup", "TestWorkgroup", parsedDocument.getBlanketApproveWorkgroup().getName());
assertEquals("Wrong blanketApprove policy", null, parsedDocument.getBlanketApprovePolicy());
assertEquals("Wrong DEFAULT_APPROVE policy value", Boolean.FALSE, parsedDocument.getDefaultApprovePolicy().getPolicyValue());
assertEquals("Wrong LOOK_FUTURE", Boolean.TRUE, parsedDocument.getLookIntoFuturePolicy().getPolicyValue());
List processes = parsedDocument.getProcesses();
assertEquals("Should only be 1 process", 1, processes.size());
//this is going against the intended structure and is very brittle
ProcessDefinitionBo process = (ProcessDefinitionBo)processes.get(0);
List flattenedNodeList = KEWServiceLocator.getRouteNodeService().getFlattenedNodes(process);
assertEquals("Should be 6 total route nodes", 6, flattenedNodeList.size());
RouteNode adHocNode = process.getInitialRouteNode();
assertEquals("Wrong node name should be 'AdHoc'", "AdHoc",adHocNode.getRouteNodeName());
assertTrue("Wrong node type", NodeType.START.isAssignableFrom(Class.forName(adHocNode.getNodeType())));
assertEquals("Default Exception workgroup not propagated", "TestWorkgroup", adHocNode.getExceptionWorkgroup().getName());
RouteNode split = (RouteNode)adHocNode.getNextNodes().get(0);
assertEquals("Wrong node name", "Split", split.getRouteNodeName());
assertTrue("Wrong node type", NodeType.SPLIT.isAssignableFrom(Class.forName(split.getNodeType())));
assertEquals("Default Exception workgroup not propagated", "TestWorkgroup", split.getExceptionWorkgroup().getName());
RouteNode ruleTemplate1 = (RouteNode)split.getNextNodes().get(0);
assertEquals("Wrong node name", "RuleTemplate1", ruleTemplate1.getRouteNodeName());
assertTrue("Wrong node type", NodeType.REQUESTS.isAssignableFrom(Class.forName(ruleTemplate1.getNodeType())));
assertEquals("Wrong branch name", "B1", ruleTemplate1.getBranch().getName());
assertEquals("Default Exception workgroup not propagated", "TestWorkgroup", ruleTemplate1.getExceptionWorkgroup().getName());
RouteNode ruleTemplate2 = (RouteNode)split.getNextNodes().get(1);
assertEquals("Wrong node name", "RuleTemplate2", ruleTemplate2.getRouteNodeName());
assertTrue("Wrong node type", NodeType.REQUESTS.isAssignableFrom(Class.forName(ruleTemplate2.getNodeType())));
assertEquals("Wrong branch name", "B2", ruleTemplate2.getBranch().getName());
assertEquals("Default Exception workgroup not propagated", "TestWorkgroup", ruleTemplate2.getExceptionWorkgroup().getName());
RouteNode join = (RouteNode)ruleTemplate2.getNextNodes().get(0);
assertEquals("Wrong node name", "Join", join.getRouteNodeName());
assertTrue("Wrong node type", NodeType.JOIN.isAssignableFrom(Class.forName(join.getNodeType())));
assertEquals("Default Exception workgroup not propagated", "TestWorkgroup", join.getExceptionWorkgroup().getName());
RouteNode ruleTemplate3 = (RouteNode)join.getNextNodes().get(0);
assertEquals("Wrong node name", "RuleTemplate3", ruleTemplate3.getRouteNodeName());
assertTrue("Wrong node type", NodeType.REQUESTS.isAssignableFrom(Class.forName(ruleTemplate3.getNodeType())));
assertEquals("Default Exception workgroup not propagated", "TestWorkgroup", ruleTemplate3.getExceptionWorkgroup().getName());
}