本文整理汇总了Java中org.kuali.rice.kew.rule.RuleResponsibilityBo.setVersionNumber方法的典型用法代码示例。如果您正苦于以下问题:Java RuleResponsibilityBo.setVersionNumber方法的具体用法?Java RuleResponsibilityBo.setVersionNumber怎么用?Java RuleResponsibilityBo.setVersionNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kew.rule.RuleResponsibilityBo
的用法示例。
在下文中一共展示了RuleResponsibilityBo.setVersionNumber方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareHiddenDelegationsForRoute
import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
public void prepareHiddenDelegationsForRoute() {
if (showDelegations) {
return;
}
fetchDelegations();
for (Iterator iter = getDelegationRules().iterator(); iter.hasNext();) {
RuleDelegationBo delegation = (RuleDelegationBo) iter.next();
delegation.setDelegateRuleId(null);
delegation.setVersionNumber(null);
delegation.setRuleDelegationId(null);
//delegation.setRuleResponsibility(this);
delegation.setResponsibilityId(null);
RuleBaseValues rule = delegation.getDelegationRule();
rule.setVersionNumber(null);
rule.setPreviousRuleId(rule.getId());
rule.setDocumentId(null);
rule.setId(null);
for (Iterator iterator = rule.getRuleResponsibilities().iterator(); iterator.hasNext();) {
RuleResponsibilityBo responsibility = (RuleResponsibilityBo) iterator.next();
responsibility.setVersionNumber(null);
responsibility.setRuleBaseValuesId(null);
responsibility.setRuleBaseValues(rule);
responsibility.setId(null);
}
for (Iterator iterator = rule.getRuleExtensions().iterator(); iterator.hasNext();) {
RuleExtensionBo extension = (RuleExtensionBo) iterator.next();
extension.setVersionNumber(null);
extension.setRuleBaseValues(rule);
extension.setRuleBaseValuesId(null);
extension.setRuleExtensionId(null);
for (Iterator iter2 = extension.getExtensionValues().iterator(); iter2.hasNext();) {
RuleExtensionValue value = (RuleExtensionValue) iter2.next();
value.setExtension(extension);
value.setLockVerNbr(null);
value.getExtension().setRuleExtensionId(null);
value.setRuleExtensionValueId(null);
}
}
}
}
示例2: makeCurrent
import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
protected void makeCurrent(RuleDelegationBo ruleDelegation, RuleBaseValues rule, boolean isRetroactiveUpdatePermitted) {
PerformanceLogger performanceLogger = new PerformanceLogger();
boolean isGenerateRuleArs = false;
if (isRetroactiveUpdatePermitted) {
isGenerateRuleArs = true;
String generateRuleArs = CoreFrameworkServiceLocator.getParameterService().getParameterValueAsString(KewApiConstants.KEW_NAMESPACE, KRADConstants.DetailTypes.RULE_DETAIL_TYPE, KewApiConstants.RULE_GENERATE_ACTION_REQESTS_IND);
if (!StringUtils.isBlank(generateRuleArs)) {
isGenerateRuleArs = KewApiConstants.YES_RULE_CHANGE_AR_GENERATION_VALUE.equalsIgnoreCase(generateRuleArs);
}
}
Set<String> responsibilityIds = new HashSet<String>();
performanceLogger.log("Preparing rule: " + rule.getDescription());
generateRuleNameIfNeeded(rule);
assignResponsibilityIds(rule);
rule.setCurrentInd(Boolean.TRUE);
Timestamp date = CoreApiServiceLocator.getDateTimeService().getCurrentTimestamp();
rule.setActivationDate(date);
rule.setDeactivationDate(null);
rule.setVersionNumber(null);
rule.setObjectId(null);
RuleBaseValues oldRule = null;
if (rule.getPreviousRuleId() != null) {
oldRule = findRuleBaseValuesById(rule.getPreviousRuleId());
}
if (oldRule != null) {
performanceLogger.log("Setting previous rule: " + oldRule.getId() + " to non current.");
oldRule.setCurrentInd(Boolean.FALSE);
oldRule.setDeactivationDate(date);
responsibilityIds.addAll(getModifiedResponsibilityIds(oldRule, rule));
rule.setVersionNbr(getNextVersionNumber(oldRule));
oldRule = getRuleDAO().save(oldRule);
rule.setPreviousVersion(oldRule);
performanceLogger.log("Saved old rule: " + oldRule.getId());
}
// }
for(RuleResponsibilityBo ruleResponsibilityBo : rule.getRuleResponsibilities()){
if(StringUtils.isBlank(ruleResponsibilityBo.getId())){
ruleResponsibilityBo.setVersionNumber(null);
}
ruleResponsibilityBo.setRuleBaseValues(rule);
}
// now save the new rule
rule = getRuleDAO().save(rule);
performanceLogger.log("Saved rule: " + rule.getId());
boolean isRuleDelegation = ruleDelegation != null;
if (isRuleDelegation) {
// update our reference to the delegation rule, because it could have changed
ruleDelegation.setDelegationRule(rule);
responsibilityIds.add(ruleDelegation.getResponsibilityId());
ruleDelegation.setDelegateRuleId(rule.getId());
getRuleDelegationService().save(ruleDelegation);
}
if (isGenerateRuleArs
&& org.apache.commons.collections.CollectionUtils.isNotEmpty(responsibilityIds)) {
getActionRequestService().updateActionRequestsForResponsibilityChange(responsibilityIds);
}
performanceLogger.log("Time to make current");
}
示例3: createNewRuleVersion
import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
protected RuleBaseValues createNewRuleVersion(RuleBaseValues existingRule, String documentId) throws Exception {
RuleBaseValues rule = new RuleBaseValues();
PropertyUtils.copyProperties(rule, existingRule);
rule.setPreviousVersion(existingRule);
rule.setPreviousRuleId(existingRule.getId());
rule.setId(null);
rule.setActivationDate(null);
rule.setDeactivationDate(null);
rule.setVersionNumber(null);
rule.setDocumentId(documentId);
// TODO: FIXME: need to copy the rule expression here too?
rule.setRuleResponsibilities(new ArrayList<RuleResponsibilityBo>());
for (RuleResponsibilityBo existingResponsibility : existingRule.getRuleResponsibilities()) {
RuleResponsibilityBo responsibility = new RuleResponsibilityBo();
PropertyUtils.copyProperties(responsibility, existingResponsibility);
responsibility.setRuleBaseValues(rule);
responsibility.setRuleBaseValuesId(null);
responsibility.setId(null);
responsibility.setVersionNumber(null);
rule.getRuleResponsibilities().add(responsibility);
// responsibility.setDelegationRules(new ArrayList());
// for (RuleDelegation existingDelegation : (List<RuleDelegation>)existingResponsibility.getDelegationRules()) {
// RuleDelegation delegation = new RuleDelegation();
// PropertyUtils.copyProperties(delegation, existingDelegation);
// delegation.setRuleDelegationId(null);
// delegation.setRuleResponsibility(responsibility);
// delegation.setRuleResponsibilityId(null);
// delegation.setVersionNumber(0L);
// // it's very important that we do NOT recurse down into the delegation rules and reversion those,
// // this is important to how rule versioning works
// responsibility.getDelegationRules().add(delegation);
// }
}
rule.setRuleExtensions(new ArrayList());
for (RuleExtensionBo existingExtension : existingRule.getRuleExtensions()) {
RuleExtensionBo extension = new RuleExtensionBo();
PropertyUtils.copyProperties(extension, existingExtension);
extension.setVersionNumber(new Long(0));
extension.setRuleBaseValues(rule);
extension.setRuleBaseValuesId(null);
extension.setRuleExtensionId(null);
rule.getRuleExtensions().add(extension);
extension.setExtensionValues(new ArrayList<RuleExtensionValue>());
for (RuleExtensionValue existingExtensionValue : extension.getExtensionValues()) {
RuleExtensionValue extensionValue = new RuleExtensionValue();
PropertyUtils.copyProperties(extensionValue, existingExtensionValue);
extensionValue.setExtension(extension);
extensionValue.getExtension().setRuleExtensionId(null);
extensionValue.setLockVerNbr(0);
extensionValue.setRuleExtensionValueId(null);
extension.getExtensionValues().add(extensionValue);
}
}
return rule;
}
示例4: prepareHiddenDelegationsForRoute
import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
public void prepareHiddenDelegationsForRoute() {
if (showDelegations) {
return;
}
fetchDelegations();
for (Iterator iter = getDelegationRules().iterator(); iter.hasNext();) {
RuleDelegationBo delegation = (RuleDelegationBo) iter.next();
delegation.setDelegateRuleId(null);
delegation.setVersionNumber(null);
delegation.setRuleDelegationId(null);
//delegation.setRuleResponsibility(this);
delegation.setResponsibilityId(null);
RuleBaseValues rule = delegation.getDelegationRule();
rule.setVersionNumber(null);
rule.setPreviousRuleId(rule.getId());
rule.setDocumentId(null);
rule.setId(null);
for (Iterator iterator = rule.getRuleResponsibilities().iterator(); iterator.hasNext();) {
RuleResponsibilityBo responsibility = (RuleResponsibilityBo) iterator.next();
responsibility.setVersionNumber(null);
responsibility.setRuleBaseValuesId(null);
responsibility.setRuleBaseValues(rule);
responsibility.setId(null);
}
for (Iterator iterator = rule.getRuleExtensions().iterator(); iterator.hasNext();) {
RuleExtensionBo extension = (RuleExtensionBo) iterator.next();
extension.setVersionNumber(null);
extension.setRuleBaseValues(rule);
extension.setRuleBaseValuesId(null);
extension.setRuleExtensionId(null);
for (Iterator iter2 = extension.getExtensionValues().iterator(); iter2.hasNext();) {
RuleExtensionValue value = (RuleExtensionValue) iter2.next();
value.setExtension(extension);
value.setLockVerNbr(null);
value.setRuleExtensionId(null);
value.setRuleExtensionValueId(null);
}
}
}
}
示例5: createNewRuleVersion
import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
protected RuleBaseValues createNewRuleVersion(RuleBaseValues existingRule, String documentId) throws Exception {
RuleBaseValues rule = new RuleBaseValues();
PropertyUtils.copyProperties(rule, existingRule);
rule.setPreviousVersion(existingRule);
rule.setPreviousRuleId(existingRule.getId());
rule.setId(null);
rule.setActivationDate(null);
rule.setDeactivationDate(null);
rule.setVersionNumber(0L);
rule.setDocumentId(documentId);
// TODO: FIXME: need to copy the rule expression here too?
rule.setRuleResponsibilities(new ArrayList());
for (RuleResponsibilityBo existingResponsibility : (List<RuleResponsibilityBo>)existingRule.getRuleResponsibilities()) {
RuleResponsibilityBo responsibility = new RuleResponsibilityBo();
PropertyUtils.copyProperties(responsibility, existingResponsibility);
responsibility.setRuleBaseValues(rule);
responsibility.setRuleBaseValuesId(null);
responsibility.setId(null);
responsibility.setVersionNumber(0L);
rule.getRuleResponsibilities().add(responsibility);
// responsibility.setDelegationRules(new ArrayList());
// for (RuleDelegation existingDelegation : (List<RuleDelegation>)existingResponsibility.getDelegationRules()) {
// RuleDelegation delegation = new RuleDelegation();
// PropertyUtils.copyProperties(delegation, existingDelegation);
// delegation.setRuleDelegationId(null);
// delegation.setRuleResponsibility(responsibility);
// delegation.setRuleResponsibilityId(null);
// delegation.setVersionNumber(0L);
// // it's very important that we do NOT recurse down into the delegation rules and reversion those,
// // this is important to how rule versioning works
// responsibility.getDelegationRules().add(delegation);
// }
}
rule.setRuleExtensions(new ArrayList());
for (RuleExtensionBo existingExtension : (List<RuleExtensionBo>)existingRule.getRuleExtensions()) {
RuleExtensionBo extension = new RuleExtensionBo();
PropertyUtils.copyProperties(extension, existingExtension);
extension.setVersionNumber(new Long(0));
extension.setRuleBaseValues(rule);
extension.setRuleBaseValuesId(null);
extension.setRuleExtensionId(null);
rule.getRuleExtensions().add(extension);
extension.setExtensionValues(new ArrayList<RuleExtensionValue>());
for (RuleExtensionValue existingExtensionValue : extension.getExtensionValues()) {
RuleExtensionValue extensionValue = new RuleExtensionValue();
PropertyUtils.copyProperties(extensionValue, existingExtensionValue);
extensionValue.setExtension(extension);
extensionValue.setRuleExtensionId(null);
extensionValue.setLockVerNbr(0);
extensionValue.setRuleExtensionValueId(null);
extension.getExtensionValues().add(extensionValue);
}
}
return rule;
}