• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java KrmsTypeDefinition类的典型用法和代码示例

java 1次浏览

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

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

示例1: getKeyValues

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Override
public List<KeyValue> getKeyValues(ViewModel model) {
       List<KeyValue> keyValues = new ArrayList<KeyValue>();

       AgendaEditor agendaEditor;
       if (model instanceof InquiryForm) {
           InquiryForm inquiryForm = (InquiryForm) model;
           agendaEditor = ((AgendaEditor) inquiryForm.getDataObject());

       } else {
           MaintenanceDocumentForm maintenanceForm = (MaintenanceDocumentForm) model;
           agendaEditor = ((AgendaEditor) maintenanceForm.getDocument().getNewMaintainableObject().getDataObject());
       }

       // if we have an agenda w/ a selected context
       if (agendaEditor.getAgenda() != null && StringUtils.isNotBlank(agendaEditor.getAgenda().getContextId())) {
           Collection<KrmsTypeDefinition> ruleTypes = getKrmsTypeRepositoryService().findAllRuleTypesByContextId(
                   agendaEditor.getAgenda().getContextId());
           for (KrmsTypeDefinition ruleType : ruleTypes) {
               keyValues.add(new ConcreteKeyValue(ruleType.getId(), ruleType.getName()));
           }
       }

       return keyValues;
   }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:26,
代码来源:RuleTypeValuesFinder.java

