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


Java RuleResponsibilityBo.setResponsibilityId方法代码示例

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


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

示例1: reconcileWithExistingResponsibility

import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
/**
 * Attempts to reconcile the given RuleResponsibility with the list of existing responsibilities (in the case of a
 * rule being updated via the XML).  This goal of this code is to copy responsibility ids from existing responsibilities
 * to the new responsibility where appropriate.  The code will attempt to find exact matches based on the values found
 * on the responsibilities.
 */
private void reconcileWithExistingResponsibility(RuleResponsibilityBo responsibility, List<RuleResponsibilityBo> existingResponsibilities) {
	if (existingResponsibilities == null || existingResponsibilities.isEmpty()) {
		return;
	}
	RuleResponsibilityBo exactMatch = null;
	for (RuleResponsibilityBo existingResponsibility : existingResponsibilities) {
		if (isExactResponsibilityMatch(responsibility, existingResponsibility)) {
			exactMatch = existingResponsibility;
			break;
		}
	}
	if (exactMatch != null) {
		responsibility.setResponsibilityId(exactMatch.getResponsibilityId());
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:RuleXmlParser.java

示例2: save2

import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
public void save2(RuleBaseValues ruleBaseValues, RuleDelegationBo ruleDelegation, boolean saveDelegations) throws Exception {
    if (ruleBaseValues.getPreviousRuleId() != null) {
        RuleBaseValues oldRule = findRuleBaseValuesById(ruleBaseValues.getPreviousRuleId());
        ruleBaseValues.setPreviousVersion(oldRule);
        ruleBaseValues.setCurrentInd(Boolean.FALSE);
        ruleBaseValues.setVersionNbr(getNextVersionNumber(oldRule));
    }
    if (ruleBaseValues.getVersionNbr() == null) {
        ruleBaseValues.setVersionNbr(Integer.valueOf(0));
    }
    if (ruleBaseValues.getCurrentInd() == null) {
        ruleBaseValues.setCurrentInd(Boolean.FALSE);
    }
    // iterate through all associated responsibilities, and if they are unsaved (responsibilityId is null)
    // set a new id on them, and recursively save any associated delegation rules
    for (Object element : ruleBaseValues.getRuleResponsibilities()) {
        RuleResponsibilityBo responsibility = (RuleResponsibilityBo) element;
        if (responsibility.getResponsibilityId() == null) {
            responsibility.setResponsibilityId(getResponsibilityIdService().getNewResponsibilityId());
        }
        if (saveDelegations) {
            for (Object element2 : responsibility.getDelegationRules()) {
                RuleDelegationBo localRuleDelegation = (RuleDelegationBo) element2;
                save2(localRuleDelegation.getDelegationRule(), localRuleDelegation, true);
            }
        }
    }
    validate2(ruleBaseValues, ruleDelegation, null);
    getRuleDAO().save(ruleBaseValues);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:31,代码来源:RuleServiceInternalImpl.java

示例3: assignResponsibilityIds

import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
private void assignResponsibilityIds(RuleBaseValues rule) {
	for (RuleResponsibilityBo responsibility : rule.getRuleResponsibilities()) {
		if (responsibility.getResponsibilityId() == null) {
			responsibility.setResponsibilityId(KEWServiceLocator.getResponsibilityIdService().getNewResponsibilityId());
		}
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:RuleServiceInternalImpl.java

示例4: clearResponsibilityKeys

import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
private static void clearResponsibilityKeys(RuleResponsibilityBo responsibility) {
responsibility.setResponsibilityId(null);
responsibility.setId(null);
responsibility.setRuleBaseValuesId(null);
  }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:6,代码来源:WebRuleUtils.java

示例5: setupRuleBaseValues

import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
private RuleBaseValues setupRuleBaseValues() {
    final RuleBaseValues rbv = new RuleBaseValues();
    rbv.setActive(Boolean.TRUE);
    rbv.setCurrentInd(Boolean.TRUE);
    rbv.setDescription("A test rule");
    rbv.setDocTypeName("TestDocumentType");
    rbv.setForceAction(Boolean.FALSE);



    RuleResponsibilityBo ruleResponsibilityBo = new RuleResponsibilityBo();
    ruleResponsibilityBo.setResponsibilityId("1234");
    ruleResponsibilityBo.setRuleBaseValues(rbv);
    ruleResponsibilityBo.setRuleResponsibilityName("user2");
    ruleResponsibilityBo.setRuleResponsibilityType(KewApiConstants.RULE_RESPONSIBILITY_WORKFLOW_ID);
    rbv.getRuleResponsibilities().add(ruleResponsibilityBo);

    RuleTemplateBo ruleTemplate = new RuleTemplateBo();
    ruleTemplate.setName("test");
    ruleTemplate.setDescription("description");
    rbv.setRuleTemplate(ruleTemplate);

    RuleTemplateOptionBo ruleTemplateOptionBo = new RuleTemplateOptionBo();
    ruleTemplateOptionBo.setCode("TST");
    ruleTemplateOptionBo.setValue("VAL");
    ruleTemplateOptionBo.setRuleTemplate(ruleTemplate);
    ruleTemplate.getRuleTemplateOptions().add(ruleTemplateOptionBo);

    RuleTemplateAttributeBo ruleTemplateAttributeBo = new RuleTemplateAttributeBo();
    ruleTemplateAttributeBo.setActive(true);
    ruleTemplateAttributeBo.setDefaultValue("testAttr");
    ruleTemplateAttributeBo.setDisplayOrder(1);
    ruleTemplateAttributeBo.setRequired(true);
    ruleTemplateAttributeBo.setRuleTemplate(ruleTemplate);

    RuleAttribute ruleAttribute = setupRuleAttribute();
    ruleTemplateAttributeBo.setRuleAttribute(ruleAttribute);

    ruleTemplate.getRuleTemplateAttributes().add(ruleTemplateAttributeBo);


    RuleExpressionDef ruleExpressionDef = new RuleExpressionDef();
    ruleExpressionDef.setExpression("test");
    ruleExpressionDef.setType("TST");

    rbv.setRuleExpressionDef(ruleExpressionDef);

    RuleExtensionBo ext = new RuleExtensionBo();
    RuleExtensionValue val = new RuleExtensionValue();
    val.setKey("emptyvalue");
    val.setValue("testing");
    val.setExtension(ext);
    ext.getExtensionValues().add(val);
    ext.setRuleBaseValues(rbv);
    ext.setRuleTemplateAttribute(ruleTemplateAttributeBo);
    rbv.getRuleExtensions().add(ext);

    return KRADServiceLocator.getDataObjectService().save(rbv);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:60,代码来源:KewRuleDataJpaTest.java


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