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


Java KimRoleRecipient類代碼示例

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


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

示例1: sendAdditionalNotifications

import org.kuali.rice.kew.role.KimRoleRecipient; //導入依賴的package包/類
@Override
protected void sendAdditionalNotifications() {
    super.sendAdditionalNotifications();
    // NOTE: do we need construct w/ nodeInstance here?
    ActionRequestFactory arFactory = new ActionRequestFactory(routeHeader);
    for (Recipient recipient: this.notificationRecipients) {
        if (!(recipient instanceof KimRoleRecipient)) {
            arFactory.addRootActionRequest(ActionRequestType.FYI.getCode(), 0, recipient, "Document was recalled", KewApiConstants.MACHINE_GENERATED_RESPONSIBILITY_ID, null, null, null);
        } else {
            KimRoleRecipient kimRoleRecipient = (KimRoleRecipient) recipient;
            // no qualifications
            Map<String, String> qualifications = Collections.emptyMap();
            LOG.info("Adding KIM Role Request for " + kimRoleRecipient.getRole());
            arFactory.addKimRoleRequest(ActionRequestType.FYI.getCode(), 0, kimRoleRecipient.getRole(),
                                        KimApiServiceLocator.getRoleService().getRoleMembers(Collections.singletonList(kimRoleRecipient.getRole().getId()), qualifications),
                                        "Document was recalled", KewApiConstants.MACHINE_GENERATED_RESPONSIBILITY_ID,
                                        // force action, so the member is notified even if they have already participated in the workflow
                                        // since this is a notification about an exceptional case they should receive
                                        true, ActionRequestPolicy.FIRST.getCode(), "Document was recalled");
        }
    }
    getActionRequestService().activateRequests(arFactory.getRequestGraphs());
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:24,代碼來源:RecallAction.java

示例2: 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類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。