本文整理汇总了Java中org.kuali.rice.kew.rule.RuleResponsibilityBo.getRuleResponsibilityType方法的典型用法代码示例。如果您正苦于以下问题:Java RuleResponsibilityBo.getRuleResponsibilityType方法的具体用法?Java RuleResponsibilityBo.getRuleResponsibilityType怎么用?Java RuleResponsibilityBo.getRuleResponsibilityType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kew.rule.RuleResponsibilityBo
的用法示例。
在下文中一共展示了RuleResponsibilityBo.getRuleResponsibilityType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: translateResponsibilitiesForLoad
import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
public static void translateResponsibilitiesForLoad(RuleBaseValues rule) {
for (RuleResponsibilityBo responsibility : rule.getRuleResponsibilities()) {
if (responsibility.getRuleResponsibilityType().equals(KewApiConstants.RULE_RESPONSIBILITY_WORKFLOW_ID)) {
PersonRuleResponsibility personResponsibility = new PersonRuleResponsibility();
copyResponsibility(responsibility, personResponsibility);
Principal principal = KEWServiceLocator.getIdentityHelperService().getPrincipal(personResponsibility.getRuleResponsibilityName());
personResponsibility.setPrincipalName(principal.getPrincipalName());
rule.getPersonResponsibilities().add(personResponsibility);
} else if (responsibility.getRuleResponsibilityType().equals(KewApiConstants.RULE_RESPONSIBILITY_GROUP_ID)) {
GroupRuleResponsibility groupResponsibility = new GroupRuleResponsibility();
copyResponsibility(responsibility, groupResponsibility);
Group group = KEWServiceLocator.getIdentityHelperService().getGroup(groupResponsibility.getRuleResponsibilityName());
groupResponsibility.setNamespaceCode(group.getNamespaceCode());
groupResponsibility.setName(group.getName());
rule.getGroupResponsibilities().add(groupResponsibility);
} else if (responsibility.getRuleResponsibilityType().equals(KewApiConstants.RULE_RESPONSIBILITY_ROLE_ID)) {
RoleRuleResponsibility roleResponsibility = new RoleRuleResponsibility();
copyResponsibility(responsibility, roleResponsibility);
rule.getRoleResponsibilities().add(roleResponsibility);
} else {
throw new RiceRuntimeException("Original responsibility with id '" + responsibility.getId() + "' contained a bad type code of '" + responsibility.getRuleResponsibilityType());
}
}
// since we've loaded the responsibilities, let's clear the originals so they don't get serialized to the maint doc XML
rule.getRuleResponsibilities().clear();
}
示例2: exportParentResponsibility
import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
private void exportParentResponsibility(Element parent, RuleDelegationBo delegation) {
Element parentResponsibilityElement = renderer.renderElement(parent, PARENT_RESPONSIBILITY);
RuleResponsibilityBo ruleResponsibility = KEWServiceLocator.getRuleService().findRuleResponsibility(delegation.getResponsibilityId());
renderer.renderTextElement(parentResponsibilityElement, PARENT_RULE_NAME, ruleResponsibility.getRuleBaseValues().getName());
if (ruleResponsibility.isUsingPrincipal()) {
Principal principal = ruleResponsibility.getPrincipal();
renderer.renderTextElement(parentResponsibilityElement, PRINCIPAL_NAME, principal.getPrincipalName());
} else if (ruleResponsibility.isUsingGroup()) {
Group group = ruleResponsibility.getGroup();
Element groupElement = renderer.renderElement(parentResponsibilityElement, GROUP_NAME);
groupElement.setText(group.getName());
groupElement.setAttribute(NAMESPACE, group.getNamespaceCode());
} else if (ruleResponsibility.isUsingRole()) {
renderer.renderTextElement(parentResponsibilityElement, ROLE, ruleResponsibility.getRuleResponsibilityName());
} else {
throw new RiceRuntimeException("Encountered a rule responsibility when exporting with an invalid type of '" + ruleResponsibility.getRuleResponsibilityType());
}
}
示例3: exportRuleDelegationParentResponsibility
import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
private void exportRuleDelegationParentResponsibility(Element parent, RuleDelegationBo delegation) {
Element parentResponsibilityElement = renderer.renderElement(parent, PARENT_RESPONSIBILITY);
RuleResponsibilityBo ruleResponsibility = KEWServiceLocator.getRuleService().findRuleResponsibility(delegation.getResponsibilityId());
renderer.renderTextElement(parentResponsibilityElement, PARENT_RULE_NAME, ruleResponsibility.getRuleBaseValues().getName());
if (ruleResponsibility.isUsingPrincipal()) {
Principal principal = ruleResponsibility.getPrincipal();
renderer.renderTextElement(parentResponsibilityElement, PRINCIPAL_NAME, principal.getPrincipalName());
} else if (ruleResponsibility.isUsingGroup()) {
Group group = ruleResponsibility.getGroup();
Element groupElement = renderer.renderElement(parentResponsibilityElement, GROUP_NAME);
groupElement.setText(group.getName());
groupElement.setAttribute(NAMESPACE, group.getNamespaceCode());
} else if (ruleResponsibility.isUsingRole()) {
renderer.renderTextElement(parentResponsibilityElement, ROLE, ruleResponsibility.getRuleResponsibilityName());
} else {
throw new RiceRuntimeException("Encountered a rule responsibility when exporting with an invalid type of '" + ruleResponsibility.getRuleResponsibilityType());
}
}