當前位置: 首頁>>代碼示例>>Java>>正文


Java KimRoleRecipient.setTarget方法代碼示例

本文整理匯總了Java中org.kuali.rice.kew.role.KimRoleRecipient.setTarget方法的典型用法代碼示例。如果您正苦於以下問題:Java KimRoleRecipient.setTarget方法的具體用法?Java KimRoleRecipient.setTarget怎麽用?Java KimRoleRecipient.setTarget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.kuali.rice.kew.role.KimRoleRecipient的用法示例。


在下文中一共展示了KimRoleRecipient.setTarget方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addKimRoleRequest

import org.kuali.rice.kew.role.KimRoleRecipient; //導入方法依賴的package包/類
/**
  * Generates an ActionRequest graph for the given KIM Responsibilities.  This graph includes any associated delegations.
  */
 public void addKimRoleRequest(String actionRequestedCode, Integer priority, Role role,
         List<RoleMembership> memberships, String description, String responsibilityId, boolean forceAction,
         String actionRequestPolicyCode, String requestLabel) {
 	if (CollectionUtils.isEmpty(memberships)) {
 		LOG.warn("Didn't create action requests for action request description because no role members were defined for role id " + role.getId());
 		return;
 	}
 	
     KimRoleRecipient roleRecipient = new KimRoleRecipient(role);

 	// Creation of a parent graph entry for ????
 	ActionRequestValue requestGraph = null;
 	if ( memberships.size() > 1 ) {
  	requestGraph = createActionRequest(
  	        actionRequestedCode,
  	        priority,
                 roleRecipient,
  	        "", // description
  	        responsibilityId,
  	        forceAction,
  	        actionRequestPolicyCode,
  	        null, // ruleId
  	        null );// annotation
  	requestGraphs.add(requestGraph);
 	}
 	for (RoleMembership membership : memberships) {
 		if ( LOG.isDebugEnabled() ) {
 			LOG.debug( "Processing RoleMembership for action request: " + membership );
 		}
if (MemberType.PRINCIPAL.equals(membership.getType())) {
	roleRecipient.setTarget(new KimPrincipalRecipient(membership.getMemberId()));
} else if (MemberType.GROUP.equals(membership.getType())) {
	roleRecipient.setTarget(new KimGroupRecipient(membership.getMemberId()));
} else {
	throw new RiceRuntimeException("Failed to identify a group or principal on the given RoleMembership:" + membership);
}
ActionRequestValue request = createActionRequest(
        actionRequestedCode,
        priority,
                 roleRecipient,
                 "", // description
        responsibilityId,
        forceAction,
        // If not nested in a parent action request, ensure that the request
        // is first approve so delegations of this request do not require
        // ALL_APPROVE as well
        (memberships.size() == 1) ? ActionRequestPolicy.FIRST.getCode() : actionRequestPolicyCode,
        null, // ruleId
        null); // annotation
// if there is only a single request, don't create the nesting structure
if ( memberships.size() > 1 ) {
	request.setParentActionRequest(requestGraph);
	requestGraph.getChildrenRequests().add(request);
} else {
	requestGraphs.add(request);
}
         generateKimRoleDelegationRequests(membership.getDelegates(), request);
  }
 }
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:63,代碼來源:ActionRequestFactory.java


注:本文中的org.kuali.rice.kew.role.KimRoleRecipient.setTarget方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。