本文整理汇总了Java中org.kuali.rice.kew.rule.RuleResponsibilityBo.getPrincipal方法的典型用法代码示例。如果您正苦于以下问题:Java RuleResponsibilityBo.getPrincipal方法的具体用法?Java RuleResponsibilityBo.getPrincipal怎么用?Java RuleResponsibilityBo.getPrincipal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kew.rule.RuleResponsibilityBo
的用法示例。
在下文中一共展示了RuleResponsibilityBo.getPrincipal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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());
}
}
示例2: 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());
}
}
示例3: validate
import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
public void validate(RuleBaseValues ruleBaseValues, List errors) {
if (errors == null) {
errors = new ArrayList();
}
if (getDocumentTypeService().findByName(ruleBaseValues.getDocTypeName()) == null) {
errors.add(new WorkflowServiceErrorImpl("Document Type Invalid", "doctype.documenttypeservice.doctypename.required"));
}
if (ruleBaseValues.getToDateValue().before(ruleBaseValues.getFromDateValue())) {
errors.add(new WorkflowServiceErrorImpl("From Date is later than to date", "routetemplate.ruleservice.daterange.fromafterto"));
}
if (ruleBaseValues.getDescription() == null || ruleBaseValues.getDescription().equals("")) {
errors.add(new WorkflowServiceErrorImpl("Description is required", "routetemplate.ruleservice.description.required"));
}
if (ruleBaseValues.getRuleResponsibilities().isEmpty()) {
errors.add(new WorkflowServiceErrorImpl("A responsibility is required", "routetemplate.ruleservice.responsibility.required"));
} else {
for (Object element : ruleBaseValues.getRuleResponsibilities()) {
RuleResponsibilityBo responsibility = (RuleResponsibilityBo) element;
if (responsibility.getRuleResponsibilityName() != null && KewApiConstants.RULE_RESPONSIBILITY_GROUP_ID.equals(responsibility.getRuleResponsibilityType())) {
if (getGroupService().getGroup(responsibility.getRuleResponsibilityName()) == null) {
errors.add(new WorkflowServiceErrorImpl("Workgroup is invalid", "routetemplate.ruleservice.workgroup.invalid"));
}
} else if (responsibility.getPrincipal() == null && responsibility.getRole() == null) {
errors.add(new WorkflowServiceErrorImpl("User is invalid", "routetemplate.ruleservice.user.invalid"));
}
}
}
if (!errors.isEmpty()) {
throw new WorkflowServiceErrorException("RuleBaseValues validation errors", errors);
}
}
示例4: validate
import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
public void validate(RuleBaseValues ruleBaseValues, List errors) {
if (errors == null) {
errors = new ArrayList();
}
if (getDocumentTypeService().findByName(ruleBaseValues.getDocTypeName()) == null) {
errors.add(new WorkflowServiceErrorImpl("Document Type Invalid", "doctype.documenttypeservice.doctypename.required"));
}
if (ruleBaseValues.getToDateValue().before(ruleBaseValues.getFromDateValue())) {
errors.add(new WorkflowServiceErrorImpl("From Date is later than to date", "routetemplate.ruleservice.daterange.fromafterto"));
}
if (ruleBaseValues.getDescription() == null || ruleBaseValues.getDescription().equals("")) {
errors.add(new WorkflowServiceErrorImpl("Description is required", "routetemplate.ruleservice.description.required"));
}
if (ruleBaseValues.getRuleResponsibilities().isEmpty()) {
errors.add(new WorkflowServiceErrorImpl("A responsibility is required", "routetemplate.ruleservice.responsibility.required"));
} else {
for (Object element : ruleBaseValues.getRuleResponsibilities()) {
RuleResponsibilityBo responsibility = (RuleResponsibilityBo) element;
if (responsibility.getRuleResponsibilityName() != null && KewApiConstants.RULE_RESPONSIBILITY_GROUP_ID.equals(responsibility.getRuleResponsibilityType())) {
if (getGroupService().getGroup(responsibility.getRuleResponsibilityName()) == null) {
errors.add(new WorkflowServiceErrorImpl("Workgroup is invalid", "routetemplate.ruleservice.workgroup.invalid"));
}
} else if (responsibility.getPrincipal() == null && responsibility.getRole() == null) {
errors.add(new WorkflowServiceErrorImpl("User is invalid", "routetemplate.ruleservice.user.invalid"));
}
}
}
if (!errors.isEmpty()) {
throw new WorkflowServiceErrorException("RuleBaseValues validation errors", errors);
}
}
示例5: populateErrorMap
import org.kuali.rice.kew.rule.RuleResponsibilityBo; //导入方法依赖的package包/类
protected boolean populateErrorMap(RuleBaseValues ruleBaseValues){
boolean isValid = true;
if (getDocumentTypeService().findByName(ruleBaseValues.getDocTypeName()) == null) {
this.putFieldError("docTypeName", "doctype.documenttypeservice.doctypename.required");
isValid &= false;
}
if(ruleBaseValues.getName() != null){
if(ruleExists(ruleBaseValues)){
this.putFieldError("name", "routetemplate.ruleservice.name.unique");
isValid &= false;
}
}
/*
* Logic: If both from and to dates exist, make sure toDate is after fromDate
*/
if(ruleBaseValues.getToDateValue() != null && ruleBaseValues.getFromDateValue() != null){
if (ruleBaseValues.getToDateValue().before(ruleBaseValues.getFromDateValue())) {
this.putFieldError("toDate", "error.document.maintainableItems.toDate");
isValid &= false;
}
}
if(!setRuleAttributeErrors(ruleBaseValues)){
isValid &= false;
}
// This doesn't map directly to a single field. It's either the person or the group tab
if (ruleBaseValues.getRuleResponsibilities().isEmpty()) {
this.putFieldError("Responsibilities", "error.document.responsibility.required");
isValid &= false;
} else {
for (RuleResponsibilityBo responsibility : ruleBaseValues.getRuleResponsibilities()) {
if (responsibility.getRuleResponsibilityName() != null && KewApiConstants.RULE_RESPONSIBILITY_GROUP_ID.equals(responsibility.getRuleResponsibilityType())) {
if (getGroupService().getGroup(responsibility.getRuleResponsibilityName()) == null) {
this.putFieldError("Groups", "routetemplate.ruleservice.workgroup.invalid");
isValid &= false;
}
} else if (responsibility.getPrincipal() == null && responsibility.getRole() == null) {
this.putFieldError("Persons", "routetemplate.ruleservice.user.invalid");
isValid &= false;
}
}
}
return isValid;
}