本文整理汇总了Java中org.kuali.rice.kew.api.action.ActionItem类的典型用法代码示例。如果您正苦于以下问题:Java ActionItem类的具体用法?Java ActionItem怎么用?Java ActionItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActionItem类属于org.kuali.rice.kew.api.action包,在下文中一共展示了ActionItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeNotification
import org.kuali.rice.kew.api.action.ActionItem; //导入依赖的package包/类
@Override
public void removeNotification(List<ActionItem> actionItems) {
String enableKENNotificationValue = ConfigContext.getCurrentContextConfig().getProperty(KewApiConstants.ENABLE_KEN_NOTIFICATION);
boolean enableKENNotification = Boolean.parseBoolean(enableKENNotificationValue);
if (!enableKENNotification) {
return;
}
MessagingService ms = (MessagingService) GlobalResourceLoader.getService(new QName(KCBConstants.SERVICE_NAMESPACE, KCBServiceNames.KCB_MESSAGING));
for (ActionItem actionItem: actionItems) {
LOG.debug("Removing KCB messages for action item: " + actionItem.getId() + " " + actionItem.getActionRequestCd() + " " + actionItem.getPrincipalId());
try {
// we don't have the action takens at this point...? :(
ms.removeByOriginId(String.valueOf(actionItem.getId()), null, null);
} catch (Exception e) {
throw new RuntimeException("could not remove message from KCB", e);
}
}
}
示例2: testGenerateRemindersCustomStyleSheet
import org.kuali.rice.kew.api.action.ActionItem; //导入依赖的package包/类
/**
* tests custom stylesheet
* @throws Exception
*/
@Test
public void testGenerateRemindersCustomStyleSheet() throws Exception {
loadXmlFile("customEmailStyleData.xml");
assertNotNull(CoreServiceApiServiceLocator.getStyleService().getStyle("kew.email.style"));
Person user = KimApiServiceLocator.getPersonService().getPersonByPrincipalName("arh14");
int count = generateDocs(new String[] { "PingDocument", "PingDocumentWithEmailAttrib" }, user);
Collection<ActionItem> actionItems = org.kuali.rice.kew.actionitem.ActionItem.to(new ArrayList<org.kuali.rice.kew.actionitem.ActionItem>(KEWServiceLocator.getActionListService().getActionList(user.getPrincipalId(), null)));
assertEquals("user should have " + count + " items in his action list.", count, actionItems.size());
EmailContent content = styleableContentService.generateImmediateReminder(user, actionItems.iterator().next(), KEWServiceLocator.getDocumentTypeService().findByName(actionItems.iterator().next().getDocName()));
assertTrue("Unexpected subject", content.getSubject().startsWith("CUSTOM:"));
assertTrue("Unexpected body", content.getBody().startsWith("CUSTOM:"));
content = styleableContentService.generateDailyReminder(user, actionItems);
assertTrue("Unexpected subject", content.getSubject().startsWith("CUSTOM:"));
assertTrue("Unexpected body", content.getBody().startsWith("CUSTOM:"));
content = styleableContentService.generateWeeklyReminder(user, actionItems);
assertTrue("Unexpected subject", content.getSubject().startsWith("CUSTOM:"));
assertTrue("Unexpected body", content.getBody().startsWith("CUSTOM:"));
}
示例3: sendImmediateReminder
import org.kuali.rice.kew.api.action.ActionItem; //导入依赖的package包/类
/**
* This overridden method will perform the standard operations from org.kuali.rice.kew.mail.ActionListEmailServiceImpl but will also keep track of action
* items processed
*/
@Override
public void sendImmediateReminder(ActionItem actionItem, Boolean skipOnApprovals) {
if (skipOnApprovals != null && skipOnApprovals.booleanValue()
&& actionItem.getActionRequestCd().equals(KewApiConstants.ACTION_REQUEST_APPROVE_REQ)) {
LOG.debug("As requested, skipping immediate reminder notification on action item approval for " + actionItem.getPrincipalId());
return;
}
List actionItemsSentUser = (List)immediateReminders.get(actionItem.getPrincipalId());
Preferences preferences = getPreferencesService().getPreferences(actionItem.getPrincipalId());
boolean shouldNotify = checkEmailNotificationPreferences(actionItem, preferences, KewApiConstants.EMAIL_RMNDR_IMMEDIATE);
if(shouldNotify) {
if (actionItemsSentUser == null) {
actionItemsSentUser = new ArrayList();
immediateReminders.put(actionItem.getPrincipalId(), actionItemsSentUser);
}
actionItemsSentUser.add(actionItem);
}
}
示例4: immediateReminderEmailsSent
import org.kuali.rice.kew.api.action.ActionItem; //导入依赖的package包/类
public int immediateReminderEmailsSent(String networkId, String documentId, String actionRequestCd) {
Principal principal = KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName(networkId);
List actionItemsSentUser = immediateReminders.get(principal.getPrincipalId());
if (actionItemsSentUser == null) {
LOG.info("There are no immediate reminders for Principal " + networkId + " and Document ID " + documentId);
return 0;
}
else {
LOG.info("There are " + actionItemsSentUser.size() + " immediate reminders for Principal " + networkId + " and Document ID " + documentId);
}
int emailsSent = 0;
for (Iterator iter = actionItemsSentUser.iterator(); iter.hasNext();) {
ActionItem actionItem = (ActionItem) iter.next();
if (actionItem.getDocumentId().equals(documentId) && actionItem.getActionRequestCd().equals(actionRequestCd)) {
emailsSent++;
}
}
LOG.info(emailsSent + "No immediate e-mails were sent to Principal " + networkId + " and Document ID " + documentId);
return emailsSent;
}
示例5: 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;
}
示例6: getLegalActions
import org.kuali.rice.kew.api.action.ActionItem; //导入依赖的package包/类
@Override
public ActionSet getLegalActions(String principalId, ActionItem actionItem) throws Exception {
ActionSet actionSet = ActionSet.Builder.create().build();
actionSet.addAcknowledge();
actionSet.addApprove();
actionSet.addFyi();
actionSet.addComplete();
return actionSet;
}
示例7: getRouteHeadersForActionItems
import org.kuali.rice.kew.api.action.ActionItem; //导入依赖的package包/类
public Map<String,DocumentRouteHeaderValue> getRouteHeadersForActionItems(Collection<ActionItem> actionItems) {
Map<String,DocumentRouteHeaderValue> routeHeaders = new HashMap<String,DocumentRouteHeaderValue>();
List<String> documentIds = new ArrayList<String>(actionItems.size());
for (ActionItem actionItem : actionItems) {
documentIds.add(actionItem.getDocumentId());
}
Collection<DocumentRouteHeaderValue> actionItemRouteHeaders = getRouteHeaders(documentIds);
if (actionItemRouteHeaders != null) {
for (DocumentRouteHeaderValue routeHeader : actionItemRouteHeaders) {
routeHeaders.put(routeHeader.getDocumentId(), routeHeader);
}
}
return routeHeaders;
}
示例8: getCustomEmailAttribute
import org.kuali.rice.kew.api.action.ActionItem; //导入依赖的package包/类
protected static CustomEmailAttribute getCustomEmailAttribute(Person user, ActionItem actionItem) throws WorkflowException {
DocumentRouteHeaderValue routeHeader = KEWServiceLocator.getRouteHeaderService().getRouteHeader(actionItem.getDocumentId());
CustomEmailAttribute customEmailAttribute = routeHeader.getCustomEmailAttribute();
if (customEmailAttribute != null) {
Document routeHeaderVO = DocumentRouteHeaderValue.to(routeHeader);
ActionRequestValue actionRequest = KEWServiceLocator.getActionRequestService().findByActionRequestId(actionItem.getActionRequestId());
ActionRequest actionRequestVO = ActionRequestValue.to(actionRequest);
customEmailAttribute.setRouteHeaderVO(routeHeaderVO);
customEmailAttribute.setActionRequestVO(actionRequestVO);
}
return customEmailAttribute;
}
示例9: addDelegatorElement
import org.kuali.rice.kew.api.action.ActionItem; //导入依赖的package包/类
protected static void addDelegatorElement(Document doc, Element baseElement, ActionItem actionItem) {
Element delegatorElement = doc.createElement("delegator");
if ( (actionItem.getDelegatorPrincipalId() != null) ) {
// add empty delegator element
baseElement.appendChild(delegatorElement);
return;
}
String delegatorType = "";
String delegatorId = "";
String delegatorDisplayValue = "";
if (actionItem.getDelegatorPrincipalId() != null) {
delegatorType = "user";
delegatorId = actionItem.getDelegatorPrincipalId();
Principal delegator = KimApiServiceLocator.getIdentityService().getPrincipal(delegatorId);
if (delegator == null) {
LOG.error("Cannot find user for id " + delegatorId);
delegatorDisplayValue = "USER NOT FOUND";
} else {
delegatorDisplayValue = UserUtils.getTransposedName(GlobalVariables.getUserSession(), delegator);
}
} else if (actionItem.getDelegatorPrincipalId() != null) {
delegatorType = "workgroup";
delegatorId = actionItem.getDelegatorGroupId();
delegatorDisplayValue = KimApiServiceLocator.getGroupService().getGroup(actionItem.getDelegatorGroupId()).getName();
}
delegatorElement.setAttribute("type", delegatorType);
// add the id element
Element idElement = doc.createElement("id");
idElement.appendChild(doc.createTextNode(delegatorId));
delegatorElement.appendChild(idElement);
// add the display value element
Element displayValElement = doc.createElement("displayValue");
displayValElement.appendChild(doc.createTextNode(delegatorDisplayValue));
delegatorElement.appendChild(displayValElement);
baseElement.appendChild(delegatorElement);
}
示例10: addWorkgroupRequestElement
import org.kuali.rice.kew.api.action.ActionItem; //导入依赖的package包/类
protected static void addWorkgroupRequestElement(Document doc, Element baseElement, ActionItem actionItem) {
Element workgroupElement = doc.createElement("workgroupRequest");
if (actionItem.getGroupId() != null) {
// add the id element
Element idElement = doc.createElement("id");
idElement.appendChild(doc.createTextNode(actionItem.getGroupId()));
workgroupElement.appendChild(idElement);
// add the display value element
Element displayValElement = doc.createElement("displayValue");
displayValElement.appendChild(doc.createTextNode(actionItem.getGroupId()));
workgroupElement.appendChild(displayValElement);
}
baseElement.appendChild(workgroupElement);
}
示例11: addSummarizedActionItem
import org.kuali.rice.kew.api.action.ActionItem; //导入依赖的package包/类
/**
* This method is used to add the given {@link ActionItem} to the given {@link org.w3c.dom.Document} in a summarized
* form for use in weekly or daily type reminder e-mails.
*
* @param doc - Document to have the ActionItem added to
* @param actionItem - the action item being added
* @param user - the current user
* @param node - the node object to add the actionItem XML to (defaults to the doc variable if null is passed in)
* @throws Exception
*/
protected void addSummarizedActionItem(Document doc, ActionItem actionItem, Person user, Node node, DocumentRouteHeaderValue routeHeader) throws Exception {
if (node == null) {
node = doc;
}
Element root = doc.createElement("summarizedActionItem");
// add in all items from action list as preliminary default dataset
addTextElement(doc, root, "documentId", actionItem.getDocumentId());
addTextElement(doc, root, "docName", actionItem.getDocName());
addCDataElement(doc, root, "docLabel", actionItem.getDocLabel());
addCDataElement(doc, root, "docTitle", actionItem.getDocTitle());
//DocumentRouteHeaderValue routeHeader = getRouteHeader(actionItem);
addTextElement(doc, root, "docRouteStatus", routeHeader.getDocRouteStatus());
addCDataElement(doc, root, "routeStatusLabel", routeHeader.getRouteStatusLabel());
addTextElement(doc, root, "actionRequestCd", actionItem.getActionRequestCd());
addTextElement(doc, root, "actionRequestLabel", CodeTranslator.getActionRequestLabel(
actionItem.getActionRequestCd()));
addDelegatorElement(doc, root, actionItem);
addTimestampElement(doc, root, "createDate", routeHeader.getCreateDate());
addWorkgroupRequestElement(doc, root, actionItem);
if (actionItem.getDateTimeAssigned() != null)
addTimestampElement(doc, root, "dateAssigned", actionItem.getDateTimeAssigned().toDate());
node.appendChild(root);
}
示例12: sendReminder
import org.kuali.rice.kew.api.action.ActionItem; //导入依赖的package包/类
public void sendReminder(ActionItem actionItem, Boolean skipOnApprovals) {
if (actionItem == null) {
throw new RiceIllegalArgumentException("actionItem was null");
}
if (skipOnApprovals == null) {
skipOnApprovals = false;
}
getActionListEmailService().sendImmediateReminder(actionItem, skipOnApprovals);
}
示例13: customizeActionList
import org.kuali.rice.kew.api.action.ActionItem; //导入依赖的package包/类
@Override
public List<ActionItemCustomization> customizeActionList(String principalId, List<ActionItem> actionItems)
throws RiceIllegalArgumentException {
if (StringUtils.isBlank(principalId)) {
throw new RiceIllegalArgumentException("principalId was null or blank");
}
if (actionItems == null) { actionItems = Collections.emptyList(); }
List<ActionItemCustomization> actionItemCustomizations =
new ArrayList<ActionItemCustomization>(actionItems.size());
for (ActionItem actionItem : actionItems) {
DocumentType documentType = getDocumentTypeService().findByName(actionItem.getDocName());
try { // try to get the custom action list attribute and convert it to an ActionItemCustomization
CustomActionListAttribute customActionListAttribute = null;
if (documentType != null) {
customActionListAttribute = documentType.getCustomActionListAttribute();
}
if (customActionListAttribute == null) {
customActionListAttribute = getDefaultCustomActionListAttribute();
}
ActionItemCustomization actionItemCustomization = ActionItemCustomization.Builder.create(
actionItem.getId(),
customActionListAttribute.getLegalActions(principalId, actionItem),
customActionListAttribute.getDocHandlerDisplayParameters(principalId, actionItem)).build();
// add to our results
actionItemCustomizations.add(actionItemCustomization);
} catch (Exception e) {
LOG.error("Problem loading custom action list attribute for action item " + actionItem.getId(), e);
}
}
return actionItemCustomizations;
}
示例14: getActionItemsForPrincipal
import org.kuali.rice.kew.api.action.ActionItem; //导入依赖的package包/类
@Override
public List<ActionItem> getActionItemsForPrincipal(String principalId) {
incomingParamCheck(principalId, "principalId");
Collection<org.kuali.rice.kew.actionitem.ActionItem> actionItems
= KEWServiceLocator.getActionListService().getActionList(principalId, null);
List<ActionItem> actionItemVOs = new ArrayList<ActionItem>(actionItems.size());
for (org.kuali.rice.kew.actionitem.ActionItem actionItem : actionItems) {
actionItemVOs.add(org.kuali.rice.kew.actionitem.ActionItem.to(actionItem));
}
return actionItemVOs;
}
示例15: getAllActionItems
import org.kuali.rice.kew.api.action.ActionItem; //导入依赖的package包/类
@Override
public List<ActionItem> getAllActionItems(String documentId) {
incomingParamCheck(documentId, "documentId");
Collection<org.kuali.rice.kew.actionitem.ActionItem> actionItems
= KEWServiceLocator.getActionListService().getActionListForSingleDocument(documentId);
List<ActionItem> actionItemVOs = new ArrayList<ActionItem>(actionItems.size());
for (org.kuali.rice.kew.actionitem.ActionItem actionItem : actionItems) {
actionItemVOs.add(org.kuali.rice.kew.actionitem.ActionItem.to(actionItem));
}
return actionItemVOs;
}