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


Java PropositionType类代码示例

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


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

示例1: testUpdateProposition

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
/**
 *  Test testUpdateProposition()
 *
 *  This test focuses specifically on the RuleManagementServiceImpl .updateProposition(PropositionDefinition) method
 */
@Test
public void testUpdateProposition() {
    // get a set of unique object names for use by this test (discriminator passed can be any unique value within this class)
    RuleManagementBaseTestObjectNames t5 =  new RuleManagementBaseTestObjectNames( CLASS_DISCRIMINATOR, "t5");

    PropositionDefinition propositionDefinition = createTestPropositionForRule(t5.object0);
    PropositionDefinition.Builder builder = PropositionDefinition.Builder.create(propositionDefinition);
    builder.setDescription("UpdatedDescription");
    builder.setPropositionTypeCode(PropositionType.COMPOUND.getCode());

    // focus of test is on this instruction
    ruleManagementService.updateProposition(builder.build());

    PropositionDefinition returnPropositionDefinition = ruleManagementService.getProposition(propositionDefinition.getId());

    assertEquals("description was not updated", "UpdatedDescription", returnPropositionDefinition.getDescription());
    assertEquals("propositionType was not updated", PropositionType.COMPOUND.getCode(), returnPropositionDefinition.getPropositionTypeCode());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:RuleManagementPropositionDefinitionTest.java

示例2: createPropositionDefinition

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
protected PropositionDefinition.Builder createPropositionDefinition(String propDescription, PropositionParametersBuilder params, RuleDefinition parentRule) {
    // Proposition for rule 2
    PropositionDefinition.Builder propositionDefBuilder1 =
            PropositionDefinition.Builder.create(null, PropositionType.SIMPLE.getCode(), parentRule.getId(),
                    null /* type code is only for custom props */, Collections.<PropositionParameter.Builder>emptyList());
    propositionDefBuilder1.setDescription(propDescription);

    // PropositionParams for rule 2
    List<PropositionParameter.Builder> propositionParams1 = params.build();


    // set the parent proposition so the builder will not puke
    for (PropositionParameter.Builder propositionParamBuilder : propositionParams1) {
        propositionParamBuilder.setProposition(propositionDefBuilder1);
    }

    propositionDefBuilder1.setParameters(propositionParams1);

    return propositionDefBuilder1;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:AbstractAgendaBoTest.java

示例3: createTestCompoundProposition

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
/**
 *  createTestCompoundProposition Create a complex Compound Proposition entry in the database
 // **************************
 // Compound Proposition (True if Account is 54321 and Occasion is either a Conference or Training)
 // ***************************
 //  C1_compound_proposition            "COMPOUND" "S1_simple_proposition"  "S2_simple_proposition"   "&"
 //      S1_simple_proposition          "SIMPLE"   "Account"                "54321"                   "="
 //      S2_simple_proposition          "SIMPLE"   "Occasion"               "Conference"              "="

 * @param t0
 * @return
 */
protected PropositionDefinition createTestCompoundProposition(RuleManagementBaseTestObjectNames t0){
    // create a child proposition record
    PropositionDefinition propS2 = createTestSimpleProposition(
            t0.namespaceName, "S2", "Occasion", "Conference", "=", "java.lang.String", t0.rule_0_Id, "Special Event");
    PropositionDefinition.Builder propBuilderS2 = PropositionDefinition.Builder.create(propS2);

    // create a child proposition record
    PropositionDefinition propS1 = createTestSimpleProposition(
            t0.namespaceName, "S1", "Account", "54321", "=", "java.lang.String", t0.rule_0_Id, "Charged To Account");
    PropositionDefinition.Builder propBuilderS1 = PropositionDefinition.Builder.create(propS1);

    // create a compound proposition record (referencing the two child records
    KrmsTypeDefinition krmsTypeDefinition = createKrmsTypeDefinition(null, t0.namespaceName, "proposition", "testTypeService");
    PropositionDefinition.Builder propBuilderC1 = PropositionDefinition.Builder.create(
            null,PropositionType.COMPOUND.getCode(),t0.rule_0_Id,null,new ArrayList<PropositionParameter.Builder>());
    propBuilderC1.compoundOpCode(LogicalOperator.AND.getCode());
    List<PropositionDefinition.Builder> compoundComponentsC1 = new ArrayList<PropositionDefinition.Builder>();
    compoundComponentsC1.add(propBuilderS1);
    compoundComponentsC1.add(propBuilderS2);
    propBuilderC1.setCompoundComponents(compoundComponentsC1);
    propBuilderC1.setDescription("C1_compound_proposition");
    propBuilderC1.setTypeId(krmsTypeDefinition.getId());

    return ruleManagementService.createProposition(propBuilderC1.build());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:38,代码来源:RuleManagementBaseTest.java

示例4: createCompoundPropositionBoStub2

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
public static PropositionBo createCompoundPropositionBoStub2(PropositionBo existing) {
    // create a simple proposition Bo
    PropositionBo prop = new PropositionBo();
    prop.setId(propositionIdIncrementer.getNewId());
    prop.setPropositionTypeCode(PropositionType.COMPOUND.getCode());
    prop.setRuleId(existing.getRuleId());
    prop.setCompoundOpCode(LogicalOperator.AND.getCode());
    // default to and
    prop.setDescription("");
    prop.setEditMode(true);
    List<PropositionBo> components = new ArrayList<PropositionBo>();
    ((ArrayList<PropositionBo>) components).add(existing);
    prop.setCompoundComponents(components);

    return prop;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:PropositionBo.java

示例5: addCustomContainerComponents

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
@Override
public void addCustomContainerComponents(ViewModel model, Container container) {
    if (PROPOSITION_GROUP_ID.equals(container.getId())) {
        RuleBo ruleDataObj = (RuleBo)((InquiryForm)model).getDataObject();
        PropositionBo proposition = ruleDataObj.getProposition();
        if (proposition != null) {
            if (PropositionType.COMPOUND.getCode().equals(proposition.getPropositionTypeCode())) {
                List<Component> groups = new ArrayList<Component>();
                handleCompoundPropositions(groups, proposition);
                container.setItems(groups);
            } else {
                Message simplePropName = ComponentFactory.getMessage();
                simplePropName.setId(PROPOSITION_ID + "_" + ID++);
                simplePropName.setMessageText(proposition.getDescription());
                List<Message> simpleProps = new ArrayList<Message>();
                simpleProps.add(simplePropName);
                container.setItems(simpleProps);
            }
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:RuleStudentInquiryViewHelperServiceImpl.java

示例6: buildSimplePropositionContextMap

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
protected Map<String, Object> buildSimplePropositionContextMap(PropositionDefinition proposition) {
    if (!proposition.getPropositionTypeCode().equals(PropositionType.SIMPLE.getCode())) {
        throw new RiceIllegalArgumentException("proposition is not simple " + proposition.getPropositionTypeCode() + " " + proposition.getId() + proposition.getDescription());
    }
    Map<String, Object> contextMap = new LinkedHashMap<String, Object>();
    for (PropositionParameter param : proposition.getParameters()) {
        if (param.getParameterType().equals(PropositionParameterType.TERM.getCode())) {
            TermDefinition term = param.getTermValue();
            if ((term == null) && (StringUtils.isNotBlank(param.getValue()))) {
               term = this.termRepositoryService.getTerm(param.getValue());
            }
            if (term != null) {
                for (TermParameterDefinition termParam : term.getParameters()) {
                    contextMap.put(termParam.getName(), termParam.getValue());
                }
            } else {
                contextMap.put(param.getParameterType(), param.getValue());
            }
        } else {
            contextMap.put(param.getParameterType(), param.getValue());
        }
    }
    return contextMap;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:TranslationUtility.java

示例7: loadProposition

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
@Override
public Proposition loadProposition(PropositionDefinition propositionDefinition) {
	if (translator == null) {
		throw new IllegalStateException("Service not configured properly, no translator available.");
	}
	if (propositionDefinition == null) {
		throw new IllegalArgumentException("propositionDefinition was null");
	}
	if (PropositionType.COMPOUND != PropositionType.fromCode(propositionDefinition.getPropositionTypeCode())) {
		throw new IllegalArgumentException("Given proposition definition was not compound, type code was: " + propositionDefinition.getPropositionTypeCode());
	}
	List<Proposition> propositions = new ArrayList<Proposition>();
	for (PropositionDefinition subProp : propositionDefinition.getCompoundComponents()) {
		propositions.add(translator.translatePropositionDefinition(subProp));
	}
	LogicalOperator operator = LogicalOperator.fromCode(propositionDefinition.getCompoundOpCode());
	return new CompoundProposition(operator, propositions);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:CompoundPropositionTypeService.java

示例8: getPropositionTypeService

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
@Override
public PropositionTypeService getPropositionTypeService(PropositionDefinition propositionDefinition) {
	if (propositionDefinition == null) {
		throw new IllegalArgumentException("propositionDefinition was null");
	}
	if (propositionDefinition.getTypeId() == null) {
		PropositionType propositionType = PropositionType.fromCode(propositionDefinition.getPropositionTypeCode());
		if (PropositionType.COMPOUND == propositionType) {
			return defaultCompoundPropositionTypeService;
		} else if (PropositionType.SIMPLE == propositionType) {
			return defaultSimplePropositionTypeService;
		}
		throw new RepositoryDataException("Proposition does not have a typeId defined and does not define a valid proposition type code.  Proposition id is: " + propositionDefinition.getId());
	}
	KrmsTypeDefinition typeDefinition = getTypeDefinition(propositionDefinition.getTypeId());
	return resolveTypeService(typeDefinition, PropositionTypeService.class);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:KrmsTypeResolverImpl.java

示例9: createCompoundProposition

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
private PropositionDefinition.Builder createCompoundProposition(String contextId, RuleDefinition ruleDef1) {
    // Proposition for rule 1
    List<PropositionParameter.Builder> propositionParameterBuilderList = new ArrayList<PropositionParameter.Builder>();
    propositionParameterBuilderList.add(PropositionParameter.Builder.create(null, null, createTermDefinition1(contextId).getId(),
            PropositionParameterType.TERM.getCode(), 1)
    );
    propositionParameterBuilderList.add(PropositionParameter.Builder.create(null, null, "BL",
            PropositionParameterType.CONSTANT.getCode(), 2)
    );
    propositionParameterBuilderList.add(PropositionParameter.Builder.create(null, null, ComparisonOperator.EQUALS.getCode(),
            PropositionParameterType.OPERATOR.getCode(), 3)
    );

    PropositionDefinition.Builder propositionDefBuilder1 =
        PropositionDefinition.Builder.create(null, PropositionType.SIMPLE.getCode(), ruleDef1.getId(), null /* type code is only for custom props */, propositionParameterBuilderList);
    propositionDefBuilder1.setDescription("propositionDefBuilder1 Description");

    // set the parent proposition so the builder will not puke
    for (PropositionParameter.Builder propositionParamBuilder : propositionParameterBuilderList) {
        propositionParamBuilder.setProposition(propositionDefBuilder1);
    }

    return propositionDefBuilder1;
}
 
开发者ID:kuali,项目名称:rice,代码行数:25,代码来源:ValidationIntegrationTest.java

示例10: createPropositionDefinition

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
private PropositionDefinition.Builder createPropositionDefinition(String propDescription, PropositionParametersBuilder params, RuleDefinition parentRule) {
    // Proposition for rule 2
    PropositionDefinition.Builder propositionDefBuilder1 =
            PropositionDefinition.Builder.create(null, PropositionType.SIMPLE.getCode(), parentRule.getId(),
                    null /* type code is only for custom props */, Collections.<PropositionParameter.Builder>emptyList());
    propositionDefBuilder1.setDescription(propDescription);

    // PropositionParams for rule 2
    List<PropositionParameter.Builder> propositionParams1 = params.build();


    // set the parent proposition so the builder will not puke
    for (PropositionParameter.Builder propositionParamBuilder : propositionParams1) {
        propositionParamBuilder.setProposition(propositionDefBuilder1);
    }

    propositionDefBuilder1.setParameters(propositionParams1);

    return propositionDefBuilder1;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:21,代码来源:AbstractAgendaBoTest.java

示例11: addCustomContainerComponents

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
@Override
protected void addCustomContainerComponents(View view, Object model, Container container) {
    if (PROPOSITION_GROUP_ID.equals(container.getId())) {
        RuleBo ruleDataObj = (RuleBo)((InquiryForm)model).getDataObject();
        PropositionBo proposition = ruleDataObj.getProposition();
        if (proposition != null) {
            if (PropositionType.COMPOUND.getCode().equals(proposition.getPropositionTypeCode())) {
                List<Component> groups = new ArrayList<Component>();
                handleCompoundPropositions(groups, proposition);
                container.setItems(groups);
            } else {
                Message simplePropName = ComponentFactory.getMessage();
                simplePropName.setId(PROPOSITION_ID + "_" + ID++);
                simplePropName.setMessageText(proposition.getDescription());
                List<Message> simpleProps = new ArrayList<Message>();
                simpleProps.add(simplePropName);
                container.setItems(simpleProps);
            }
        }
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:22,代码来源:RuleStudentInquiryViewHelperServiceImpl.java

示例12: newTestRuleBo

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
private RuleBo newTestRuleBo(String testId) {
    String ruleId = TEST_PREFIX + "RuleId" + testId;
    PropositionDefinition.Builder prop = PropositionDefinition.Builder.create(TEST_PREFIX + "PropositionId" + testId, PropositionType.SIMPLE.getCode(), ruleId, null, null);
    RuleDefinition.Builder builder = RuleDefinition.Builder.create(ruleId, ruleId + "Name", TEST_PREFIX + "Namespace", null, prop.getId());
    builder.setProposition(prop);
    return RuleBo.from(builder.build());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:AgendaBoTest.java

示例13: createPropositionDefinition1

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
private PropositionDefinition.Builder createPropositionDefinition1(ContextDefinition contextDefinition, RuleDefinition ruleDef1) {
    // Proposition for rule 1
    PropositionDefinition.Builder propositionDefBuilder1 =
        PropositionDefinition.Builder.create(null, PropositionType.SIMPLE.getCode(), ruleDef1.getId(), null /* type code is only for custom props */, Collections.<PropositionParameter.Builder>emptyList());
    propositionDefBuilder1.setDescription("is campus bloomington");

    // PropositionParams for rule 1
    List<PropositionParameter.Builder> propositionParams1 = new ArrayList<PropositionParameter.Builder>();
    propositionParams1.add(
            PropositionParameter.Builder.create(null, null, createTermDefinition1(contextDefinition).getId(), PropositionParameterType.TERM.getCode(), 1)
    );
    propositionParams1.add(
            PropositionParameter.Builder.create(null, null, "BL", PropositionParameterType.CONSTANT.getCode(), 2)
    );
    propositionParams1.add(
            PropositionParameter.Builder.create(null, null, "=", PropositionParameterType.OPERATOR.getCode(), 3)
    );

    // set the parent proposition so the builder will not puke
    for (PropositionParameter.Builder propositionParamBuilder : propositionParams1) {
        propositionParamBuilder.setProposition(propositionDefBuilder1);
    }

    propositionDefBuilder1.setParameters(propositionParams1);

    return propositionDefBuilder1;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:ValidationIntegrationTest.java

示例14: createCompoundProposition

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
private PropositionDefinition.Builder createCompoundProposition(ContextDefinition contextDefinition,
            RuleDefinition ruleDef1) {
        // Proposition for rule 1
        List<PropositionParameter.Builder> propositionParameterBuilderList = new ArrayList<PropositionParameter.Builder>();
        propositionParameterBuilderList.add(PropositionParameter.Builder.create(null, null, createTermDefinition1(contextDefinition).getId(),
                PropositionParameterType.TERM.getCode(), 1)
        );
        propositionParameterBuilderList.add(PropositionParameter.Builder.create(null, null, "BL",
                PropositionParameterType.CONSTANT.getCode(), 2)
        );
        propositionParameterBuilderList.add(PropositionParameter.Builder.create(null, null, ComparisonOperator.EQUALS.getCode(),
                PropositionParameterType.OPERATOR.getCode(), 3)
        );

        PropositionDefinition.Builder propositionDefBuilder1 =
            PropositionDefinition.Builder.create(null, PropositionType.SIMPLE.getCode(), ruleDef1.getId(), null /* type code is only for custom props */, propositionParameterBuilderList);
        propositionDefBuilder1.setDescription("propositionDefBuilder1 Description");

        // PropositionParams for rule 1
//        List<PropositionParameter.Builder> propositionParams1 = new ArrayList<PropositionParameter.Builder>();
//        propositionParams1.add(
//                PropositionParameter.Builder.create(null, null, createTermDefinition1(contextDefinition).getId(), PropositionParameterType
//                        .TERM.getCode(), 1)
//        );

        // set the parent proposition so the builder will not puke
        for (PropositionParameter.Builder propositionParamBuilder : propositionParameterBuilderList) {
            propositionParamBuilder.setProposition(propositionDefBuilder1);
        }

//        propositionDefBuilder1.setParameters(propositionParams1);

        return propositionDefBuilder1;
    }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:35,代码来源:ValidationIntegrationTest.java

示例15: createTestSimpleProposition

import org.kuali.rice.krms.api.repository.proposition.PropositionType; //导入依赖的package包/类
/**
 *   createTestSimpleProposition creates a SIMPLE PropositionDefinition set of entries in the database
 *
 * @param namespace of the proposition type
 * @param propId
 * @param termSpecId
 * @param propConstant
 * @param propOperator
 * @param termSpecType
 * @param ruleId
 * @param termSpecDescr
 *
 * @return {@link PropositionDefinition}
 */
protected PropositionDefinition createTestSimpleProposition(String namespace, String propId, String termSpecId, String propConstant, String propOperator, String termSpecType, String ruleId, String termSpecDescr){
    createTestTermSpecification(termSpecId, termSpecId, namespace, termSpecType, termSpecDescr);
    KrmsTypeDefinition krmsTypeDefinition = createKrmsTypeDefinition(null, namespace, termSpecId, "testTypeService");

    PropositionDefinition.Builder propBuilder = PropositionDefinition.Builder.create(null,
            PropositionType.SIMPLE.getCode(), ruleId, krmsTypeDefinition.getId(), Collections.<PropositionParameter.Builder>emptyList());
    propBuilder.setDescription(propId + "_simple_proposition");

    PropositionDefinition propositionDefinition = ruleManagementService.createProposition(propBuilder.build());

    List<PropositionParameter.Builder> propParam =  new ArrayList<PropositionParameter.Builder>();
    propParam.add(PropositionParameter.Builder.create(propId + "_0", propositionDefinition.getId(), termSpecId,
            PropositionParameterType.TERM.getCode(), 0));
    propParam.add(PropositionParameter.Builder.create(propId + "_1", propositionDefinition.getId(), propConstant,
            PropositionParameterType.CONSTANT.getCode(), 1));
    propParam.add(PropositionParameter.Builder.create(propId + "_2", propositionDefinition.getId(), propOperator,
            PropositionParameterType.OPERATOR.getCode(), 2));

    propBuilder = PropositionDefinition.Builder.create(propositionDefinition);
    propBuilder.setParameters(propParam);

    ruleManagementService.updateProposition(propBuilder.build());
    // re-fetch to get the updated version numbers
    propositionDefinition = ruleManagementService.getProposition(propositionDefinition.getId());

    return propositionDefinition;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:42,代码来源:RuleManagementBaseTest.java


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