示例2: flushCacheBeforeSave

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
private void flushCacheBeforeSave(){
    //flush krms caches
    DistributedCacheManagerDecorator distributedCacheManagerDecorator =
            GlobalResourceLoader.getService(KrmsConstants.KRMS_DISTRIBUTED_CACHE);

    distributedCacheManagerDecorator.getCache(ActionDefinition.Cache.NAME).clear();
    distributedCacheManagerDecorator.getCache(AgendaItemDefinition.Cache.NAME).clear();
    distributedCacheManagerDecorator.getCache(AgendaTreeDefinition.Cache.NAME).clear();
    distributedCacheManagerDecorator.getCache(AgendaDefinition.Cache.NAME).clear();
    distributedCacheManagerDecorator.getCache(ContextDefinition.Cache.NAME).clear();
    distributedCacheManagerDecorator.getCache(KrmsAttributeDefinition.Cache.NAME).clear();
    distributedCacheManagerDecorator.getCache(KrmsTypeDefinition.Cache.NAME).clear();
    distributedCacheManagerDecorator.getCache(RuleDefinition.Cache.NAME).clear();
    distributedCacheManagerDecorator.getCache(PropositionDefinition.Cache.NAME).clear();
    distributedCacheManagerDecorator.getCache(RuleDefinition.Cache.NAME).clear();
    distributedCacheManagerDecorator.getCache(TermDefinition.Cache.NAME).clear();
    distributedCacheManagerDecorator.getCache(TermResolverDefinition.Cache.NAME).clear();
    distributedCacheManagerDecorator.getCache(TermSpecificationDefinition.Cache.NAME).clear();
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:20,
代码来源:AgendaEditorMaintainable.java

示例3: createAgendaDefinition

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
private void createAgendaDefinition(String agendaName, String agendaLabel, ContextDefinition contextDefinition) {
    KrmsTypeDefinition krmsGenericTypeDefinition = createKrmsGenericTypeDefinition(contextDefinition.getNamespace(),
            "testAgendaTypeService", agendaName, agendaLabel);

    AgendaDefinition agendaDefinition = AgendaDefinition.Builder.create(null, agendaName,
            krmsGenericTypeDefinition.getId(), contextDefinition.getId()).build();
    agendaDefinition = agendaBoService.createAgenda(agendaDefinition);
    agendaBoService.updateAgenda(agendaDefinition);

    AgendaBo agendaBo = findAgendaByPrimaryKey(agendaDefinition);

    AgendaDefinition.Builder agendaDefBuilder1 = AgendaDefinition.Builder.create(agendaBoService.to(agendaBo));
    agendaDefinition = agendaDefBuilder1.build();

    agendaBoService.updateAgenda(agendaDefinition);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:17,
代码来源:AgendaEditorMaintainableIntegrationTest.java

示例4: testCreateAction

点赞 3

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

    KrmsTypeDefinition krmsTypeDefinition = createKrmsActionTypeDefinition(t0.namespaceName);
    RuleDefinition ruleDefintion = buildTestRuleDefinition(t0.namespaceName, t0.discriminator);

    ActionDefinition actionDefinition = ActionDefinition.Builder.create(t0.action0_Id, t0.action0_Name,
            t0.namespaceName,krmsTypeDefinition.getId(),ruleDefintion.getId(),1).build();

    assertNull("action should not be in database", ruleManagementService.getAction(t0.action0_Id));

    // primary statement for test
    actionDefinition =  ruleManagementService.createAction(actionDefinition);

    ActionDefinition returnActionDefinition = ruleManagementService.getAction(actionDefinition.getId());

    assertNotNull("created action not found", (Object) returnActionDefinition);
    assertEquals("create action error:", t0.action0_Id, returnActionDefinition.getId());
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:27,
代码来源:RuleManagementActionDefinitionTest.java

示例5: getKeyValues

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Override
public List<KeyValue> getKeyValues(ViewModel model) {
    List<KeyValue> keyValues = new ArrayList<KeyValue>();

    AgendaEditor agendaEditor;
    if (model instanceof InquiryForm) {
        InquiryForm inquiryForm = (InquiryForm) model;
        agendaEditor = ((AgendaEditor) inquiryForm.getDataObject());

    } else {
        MaintenanceDocumentForm maintenanceForm = (MaintenanceDocumentForm) model;
        agendaEditor = ((AgendaEditor) maintenanceForm.getDocument().getNewMaintainableObject().getDataObject());
    }

    // if we have an agenda w/ a selected context
    if (agendaEditor.getAgenda() != null && StringUtils.isNotBlank(agendaEditor.getAgenda().getContextId())) {
        Collection<KrmsTypeDefinition> agendaTypes = getKrmsTypeRepositoryService().findAllAgendaTypesByContextId(
                agendaEditor.getAgenda().getContextId());
        for (KrmsTypeDefinition agendaType : agendaTypes) {
            keyValues.add(new ConcreteKeyValue(agendaType.getId(), agendaType.getName()));
        }
    }

    return keyValues;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:26,
代码来源:AgendaTypeValuesFinder.java

示例6: createKrmsGenericTypeDefinition

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
protected KrmsTypeDefinition createKrmsGenericTypeDefinition(String nameSpace, String serviceName,
        String attributeDefinitionLabel, String attributeDefinitionName) {
    KrmsTypeDefinition krmsGenericTypeDefinition = krmsTypeRepository.getTypeByName(nameSpace, "KrmsTestGenericType");

    if (null == krmsGenericTypeDefinition) {

        // Attribute Defn for generic type;
        KrmsAttributeDefinition.Builder genericTypeAttributeDefnBuilder = KrmsAttributeDefinition.Builder.create(null,
                attributeDefinitionName, nameSpace);
        genericTypeAttributeDefnBuilder.setLabel(attributeDefinitionLabel);
        KrmsAttributeDefinition genericTypeAttributeDefinition1 = krmsAttributeDefinitionService.createAttributeDefinition(genericTypeAttributeDefnBuilder.build());

        // Attr for generic type;
        KrmsTypeAttribute.Builder genericTypeAttrBuilder = KrmsTypeAttribute.Builder.create(null, genericTypeAttributeDefinition1.getId(), 1);

        // Can use this generic type for KRMS bits that don't actually rely on services on the bus at this point in time
        KrmsTypeDefinition.Builder krmsGenericTypeDefnBuilder = KrmsTypeDefinition.Builder.create("KrmsTestGenericType", nameSpace);
        krmsGenericTypeDefnBuilder.setServiceName(serviceName);
        krmsGenericTypeDefnBuilder.setAttributes(Collections.singletonList(genericTypeAttrBuilder));
        krmsGenericTypeDefinition = krmsTypeRepository.createKrmsType(krmsGenericTypeDefnBuilder.build());

    }

    return krmsGenericTypeDefinition;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:26,
代码来源:AbstractBoTest.java

示例7: createKrmsTypeDefinition

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
/**
 * createKrmsTypeDefinition
 *
 * @param typeId
 * @param nameSpace
 * @param typeName
 * @param serviceName
 * @param typeAttributes
 *
 * @return {@link KrmsTypeDefinition}
 */
protected KrmsTypeDefinition createKrmsTypeDefinition(String typeId, String nameSpace, String typeName, String serviceName, List<KrmsTypeAttribute.Builder> typeAttributes) {
    KrmsTypeDefinition krmsTypeDefinition =  krmsTypeRepository.getTypeByName(nameSpace, typeName);

    if (krmsTypeDefinition == null) {
        KrmsTypeDefinition.Builder krmsTypeDefnBuilder = KrmsTypeDefinition.Builder.create(typeName, nameSpace);

        if (!CollectionUtils.isEmpty(typeAttributes)) {
            krmsTypeDefnBuilder.setAttributes(typeAttributes);
        }

        krmsTypeDefnBuilder.setId(typeId);
        krmsTypeDefnBuilder.setServiceName(serviceName);
        String id = krmsTypeRepository.createKrmsType(krmsTypeDefnBuilder.build()).getId();
        krmsTypeDefinition = krmsTypeRepository.getTypeById(id);
    }

    return krmsTypeDefinition;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:30,
代码来源:RuleManagementBaseTest.java

示例8: getActionTypeService

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
private ActionTypeService getActionTypeService(String krmsTypeId) {
    //
    // Get the ActionTypeService by hook or by crook
    //

    KrmsTypeDefinition krmsType = KrmsRepositoryServiceLocator.getKrmsTypeRepositoryService().getTypeById(krmsTypeId);

    ActionTypeService actionTypeService = null;

    if (!StringUtils.isBlank(krmsTypeId)) {
        String serviceName = krmsType.getServiceName();

        if (!StringUtils.isBlank(serviceName)) {
            actionTypeService = KrmsRepositoryServiceLocator.getService(serviceName);
        }
    }
    if (actionTypeService == null) {
        actionTypeService = ActionTypeServiceBase.defaultActionTypeService;
    }

    //        if (actionTypeService == null) { actionTypeService = AgendaTypeServiceBase.defaultAgendaTypeService; }

    return actionTypeService;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:25,
代码来源:KrmsRetriever.java

示例9: getAgendaTypeService

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
private AgendaTypeService getAgendaTypeService(String krmsTypeId) {
    //
    // Get the AgendaTypeService by hook or by crook
    //

    KrmsTypeDefinition krmsType =
            KrmsRepositoryServiceLocator.getKrmsTypeRepositoryService().
                    getTypeById(krmsTypeId);

    AgendaTypeService agendaTypeService = null;

    if (!StringUtils.isBlank(krmsTypeId)) {
        String serviceName = krmsType.getServiceName();

        if (!StringUtils.isBlank(serviceName)) {
            agendaTypeService = KrmsRepositoryServiceLocator.getService(serviceName);
        }
    }

    if (agendaTypeService == null) { agendaTypeService = AgendaTypeServiceBase.defaultAgendaTypeService; }

    return agendaTypeService;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:24,
代码来源:KrmsRetriever.java

示例10: _findTypesForType

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
private List<KrmsTypeDefinition> _findTypesForType(String typeId, List<String> fromServiceNames, List<String> toServiceNames)
        throws RiceIllegalArgumentException {
    KrmsTypeDefinition fromType = this.getTypeById(typeId);
    if (fromType == null) {
        throw new RiceIllegalArgumentException(typeId + " does not exist");
    }
    if (!fromServiceNames.contains(fromType.getServiceName())) {
        throw new RiceIllegalArgumentException(typeId + "'s serviceTypeName is " + fromType.getServiceName() + " expected " + fromServiceNames);
    }
    List<TypeTypeRelation> rels = this.findTypeTypeRelationsByFromType(typeId);
    Collections.sort(rels, new TypeTypeRelationSequenceComparator ());
    List<KrmsTypeDefinition> list = new ArrayList<KrmsTypeDefinition>(rels.size());
    for (TypeTypeRelation rel : rels) {
        KrmsTypeDefinition info = this.getTypeById(rel.getToTypeId());
        if (toServiceNames.contains(info.getServiceName())) {
            list.add(info);
        }
    }
    return list;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:21,
代码来源:KrmsTypeRepositoryServiceMockImpl.java

示例11: updateKrmsType

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
/**
 * This overridden method updates an existing KrmsType
 *
 * @see org.kuali.rice.krms.api.repository.type.KrmsTypeRepositoryService#updateKrmsType(org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition)
 */
@Override
public KrmsTypeDefinition updateKrmsType(KrmsTypeDefinition krmsType) {
    if (krmsType == null) {
        throw new RiceIllegalArgumentException("krmsType is null");
    }

    final String idKey = krmsType.getId();
    final KrmsTypeBo existing = dataObjectService.find(KrmsTypeBo.class, idKey);

    if (existing == null) {
        throw new RiceIllegalStateException("the KRMS type does not exist: " + krmsType);
    }

    final KrmsTypeDefinition toUpdate;

    if (!existing.getId().equals(krmsType.getId())) {
        final KrmsTypeDefinition.Builder builder = KrmsTypeDefinition.Builder.create(krmsType);
        builder.setId(existing.getId());
        toUpdate = builder.build();
    } else {
        toUpdate = krmsType;
    }

    return KrmsTypeBo.to(dataObjectService.save(KrmsTypeBo.from(toUpdate), PersistenceOption.FLUSH));
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:31,
代码来源:KrmsTypeBoServiceImpl.java

示例12: getTypeByName

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Override
public KrmsTypeDefinition getTypeByName(final String namespaceCode, final String name) {
    if (StringUtils.isBlank(namespaceCode)) {
        throw new RiceIllegalArgumentException("namespaceCode was a null or blank value");
    }

    if (StringUtils.isBlank(name)) {
        throw new RiceIllegalArgumentException("name was a null or blank value");
    }

    final Map<String, Object> map = new HashMap<String, Object>();
    map.put("namespace", namespaceCode);
    map.put("name", name);

    KrmsTypeBo myType = findSingleMatching(dataObjectService, KrmsTypeBo.class, Collections.unmodifiableMap(map));

    return KrmsTypeBo.to(myType);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:KrmsTypeBoServiceImpl.java

示例13: buildAttributes

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
private static Collection<NaturalLanguageTemplateAttributeBo> buildAttributes(NaturalLanguageTemplate im, Collection<NaturalLanguageTemplateAttributeBo> attributes) {
    KrmsTypeDefinition krmsTypeDefinition = getTypeRepositoryService().getTypeById(im.getTypeId());

    // for each entry, build a NaturalLanguageTemplateAttributeBo and add it 
    if (im.getAttributes() != null) {
        for (Map.Entry<String, String> entry : im.getAttributes().entrySet()) {
            KrmsAttributeDefinition attrDef = getAttributeDefinitionService().getAttributeDefinitionByNameAndNamespace(entry.getKey(), krmsTypeDefinition.getNamespace());

            if (attrDef != null) {
                NaturalLanguageTemplateAttributeBo attributeBo = new NaturalLanguageTemplateAttributeBo();
                attributeBo.setNaturalLanguageTemplateId(im.getId());
                attributeBo.setAttributeDefinitionId(attrDef.getId());
                attributeBo.setValue(entry.getValue());
                attributeBo.setAttributeDefinition(KrmsAttributeDefinitionBo.from(attrDef));
                attributes.add(attributeBo);
            } else {
                throw new RiceIllegalStateException("there is no attribute definition with the name '" + entry.getKey() + "' that is valid for the naturalLanguageTemplate type with id = '" + im.getTypeId() + "'");
            }
        }
    }

    return attributes;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:24,
代码来源:NaturalLanguageTemplateBo.java

示例14: findAllAgendaTypesByContextId

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Override
public List<KrmsTypeDefinition> findAllAgendaTypesByContextId(String contextId) {
    if (StringUtils.isBlank(contextId)) {
        throw new RiceIllegalArgumentException("contextId was a null or blank value");
    }

    final Map<String, Object> map = new HashMap<String, Object>();
    map.put("contextId", contextId);
    Collection<ContextValidAgendaBo> contextValidAgendaBos = findMatchingOrderBy(dataObjectService,
            ContextValidAgendaBo.class, Collections.unmodifiableMap(map), "agendaType.name", true);
    List<KrmsTypeDefinition> agendaTypes = new ArrayList<KrmsTypeDefinition>();

    for (ContextValidAgendaBo contextValidAgendaBo : contextValidAgendaBos) {
        agendaTypes.add(KrmsTypeBo.to(contextValidAgendaBo.getAgendaType()));
    }

    return agendaTypes;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:KrmsTypeBoServiceImpl.java

示例15: findAllRuleTypesByContextId

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Override
public List<KrmsTypeDefinition> findAllRuleTypesByContextId(String contextId) {
    if (StringUtils.isBlank(contextId)) {
        throw new RiceIllegalArgumentException("contextId was a null or blank value");
    }

    final Map<String, Object> map = new HashMap<String, Object>();
    map.put("contextId", contextId);
    Collection<ContextValidRuleBo> contextValidRuleBos = findMatchingOrderBy(dataObjectService,
            ContextValidRuleBo.class, Collections.unmodifiableMap(map), "ruleType.name", true);
    List<KrmsTypeDefinition> ruleTypes = new ArrayList<KrmsTypeDefinition>();

    for (ContextValidRuleBo contextValidRuleBo : contextValidRuleBos) {
        ruleTypes.add(KrmsTypeBo.to(contextValidRuleBo.getRuleType()));
    }

    return ruleTypes;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:KrmsTypeBoServiceImpl.java

示例16: getRuleTypeByRuleTypeIdAndContextId

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Override
public KrmsTypeDefinition getRuleTypeByRuleTypeIdAndContextId(String ruleTypeId, String contextId) {
    if (StringUtils.isBlank(ruleTypeId)) {
        throw new RiceIllegalArgumentException("ruleTypeId was a null or blank value");
    }

    if (StringUtils.isBlank(contextId)) {
        throw new RiceIllegalArgumentException("contextId was a null or blank value");
    }

    final Map<String, Object> map = new HashMap<String, Object>();
    map.put("ruleTypeId", ruleTypeId);
    map.put("contextId", contextId);
    ContextValidRuleBo contextValidRuleBo = findSingleMatching(dataObjectService, ContextValidRuleBo.class,
            Collections.unmodifiableMap(map));

    return KrmsTypeBo.to(contextValidRuleBo.getRuleType());
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:KrmsTypeBoServiceImpl.java

示例17: findAllActionTypesByContextId

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Override
public List<KrmsTypeDefinition> findAllActionTypesByContextId(String contextId) {
    if (StringUtils.isBlank(contextId)) {
        throw new RiceIllegalArgumentException("contextId was a null or blank value");
    }

    final Map<String, Object> map = new HashMap<String, Object>();
    map.put("contextId", contextId);
    Collection<ContextValidActionBo> contextValidActionBos = findMatchingOrderBy(dataObjectService,
            ContextValidActionBo.class, Collections.unmodifiableMap(map), "actionType.name", true);
    List<KrmsTypeDefinition> actionTypes = new ArrayList<KrmsTypeDefinition>();

    for (ContextValidActionBo contextValidActionBo : contextValidActionBos) {
        actionTypes.add(KrmsTypeBo.to(contextValidActionBo.getActionType()));
    }

    return actionTypes;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:KrmsTypeBoServiceImpl.java

示例18: getActionTypeByActionTypeIdAndContextId

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Override
public KrmsTypeDefinition getActionTypeByActionTypeIdAndContextId(String actionTypeId, String contextId) {
    if (StringUtils.isBlank(actionTypeId)) {
        throw new RiceIllegalArgumentException("actionTypeId was a null or blank value");
    }

    if (StringUtils.isBlank(contextId)) {
        throw new RiceIllegalArgumentException("contextId was a null or blank value");
    }

    final Map<String, Object> map = new HashMap<String, Object>();
    map.put("actionTypeId", actionTypeId);
    map.put("contextId", contextId);
    ContextValidActionBo contextValidActionBo = findSingleMatching(dataObjectService, ContextValidActionBo.class,
            Collections.unmodifiableMap(map));

    return KrmsTypeBo.to(contextValidActionBo.getActionType());
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:KrmsTypeBoServiceImpl.java

示例19: createKrmsType

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Override
public KrmsTypeDefinition createKrmsType(KrmsTypeDefinition krmsType)
        throws RiceIllegalArgumentException, RiceIllegalStateException {
    // CREATE
    KrmsTypeDefinition orig = this.getTypeByName(krmsType.getNamespace(), krmsType.getName());
    if (orig != null) {
        throw new RiceIllegalArgumentException(krmsType.getNamespace() + "." + krmsType.getName() + " already exists");
    }
    KrmsTypeDefinition.Builder copy = KrmsTypeDefinition.Builder.create(krmsType);
    if (copy.getId() == null) {
        copy.setId(UUID.randomUUID().toString());
    }
    krmsType = copy.build();
    krmsTypeMap.put(krmsType.getId(), krmsType);
    return krmsType;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:17,
代码来源:KrmsTypeRepositoryServiceMockImpl.java

示例20: getPropositionTypeService

点赞 3

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的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

示例21: getTypeDefinition

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
protected KrmsTypeDefinition getTypeDefinition(String typeId) {
	if (StringUtils.isBlank(typeId)) {
		return null;
	}
	KrmsTypeDefinition typeDefinition = typeRepositoryService.getTypeById(typeId);
	if (typeDefinition == null) {
		throw new RepositoryDataException("Failed to locate a type definition for typeId: " + typeId);
	}
	return typeDefinition;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:11,
代码来源:KrmsTypeResolverImpl.java

示例22: createApprovalPeopleFlowActionType

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
/**
 * Creates the KRMS Type for PeopleFlow approval actions.
 */
private KrmsTypeDefinition createApprovalPeopleFlowActionType(KrmsAttributeDefinition peopleFlowIdAttributeDefinition) {
    KrmsTypeRepositoryService krmsTypeRepositoryService = KrmsApiServiceLocator.getKrmsTypeRepositoryService();
    KrmsTypeDefinition.Builder typeDefinition = KrmsTypeDefinition.Builder.create(KrmsConstants.KRMS_NAMESPACE, "approvalPeopleFlowActionType");
    typeDefinition.setServiceName("approvalPeopleFlowActionTypeService");
    KrmsTypeAttribute.Builder attributeDefinition = KrmsTypeAttribute.Builder.create(null, peopleFlowIdAttributeDefinition.getId(), 1);
    typeDefinition.getAttributes().add(attributeDefinition);
    KrmsTypeDefinition approvalPeopleFlowActionType = krmsTypeRepositoryService.createKrmsType(typeDefinition.build());
    assertNotNull(approvalPeopleFlowActionType);
    assertNotNull(approvalPeopleFlowActionType.getId());
    assertEquals(1, approvalPeopleFlowActionType.getAttributes().size());
    assertNotNull(approvalPeopleFlowActionType.getAttributes().get(0).getId());
    assertEquals(approvalPeopleFlowActionType.getId(), approvalPeopleFlowActionType.getAttributes().get(0).getTypeId());
    return approvalPeopleFlowActionType;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:18,
代码来源:KewToRulesEngineIntegrationTest.java

示例23: createContext

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
private ContextBo createContext() {
    // set up a simple default type for the context
    KrmsTypeRepositoryService krmsTypeRepositoryService = KrmsApiServiceLocator.getKrmsTypeRepositoryService();
    KrmsTypeDefinition.Builder typeDefinition = KrmsTypeDefinition.Builder.create(KrmsConstants.KRMS_NAMESPACE, "DefaultContextType");
    KrmsTypeDefinition defaultContextType = krmsTypeRepositoryService.createKrmsType(typeDefinition.build());

    ContextBo contextBo = new ContextBo();
    contextBo.setNamespace(KrmsConstants.KRMS_NAMESPACE);
    contextBo.setName("MyContext");
    contextBo.setTypeId(defaultContextType.getId());
    return dataObjectService.save(contextBo, PersistenceOption.FLUSH);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:13,
代码来源:KewToRulesEngineIntegrationTest.java

示例24: test_createTypeTypeRelation

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Test
public void test_createTypeTypeRelation() {
    KrmsTypeIntegrationGenTest krmsTypeTest = new KrmsTypeIntegrationGenTest();
    krmsTypeTest.setup(); // Note lowercase u
    krmsTypeTest.test_createKrmsType();
    KrmsTypeDefinition krmsType = krmsTypeTest.getKrmsType();
    TypeTypeRelationBoServiceImplGenTest test = TypeTypeRelationBoServiceImplGenTest.create(typeTypeRelationBoServiceImpl);
    test.createTypeTypeRelation(krmsType, krmsType); // TODO gen handle more than 1 of the same type
    typeTypeRelation = test.getTypeTypeRelation();
    assertNotNull(typeTypeRelation);
    assertNotNull(typeTypeRelation.getId());
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:13,
代码来源:TypeTypeRelationIntegrationGenTest.java

示例25: test_createTypeTypeRelationGeneratedId

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Test
public void test_createTypeTypeRelationGeneratedId() {
    KrmsTypeIntegrationGenTest krmsTypeTest = new KrmsTypeIntegrationGenTest();
    krmsTypeTest.setup();
    krmsTypeTest.test_createKrmsType();
    KrmsTypeDefinition krmsType = krmsTypeTest.getKrmsType();
    TypeTypeRelationBoServiceImplGenTest test = TypeTypeRelationBoServiceImplGenTest.create(typeTypeRelationBoServiceImpl);
    test.createTypeTypeRelationGeneratedId(krmsType, krmsType);
    typeTypeRelation = test.getTypeTypeRelation();
    assertNotNull(typeTypeRelation);
    assertNotNull(typeTypeRelation.getId());
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:13,
代码来源:TypeTypeRelationIntegrationGenTest.java

示例26: getActionTypeService

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Override
public ActionTypeService getActionTypeService(ActionDefinition actionDefinition) {
	if (actionDefinition == null) {
		throw new IllegalArgumentException("actionDefinition was null");
	}
	KrmsTypeDefinition typeDefinition = getTypeDefinition(actionDefinition.getTypeId());
	return resolveTypeService(typeDefinition, ActionTypeService.class);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:9,
代码来源:KrmsTypeResolverImpl.java

示例27: createContext

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
private ContextBo createContext(String name, String namespace) {
    KrmsTypeDefinition.Builder typeDefinition = KrmsTypeDefinition.Builder.create(name, namespace);
    typeDefinition.setId("ID");
    KrmsTypeDefinition defaultContextType = typeDefinition.build();

    ContextBo contextBo = new ContextBo();
    contextBo.setNamespace(KrmsConstants.KRMS_NAMESPACE);
    contextBo.setName("MyContext");
    contextBo.setTypeId(defaultContextType.getId());
    return contextBo;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:12,
代码来源:AgendaItemBoTest.java

示例28: getFunctionTypeService

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Override
public FunctionTypeService getFunctionTypeService(FunctionDefinition functionDefinition) {
	if (functionDefinition == null) {
		throw new IllegalArgumentException("functionDefinition was null");
	}
	KrmsTypeDefinition typeDefinition = getTypeDefinition(functionDefinition.getTypeId());
	return resolveTypeService(typeDefinition, FunctionTypeService.class);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:9,
代码来源:KrmsTypeResolverImpl.java

示例29: getAgendaTypesForContexts

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
private List<KrmsTypeDefinition> getAgendaTypesForContexts(List<String> contextNames) {
    List<KrmsTypeDefinition> results = new ArrayList<KrmsTypeDefinition>();

    // collect all the types used for the agendas in our contexts
    for (String contextName : contextNames) {
        String namespace = getNamespaceByContextName(contextName);
        if (StringUtils.isBlank(namespace)) {
            throw new RiceRuntimeException("namespace is " + namespace + " for context with name " + contextName);
        }

        String contextId = getContextRepository().getContextByNameAndNamespace(contextName, namespace).getId();

        // depending on good behavior of getAgendasByContextId which is tested elsewhere
        List<AgendaDefinition> agendas = getAgendaBoService().getAgendasByContextId(contextId);

        // stacked filters here
        if (!CollectionUtils.isEmpty(agendas)) {
            for (AgendaDefinition agenda : agendas) {
                if (agenda.getTypeId() != null) {
                    KrmsTypeDefinition type = getKrmsTypeRepository().getTypeById(agenda.getTypeId());

                    // we depend on working hashcode & equals for KrmsTypeDefinition here
                    if (!results.contains(type)) {
                        results.add(type);
                    }
                }
            }
        }
    }
    return results;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:32,
代码来源:AgendaBoServiceTest.java

示例30: createKrmsActionTypeDefinition

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
protected KrmsTypeDefinition createKrmsActionTypeDefinition(String nameSpace) {
    String ACTION_TYPE_NAME = "KrmsActionResolverType";
    KrmsTypeDefinition krmsActionTypeDefinition =  krmsTypeRepository.getTypeByName(nameSpace, ACTION_TYPE_NAME);

    if (krmsActionTypeDefinition == null) {
        KrmsTypeDefinition.Builder krmsActionTypeDefnBuilder = KrmsTypeDefinition.Builder.create(ACTION_TYPE_NAME, nameSpace);
        krmsActionTypeDefnBuilder.setServiceName("testActionTypeService");
        krmsActionTypeDefinition = krmsTypeRepository.createKrmsType(krmsActionTypeDefnBuilder.build());
    }

    return krmsActionTypeDefinition;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:13,
代码来源:AbstractAgendaBoTest.java

示例31: testUpdateAction

点赞 2

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

    KrmsTypeDefinition krmsTypeDefinition = createKrmsActionTypeDefinition(t1.namespaceName);
    RuleDefinition ruleDefinition = buildTestRuleDefinition(t1.namespaceName, t1.object0);

    ActionDefinition actionDefinition = ActionDefinition.Builder.create(t1.action0_Id,t1.action0_Name,
            t1.namespaceName,krmsTypeDefinition.getId(),ruleDefinition.getId(),1).build();

    assertNull("action should not be in database", ruleManagementService.getAction(t1.action0_Id));

    actionDefinition =  ruleManagementService.createAction(actionDefinition);

    ActionDefinition returnActionDefinition = ruleManagementService.getAction(actionDefinition.getId());
    ActionDefinition.Builder builder = ActionDefinition.Builder.create(returnActionDefinition);
    builder.setDescription("ChangedDescr");

    // primary statement for test
    ruleManagementService.updateAction(builder.build());

    returnActionDefinition = ruleManagementService.getAction(actionDefinition.getId());

    assertNotNull("action not found", returnActionDefinition);
    assertEquals("update action error:","ChangedDescr", returnActionDefinition.getDescription());
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:33,
代码来源:RuleManagementActionDefinitionTest.java

示例32: testDeleteAction

点赞 2

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

    KrmsTypeDefinition krmsTypeDefinition = createKrmsActionTypeDefinition(t2.namespaceName);
    RuleDefinition ruleDefintion = buildTestRuleDefinition(t2.namespaceName, t2.object0);

    ActionDefinition actionDefinition = ActionDefinition.Builder.create(t2.action0_Id,t2.action0_Name,
            t2.namespaceName,krmsTypeDefinition.getId(),ruleDefintion.getId(),1).build();

    assertNull("action should not be in database", ruleManagementService.getAction(t2.action0_Id));

    actionDefinition =  ruleManagementService.createAction(actionDefinition);
    actionDefinition = ruleManagementService.getAction(actionDefinition.getId());
    assertNotNull("action not found", ruleManagementService.getAction(actionDefinition.getId()));

    try {
        // primary statement for test
        ruleManagementService.deleteAction(t2.action0_Id);
        fail("should fail deleteAction not implemented");
    }   catch (RiceIllegalArgumentException e) {
        // RiceIllegalArgumentException ("not implemented yet because not supported by the bo service");
    }

    actionDefinition = ruleManagementService.getAction(actionDefinition.getId());
    assertNotNull("action not found", (Object) actionDefinition);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:34,
代码来源:RuleManagementActionDefinitionTest.java

示例33: getTermResolverTypeService

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Override
public TermResolverTypeService getTermResolverTypeService(TermResolverDefinition termResolverDefinition) {
	if (termResolverDefinition == null) {
		throw new IllegalArgumentException("termResolverDefinition was null");
	}
	KrmsTypeDefinition typeDefinition = getTypeDefinition(termResolverDefinition.getTypeId());
	return resolveTypeService(typeDefinition, TermResolverTypeService.class);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:9,
代码来源:KrmsTypeResolverImpl.java

示例34: createKrmsActionTypeDefinition

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
private KrmsTypeDefinition createKrmsActionTypeDefinition(String nameSpace) {
    KrmsTypeDefinition.Builder krmsActionTypeDefnBuilder = KrmsTypeDefinition.Builder.create("KrmsActionResolverType", nameSpace);
    krmsActionTypeDefnBuilder.setServiceName("testActionTypeService");
    KrmsTypeDefinition krmsActionTypeDefinition = krmsTypeBoService.createKrmsType(krmsActionTypeDefnBuilder.build());

    return krmsActionTypeDefinition;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:8,
代码来源:ValidationIntegrationTest.java

示例35: creationTest

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Test
public void creationTest() {

    // create prerequisite objects
    ContextDefinition contextDefinition = createContext();
    KrmsTypeDefinition krmsTermResolverTypeDefinition = createTermResolverType();

    // output TermSpec
    TermSpecificationDefinition outputTermSpec =
            TermSpecificationDefinition.Builder.create(null, "outputTermSpec", contextDefinition.getId(),
                    "java.lang.String").build();
    outputTermSpec = termBoService.createTermSpecification(outputTermSpec);

    // prereq TermSpec
    TermSpecificationDefinition prereqTermSpec =
            TermSpecificationDefinition.Builder.create(null, "prereqTermSpec", contextDefinition.getId(),
                    "java.lang.String").build();
    prereqTermSpec = termBoService.createTermSpecification(prereqTermSpec);

    // TermResolver
    TermResolverDefinition termResolverDef =
            TermResolverDefinition.Builder.create(null, "KRMS", "testResolver", krmsTermResolverTypeDefinition.getId(),
                    TermSpecificationDefinition.Builder.create(outputTermSpec),
                    Collections.singleton(TermSpecificationDefinition.Builder.create(prereqTermSpec)),
                    null,
                    Collections.singleton("testParamName")).build();
    termResolverDef = termBoService.createTermResolver(termResolverDef);

    // Term Param
    TermParameterDefinition.Builder termParamBuilder =
            TermParameterDefinition.Builder.create(null, null, "testParamName", "testParamValue");

    // Term
    TermDefinition termDefinition =
            TermDefinition.Builder.create(null, TermSpecificationDefinition.Builder.create(outputTermSpec), Collections.singletonList(termParamBuilder)).build();
    termBoService.createTerm(termDefinition);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:38,
代码来源:TermRelatedBoTest.java

示例36: createContext

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
private ContextDefinition createContext() {

        // KrmsType for context
        KrmsTypeDefinition krmsContextTypeDefinition = KrmsTypeDefinition.Builder.create("KrmsTestContextType", "KRMS").build();
        krmsContextTypeDefinition = krmsTypeBoService.createKrmsType(krmsContextTypeDefinition);

        // Context
        ContextDefinition.Builder contextBuilder = ContextDefinition.Builder.create("KRMS", "testContext");
        contextBuilder.setTypeId(krmsContextTypeDefinition.getId());
        ContextDefinition contextDefinition = contextBuilder.build();
        contextDefinition = contextRepository.createContext(contextDefinition);

        return contextDefinition;
    }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:15,
代码来源:TermRelatedBoTest.java

示例37: createTermResolverType

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
private KrmsTypeDefinition createTermResolverType() {
    // KrmsType for TermResolver
    KrmsTypeDefinition krmsTermResolverTypeDefinition = KrmsTypeDefinition.Builder.create("KrmsTestResolverType", "KRMS").build();
    krmsTermResolverTypeDefinition = krmsTypeBoService.createKrmsType(krmsTermResolverTypeDefinition);

    return krmsTermResolverTypeDefinition;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:8,
代码来源:TermRelatedBoTest.java

示例38: createTestSimpleProposition

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的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

示例39: getAgendaTypeService

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
@Override
public AgendaTypeService getAgendaTypeService(AgendaDefinition agendaDefinition) {
    if (agendaDefinition == null) {
        throw new IllegalArgumentException("agendaDefinition was null");
    }
    KrmsTypeDefinition typeDefinition = getTypeDefinition(agendaDefinition.getTypeId());
    return resolveTypeService(typeDefinition, AgendaTypeService.class);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:9,
代码来源:KrmsTypeResolverImpl.java

示例40: getRuleText

点赞 2

import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition; //导入依赖的package包/类
public String getRuleText() {
    StringBuilder resultBuilder = new StringBuilder();
    if (getRule() != null) {
        if (StringUtils.isBlank(getRule().getName())) {
            resultBuilder.append("- unnamed rule -");
        } else {
            resultBuilder.append(getRule().getName());
        }
        if (!StringUtils.isBlank(getRule().getDescription())) {
            resultBuilder.append(": ");
            resultBuilder.append(getRule().getDescription());
        }

        // add a description of the action configured on the rule, if there is one
        if (!CollectionUtils.isEmpty(getRule().getActions())) {
            resultBuilder.append("   [");
            ActionBo action = getRule().getActions().get(0);
            KrmsTypeDefinition krmsTypeDefn = getKrmsTypeRepositoryService().getTypeById(action.getTypeId());
            resultBuilder.append(krmsTypeDefn.getName());
            resultBuilder.append(": ");
            resultBuilder.append(action.getName());

            if (getRule().getActions().size() > 1) {
                resultBuilder.append(" ... ");
            }

            resultBuilder.append("]");
        }
    } else {
        throw new IllegalStateException();
    }

    return resultBuilder.toString();
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:35,
代码来源:AgendaItemBo.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)