当前位置: 首页>>代码示例>>Java>>正文


Java ActionItem.getPrincipalId方法代码示例

本文整理汇总了Java中org.kuali.rice.kew.api.action.ActionItem.getPrincipalId方法的典型用法代码示例。如果您正苦于以下问题:Java ActionItem.getPrincipalId方法的具体用法?Java ActionItem.getPrincipalId怎么用?Java ActionItem.getPrincipalId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.kew.api.action.ActionItem的用法示例。


在下文中一共展示了ActionItem.getPrincipalId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getNextApprovers

import org.kuali.rice.kew.api.action.ActionItem; //导入方法依赖的package包/类
/**
 * Queries workflow to get users who have an approval request for this effort certification.
 * 
 * @return String - names of users (seperated by comma) who have an approval request
 */
public String getNextApprovers() {
    String nextApprovers = "";


    List<ActionItem> actionList = KewApiServiceLocator.getActionListService().getAllActionItems(getDocumentHeader().getDocumentNumber());
    for (ActionItem actionItem : actionList) {
        if (actionItem.getActionRequestCd().equals(KewApiConstants.ACTION_REQUEST_APPROVE_REQ)) {
            String principalId = actionItem.getPrincipalId();
            if (principalId != null) {
                Person person = KimApiServiceLocator.getPersonService().getPerson(actionItem.getPrincipalId());
                if (StringUtils.isBlank(nextApprovers)) {
                    nextApprovers = person.getName();
                }
                else {
                    nextApprovers += "; " + person.getName();
                }

            }
        }
    }

    return nextApprovers;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:29,代码来源:OutstandingCertificationsByOrganization.java

示例2: sendNotification

import org.kuali.rice.kew.api.action.ActionItem; //导入方法依赖的package包/类
@Override
protected void sendNotification(ActionItem actionItem) {
    super.sendNotification(actionItem);

    String enableKENNotificationValue = ConfigContext.getCurrentContextConfig().getProperty(KewApiConstants.ENABLE_KEN_NOTIFICATION);
    boolean enableKENNotification = Boolean.parseBoolean(enableKENNotificationValue);
    // we only send per-user messages to KCB
    if (!enableKENNotification || actionItem.getPrincipalId() != null)
        return;


    // send it off to KCB if available
    MessagingService ms = (MessagingService) GlobalResourceLoader.getService(new QName(KCBConstants.SERVICE_NAMESPACE, KCBServiceNames.KCB_MESSAGING));
    if (ms == null) {
    	LOG.info("Could not locate KCB MessagingService.  Message will not be forwarded to the KCB.");
    	return;
    }
    MessageDTO mvo = new MessageDTO();
    mvo.setChannel("KEW");
    mvo.setContent("i'm a kew notification");
    mvo.setContentType("KEW notification");
    mvo.setDeliveryType(actionItem.getActionRequestCd());
    mvo.setProducer("[email protected]");
    mvo.setTitle(actionItem.getDocLabel() + " - " + actionItem.getDocName() + " - " + actionItem.getDocTitle());
    if (StringUtils.isNotBlank(actionItem.getDocHandlerURL())) {
    	mvo.setUrl(actionItem.getDocHandlerURL() + "?docId=" + actionItem.getDocumentId());
    }
    mvo.setOriginId(String.valueOf(actionItem.getId()));
    try {
        // just assume it's a user at this point...
        mvo.setRecipient(actionItem.getPrincipalId());
        LOG.debug("Sending message to KCB: " + mvo);
        ms.deliver(mvo);
    } catch (Exception e) {
        throw new WorkflowRuntimeException("could not deliver message to KCB", e);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:38,代码来源:KCBNotificationService.java

示例3: shouldNotify

import org.kuali.rice.kew.api.action.ActionItem; //导入方法依赖的package包/类
protected boolean shouldNotify(ActionItem actionItem) {
	try {
           boolean sendEmail = true;
           // Removed preferences items since they will be checked before it sends
           // the email in the action list email service

		// don't send notification if this action item came from a SAVE action and the NOTIFY_ON_SAVE policy is not set
		if (sendEmail && isItemOriginatingFromSave(actionItem) && !shouldNotifyOnSave(actionItem)) {
			sendEmail = false;
		}
		return sendEmail;
	} catch (Exception e) {
		throw new WorkflowRuntimeException("Error loading user with workflow id " + actionItem.getPrincipalId() + " for notification.", e);
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:DefaultNotificationService.java


注:本文中的org.kuali.rice.kew.api.action.ActionItem.getPrincipalId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。