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


Java KrmsServiceLocatorInternal类代码示例

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


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

示例1: processCustomOperators

import org.kuali.rice.krms.impl.util.KrmsServiceLocatorInternal; //导入依赖的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: createEventAttributeDefinition

import org.kuali.rice.krms.impl.util.KrmsServiceLocatorInternal; //导入依赖的package包/类
private KrmsAttributeDefinitionBo createEventAttributeDefinition() {
    KrmsAttributeDefinitionService service = KrmsServiceLocatorInternal.getService("krmsAttributeDefinitionService");
    assertNotNull(service);

    KrmsAttributeDefinition krmsAttributeDefinition = krmsAttributeDefinitionService.getAttributeDefinitionByNameAndNamespace(
            EVENT_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE);
    if (krmsAttributeDefinition == null) {
        KrmsAttributeDefinition.Builder krmsAttributeDefinitionBuilder = KrmsAttributeDefinition.Builder.create(null, EVENT_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE);
        krmsAttributeDefinitionBuilder.setLabel("Event");
        krmsAttributeDefinitionBuilder.setActive(true);
        krmsAttributeDefinition = krmsAttributeDefinitionService.createAttributeDefinition(krmsAttributeDefinitionBuilder.build());
    }

    assertNotNull(krmsAttributeDefinition.getId());

    return KrmsAttributeDefinitionBo.from(krmsAttributeDefinition);
}
 
开发者ID:kuali,项目名称:rice,代码行数:18,代码来源:ValidationIntegrationTest.java

示例3: createPeopleFlowAttributeDefinition

import org.kuali.rice.krms.impl.util.KrmsServiceLocatorInternal; //导入依赖的package包/类
/**
 * Create an attribute definition for "peopleFlow" using given attribute and label
 */
private KrmsAttributeDefinition createPeopleFlowAttributeDefinition(String attribute, String label) {
    KrmsAttributeDefinitionService service = KrmsServiceLocatorInternal.getService("krmsAttributeDefinitionService");
    assertNotNull(service);
    KrmsAttributeDefinitionBo attributeDefinitionBo = new KrmsAttributeDefinitionBo();
    attributeDefinitionBo.setNamespace(KrmsConstants.KRMS_NAMESPACE);
    attributeDefinitionBo.setName(attribute);
    attributeDefinitionBo.setLabel(label);
    attributeDefinitionBo.setActive(true);
    attributeDefinitionBo = dataObjectService.save(attributeDefinitionBo, PersistenceOption.FLUSH);
    assertNotNull(attributeDefinitionBo.getId());
    return KrmsAttributeDefinitionBo.to(attributeDefinitionBo);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:KewToRulesEngineIntegrationTest.java

示例4: createEventAttributeDefinition

import org.kuali.rice.krms.impl.util.KrmsServiceLocatorInternal; //导入依赖的package包/类
/**
 * Create an attribute definition for "Event" which is used to define the triggering event on an agenda.
 */
private KrmsAttributeDefinitionBo createEventAttributeDefinition() {
    KrmsAttributeDefinitionService service = KrmsServiceLocatorInternal.getService("krmsAttributeDefinitionService");
    assertNotNull(service);
    KrmsAttributeDefinitionBo attributeDefinitionBo = new KrmsAttributeDefinitionBo();
    attributeDefinitionBo.setNamespace(KrmsConstants.KRMS_NAMESPACE);
    attributeDefinitionBo.setName(EVENT_ATTRIBUTE);
    attributeDefinitionBo.setLabel("Event");
    attributeDefinitionBo.setActive(true);
    attributeDefinitionBo = dataObjectService.save(attributeDefinitionBo, PersistenceOption.FLUSH);
    assertNotNull(attributeDefinitionBo.getId());
    return attributeDefinitionBo;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:KewToRulesEngineIntegrationTest.java

示例5: getParamValue

import org.kuali.rice.krms.impl.util.KrmsServiceLocatorInternal; //导入依赖的package包/类
/**
 * returns the string summary value for the given proposition parameter.
 *
 * @param param the proposition parameter to get the summary value for
 * @return the summary value
 */
private String getParamValue(PropositionParameterBo param) {
    CustomOperatorUiTranslator customOperatorUiTranslator =
            KrmsServiceLocatorInternal.getCustomOperatorUiTranslator();

    if (PropositionParameterType.TERM.getCode().equalsIgnoreCase(param.getParameterType())) {
        String termName = "";
        String termId = param.getValue();

        if (termId != null && termId.length() > 0) {
            if (termId.startsWith(KrmsImplConstants.PARAMETERIZED_TERM_PREFIX)) {
                if (!StringUtils.isBlank(newTermDescription)) {
                    termName = newTermDescription;
                } else {
                    TermSpecificationBo termSpec = getDataObjectService().find(TermSpecificationBo.class,
                            termId.substring(1 + termId.indexOf(":")));
                    termName = termSpec.getName() + "(...)";
                }
            } else {
                TermBo term = getDataObjectService().find(TermBo.class, termId);
                termName = term.getSpecification().getName();
            }
        }

        return termName;

    } else if (PropositionParameterType.FUNCTION.getCode().equalsIgnoreCase(param.getParameterType()) ||
            PropositionParameterType.OPERATOR.getCode().equalsIgnoreCase(param.getParameterType())) {
        if (customOperatorUiTranslator.isCustomOperatorFormValue(param.getValue())) {
            String functionName = customOperatorUiTranslator.getCustomOperatorName(param.getValue());
            if (!StringUtils.isEmpty(functionName)) {
                return functionName;
            }
        }
    }

    return param.getValue();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:44,代码来源:PropositionBo.java

示例6: loadAgenda

import org.kuali.rice.krms.impl.util.KrmsServiceLocatorInternal; //导入依赖的package包/类
@Override
public Agenda loadAgenda(AgendaDefinition agendaDefinition) {

    if (agendaDefinition == null) { throw new RiceIllegalArgumentException("agendaDefinition must not be null"); }
    RepositoryToEngineTranslatorImpl repositoryToEngineTranslator = KrmsServiceLocatorInternal.getService(
            "repositoryToEngineTranslator");
    if (repositoryToEngineTranslator == null) {
        return null;
    }
    
    Map<String, String> existingAttributes = new HashMap<String, String>(agendaDefinition.getAttributes());
    existingAttributes.put("name", agendaDefinition.getName());
    
    return new BasicAgenda(existingAttributes, new LazyAgendaTree(agendaDefinition, repositoryToEngineTranslator));
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:16,代码来源:AgendaTypeServiceBase.java

示例7: getCustomOperatorUiTranslator

import org.kuali.rice.krms.impl.util.KrmsServiceLocatorInternal; //导入依赖的package包/类
private CustomOperatorUiTranslator getCustomOperatorUiTranslator() {
    return KrmsServiceLocatorInternal.getCustomOperatorUiTranslator();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:AgendaEditorController.java


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