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


Java PropositionParameterBo.setValue方法代码示例

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


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

示例1: processCustomOperators

import org.kuali.rice.krms.impl.repository.PropositionParameterBo; //导入方法依赖的package包/类
/**
 * walk the proposition tree and process any custom operators found, converting them to custom function invocations.
 *
 * @param propositionBo the root proposition from which to search and convert
 */
private void processCustomOperators(PropositionBo propositionBo) {
    if (StringUtils.isBlank(propositionBo.getCompoundOpCode())) {
        // if it is a simple proposition with a custom operator
        if (!propositionBo.getParameters().isEmpty() && propositionBo.getParameters().get(2).getValue().startsWith(
                KrmsImplConstants.CUSTOM_OPERATOR_PREFIX)) {
            PropositionParameterBo operatorParam = propositionBo.getParameters().get(2);

            CustomOperator customOperator =
                    KrmsServiceLocatorInternal.getCustomOperatorUiTranslator().getCustomOperator(operatorParam.getValue());

            FunctionDefinition operatorFunctionDefinition = customOperator.getOperatorFunctionDefinition();

            operatorParam.setParameterType(PropositionParameterType.FUNCTION.getCode());
            operatorParam.setValue(operatorFunctionDefinition.getId());
        }
    } else {
        // recurse
        for (PropositionBo childProp : propositionBo.getCompoundComponents()) {
            processCustomOperators(childProp);
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:AgendaEditorMaintainable.java

示例2: preprocessCustomOperators

import org.kuali.rice.krms.impl.repository.PropositionParameterBo; //导入方法依赖的package包/类
/**
 * Looks for any custom function calls within simple propositions and attempts to convert them to custom
 * operator keys.
 *
 * @param proposition the proposition to search within and convert
 * @param customOperatorValuesMap a map from function ID to custom operator key, used for the conversion
 */
protected void preprocessCustomOperators(PropositionBo proposition, Map<String, String> customOperatorValuesMap) {
    if (proposition == null) { return; }

    if (proposition.getParameters() != null && proposition.getParameters().size() > 0) {
        for (PropositionParameterBo param : proposition.getParameters()) {
            if (PropositionParameterType.FUNCTION.getCode().equals(param.getParameterType())) {
                // convert to our convention of customOperator:<functionNamespace>:<functionName>
                String convertedValue = customOperatorValuesMap.get(param.getValue());
                if (!StringUtils.isEmpty(convertedValue)) {
                    param.setValue(convertedValue);
                }
            }
        }
    } else if (proposition.getCompoundComponents() != null && proposition.getCompoundComponents().size() > 0) {
        for (PropositionBo childProposition : proposition.getCompoundComponents()) {
            // recurse
            preprocessCustomOperators(childProposition, customOperatorValuesMap);
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:AgendaEditorController.java


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