本文整理汇总了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());
}
}
示例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);
}
示例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());
}
}
}
示例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);
}
示例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);
}