本文整理汇总了Java中org.kuali.rice.kew.rule.PersonRuleResponsibility类的典型用法代码示例。如果您正苦于以下问题:Java PersonRuleResponsibility类的具体用法?Java PersonRuleResponsibility怎么用?Java PersonRuleResponsibility使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PersonRuleResponsibility类属于org.kuali.rice.kew.rule包,在下文中一共展示了PersonRuleResponsibility类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: translateResponsibilitiesForLoad
import org.kuali.rice.kew.rule.PersonRuleResponsibility; //导入依赖的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: processCustomAddCollectionLineBusinessRules
import org.kuali.rice.kew.rule.PersonRuleResponsibility; //导入依赖的package包/类
/**
* This overridden method ...
*
* @see org.kuali.rice.krad.rules.MaintenanceDocumentRuleBase#processCustomAddCollectionLineBusinessRules(org.kuali.rice.krad.maintenance.MaintenanceDocument, java.lang.String, org.kuali.rice.krad.bo.PersistableBusinessObject)
*/
@Override
public boolean processCustomAddCollectionLineBusinessRules(
MaintenanceDocument document, String collectionName,
PersistableBusinessObject line) {
boolean isValid = true;
if(getPersonSectionName().equals(collectionName)){
PersonRuleResponsibility pr = (PersonRuleResponsibility)line;
String name = pr.getPrincipalName();
if(!personExists(name)){
isValid &= false;
this.putFieldError(getPersonSectionName(), "error.document.personResponsibilities.principleDoesNotExist");
}
}else if(getGroupSectionName().equals(collectionName)){
GroupRuleResponsibility gr = (GroupRuleResponsibility)line;
if(!groupExists(gr.getNamespaceCode(), gr.getName())){
isValid &= false;
this.putFieldError(getGroupSectionName(), "error.document.personResponsibilities.groupDoesNotExist");
}
}
return isValid;
}