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


Java RuleResponsibilityBo.setPriority方法代码示例

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


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

示例1: processRuleForDelegationSave

import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
public static void processRuleForDelegationSave(RuleDelegationBo ruleDelegation) {
	RuleBaseValues rule = ruleDelegation.getDelegationRule();
	rule.setDelegateRule(true);
	// certain items on a delegated rule responsibility are inherited from parent responsibility, set them to null
	for (RuleResponsibilityBo responsibility : rule.getRuleResponsibilities()) {
		responsibility.setActionRequestedCd(null);
		responsibility.setPriority(null);
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:WebRuleUtils.java

示例2: parseResponsibility

import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
public RuleResponsibilityBo parseResponsibility(Element element, RuleBaseValues rule) throws XmlException {
    RuleResponsibilityBo responsibility = new RuleResponsibilityBo();
    responsibility.setRuleBaseValues(rule);
    String actionRequested = null;
    String priority = null;
    actionRequested = element.getChildText(ACTION_REQUESTED, element.getNamespace());
    if (StringUtils.isBlank(actionRequested)) {
    	actionRequested = DEFAULT_ACTION_REQUESTED;
    }
    priority = element.getChildText(PRIORITY, element.getNamespace());
    if (StringUtils.isBlank(priority)) {
    	priority = String.valueOf(DEFAULT_RULE_PRIORITY);
    }
    String approvePolicy = element.getChildText(APPROVE_POLICY, element.getNamespace());
    Element delegations = element.getChild(DELEGATIONS, element.getNamespace());
    if (actionRequested == null) {
        throw new XmlException("actionRequested is required on responsibility");
    }
    if (!actionRequested.equals(KewApiConstants.ACTION_REQUEST_COMPLETE_REQ) && !actionRequested.equals(KewApiConstants.ACTION_REQUEST_APPROVE_REQ) && !actionRequested.equals(KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ) && !actionRequested.equals(KewApiConstants.ACTION_REQUEST_FYI_REQ)) {
        throw new XmlException("Invalid action requested code '" + actionRequested + "'");
    }
    if (StringUtils.isBlank(approvePolicy)) {
        approvePolicy = DEFAULT_APPROVE_POLICY;
    }
    if (!approvePolicy.equals(ActionRequestPolicy.ALL.getCode()) && !approvePolicy.equals(ActionRequestPolicy.FIRST.getCode())) {
        throw new XmlException("Invalid approve policy '" + approvePolicy + "'");
    }
    Integer priorityNumber = Integer.valueOf(priority);
    responsibility.setActionRequestedCd(actionRequested);
    responsibility.setPriority(priorityNumber);
    responsibility.setApprovePolicy(approvePolicy);
    
    RuleResponsibilityBo responsibilityNameAndType = CommonXmlParser.parseResponsibilityNameAndType(element);
    if (responsibilityNameAndType == null) {
    	throw new XmlException("Could not locate a valid responsibility declaration on a responsibility on rule with description '" + rule.getDescription() + "'");
    }
    if (responsibilityNameAndType.getRuleResponsibilityType().equals(KewApiConstants.RULE_RESPONSIBILITY_GROUP_ID)
    		&& responsibility.getApprovePolicy().equals(ActionRequestPolicy.ALL.getCode())) {
    	throw new XmlException("Invalid approve policy '" + approvePolicy + "'.  This policy is not supported with Groups.");
    }
    responsibility.setRuleResponsibilityName(responsibilityNameAndType.getRuleResponsibilityName());
    responsibility.setRuleResponsibilityType(responsibilityNameAndType.getRuleResponsibilityType());
    
    return responsibility;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:46,代码来源:RuleXmlParser.java


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