本文整理汇总了Java中org.kuali.rice.kew.user.RoleRecipient.getResolvedQualifiedRole方法的典型用法代码示例。如果您正苦于以下问题:Java RoleRecipient.getResolvedQualifiedRole方法的具体用法?Java RoleRecipient.getResolvedQualifiedRole怎么用?Java RoleRecipient.getResolvedQualifiedRole使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kew.user.RoleRecipient
的用法示例。
在下文中一共展示了RoleRecipient.getResolvedQualifiedRole方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addRoleRequest
import org.kuali.rice.kew.user.RoleRecipient; //导入方法依赖的package包/类
/**
* Creates a root Role Request
* @param role
* @param actionRequested
* @param approvePolicy
* @param priority
* @param responsibilityId
* @param forceAction
* @param description
* @param ruleId
* @return the created root role request
*/
public ActionRequestValue addRoleRequest(RoleRecipient role, String actionRequested, String approvePolicy, Integer priority, String responsibilityId, Boolean forceAction, String description, String ruleId) {
ActionRequestValue requestGraph = createActionRequest(actionRequested, priority, role, description, responsibilityId, forceAction, approvePolicy, ruleId, null);
if (role != null && role.getResolvedQualifiedRole() != null && role.getResolvedQualifiedRole().getRecipients() != null) {
int legitimateTargets = 0;
for (Iterator<Id> iter = role.getResolvedQualifiedRole().getRecipients().iterator(); iter.hasNext();) {
Id recipientId = (Id) iter.next();
if (recipientId.isEmpty())
{
throw new WorkflowRuntimeException("Failed to resolve id of type " + recipientId.getClass().getName() + " returned from role '" + role.getRoleName() + "'. Id returned contained a null or empty value.");
}
if (recipientId instanceof UserId)
{
Principal principal = getIdentityHelperService().getPrincipal((UserId) recipientId);
if(KRADUtils.isNotNull(principal)) {
role.setTarget(new KimPrincipalRecipient(principal));
}
} else if (recipientId instanceof GroupId)
{
role.setTarget(new KimGroupRecipient(getIdentityHelperService().getGroup((GroupId) recipientId)));
} else
{
throw new WorkflowRuntimeException("Could not process the given type of id: " + recipientId.getClass());
}
if (role.getTarget() != null)
{
legitimateTargets++;
ActionRequestValue request = createActionRequest(actionRequested, priority, role, description, responsibilityId, forceAction, null, ruleId, null);
request.setParentActionRequest(requestGraph);
requestGraph.getChildrenRequests().add(request);
}
}
if (legitimateTargets == 0) {
LOG.warn("Role did not yield any legitimate recipients");
}
} else {
LOG.warn("Didn't create action requests for action request description '" + description + "' because of null role or null part of role object graph.");
}
requestGraphs.add(requestGraph);
return requestGraph;
}
示例2: addRoleRequest
import org.kuali.rice.kew.user.RoleRecipient; //导入方法依赖的package包/类
/**
* Creates a root Role Request
* @param role
* @param actionRequested
* @param approvePolicy
* @param priority
* @param responsibilityId
* @param forceAction
* @param description
* @param ruleId
* @return the created root role request
*/
public ActionRequestValue addRoleRequest(RoleRecipient role, String actionRequested, String approvePolicy, Integer priority, String responsibilityId, Boolean forceAction, String description, String ruleId) {
ActionRequestValue requestGraph = createActionRequest(actionRequested, priority, role, description, responsibilityId, forceAction, approvePolicy, ruleId, null);
if (role != null && role.getResolvedQualifiedRole() != null && role.getResolvedQualifiedRole().getRecipients() != null) {
int legitimateTargets = 0;
for (Iterator<Id> iter = role.getResolvedQualifiedRole().getRecipients().iterator(); iter.hasNext();) {
Id recipientId = (Id) iter.next();
if (recipientId.isEmpty())
{
throw new WorkflowRuntimeException("Failed to resolve id of type " + recipientId.getClass().getName() + " returned from role '" + role.getRoleName() + "'. Id returned contained a null or empty value.");
}
if (recipientId instanceof UserId)
{
Principal principal = getIdentityHelperService().getPrincipal((UserId) recipientId);
if(ObjectUtils.isNotNull(principal)) {
role.setTarget(new KimPrincipalRecipient(principal));
}
} else if (recipientId instanceof GroupId)
{
role.setTarget(new KimGroupRecipient(getIdentityHelperService().getGroup((GroupId) recipientId)));
} else
{
throw new WorkflowRuntimeException("Could not process the given type of id: " + recipientId.getClass());
}
if (role.getTarget() != null)
{
legitimateTargets++;
ActionRequestValue request = createActionRequest(actionRequested, priority, role, description, responsibilityId, forceAction, null, ruleId, null);
request.setParentActionRequest(requestGraph);
requestGraph.getChildrenRequests().add(request);
}
}
if (legitimateTargets == 0) {
LOG.warn("Role did not yield any legitimate recipients");
}
} else {
LOG.warn("Didn't create action requests for action request description '" + description + "' because of null role or null part of role object graph.");
}
requestGraphs.add(requestGraph);
return requestGraph;
}