Search in sources :

Example 1 with ActionListPriorityComparator

use of org.kuali.kfs.kew.actionlist.dao.impl.ActionListPriorityComparator in project cu-kfs by CU-CommunityApps.

the class DocumentMaintenanceServiceImpl method findActionItem.

private ActionItem findActionItem(ActionItemNoteDetailDto detailDto) {
    Map<String, Object> query = Map.ofEntries(Map.entry(KFSPropertyConstants.PRINCIPAL_ID, detailDto.getPrincipalId()), Map.entry(CUKFSConstants.DOCUMENT_ID, detailDto.getDocHeaderId()));
    Collection<ActionItem> actionItems = businessObjectService.findMatching(ActionItem.class, query);
    ActionItem selectedActionItem = null;
    if (LOG.isDebugEnabled()) {
        LOG.debug("findActionItem, number of action items for principal " + detailDto.getPrincipalId() + " and document number " + detailDto.getDocHeaderId() + " is " + CollectionUtils.size(actionItems));
    }
    if (CollectionUtils.isNotEmpty(actionItems)) {
        selectedActionItem = (ActionItem) Collections.max(actionItems, new ActionListPriorityComparator());
    }
    return selectedActionItem;
}
Also used : ActionListPriorityComparator(org.kuali.kfs.kew.actionlist.dao.impl.ActionListPriorityComparator) ActionItem(org.kuali.kfs.kew.actionitem.ActionItem)

Aggregations

ActionItem (org.kuali.kfs.kew.actionitem.ActionItem)1 ActionListPriorityComparator (org.kuali.kfs.kew.actionlist.dao.impl.ActionListPriorityComparator)1