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


Java RouteNode.getContentFragment方法代码示例

本文整理汇总了Java中org.kuali.rice.kew.engine.node.RouteNode.getContentFragment方法的典型用法代码示例。如果您正苦于以下问题:Java RouteNode.getContentFragment方法的具体用法?Java RouteNode.getContentFragment怎么用?Java RouteNode.getContentFragment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.kew.engine.node.RouteNode的用法示例。


在下文中一共展示了RouteNode.getContentFragment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: exportNodeGraph

import org.kuali.rice.kew.engine.node.RouteNode; //导入方法依赖的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);
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:DocumentTypeXmlExporter.java

示例2: getNodeTypeForNodeFromFragment

import org.kuali.rice.kew.engine.node.RouteNode; //导入方法依赖的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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:32,代码来源:DocumentTypeXmlExporter.java

示例3: exportRouteNode

import org.kuali.rice.kew.engine.node.RouteNode; //导入方法依赖的package包/类
private void exportRouteNode(Element parent, RouteNode node, boolean hasDefaultExceptionWorkgroup) {
String contentFragment = node.getContentFragment();
if (StringUtils.isBlank(contentFragment)) {
    exportRouteNodeOld(parent, node, hasDefaultExceptionWorkgroup);
} else {
    try {
	Document document = XmlHelper.buildJDocument(new StringReader(contentFragment));
	Element rootElement = document.detachRootElement();
	XmlHelper.propagateNamespace(rootElement, parent.getNamespace());
	parent.addContent(rootElement);
    } catch (XmlException e) {
	throw new WorkflowRuntimeException("Failed to load the content fragment.", e);
    }
}
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:DocumentTypeXmlExporter.java


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