001 /*
002 * Copyright 2007 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.ken.service;
017
018 import org.kuali.rice.ken.bo.NotificationMessageDelivery;
019 import org.kuali.rice.ken.document.kew.NotificationWorkflowDocument;
020 import org.kuali.rice.kew.exception.WorkflowException;
021 import org.kuali.rice.kew.service.WorkflowDocument;
022
023
024 /**
025 * The NotificationWorkflowDocumentService class is responsible for housing service methods for interacting with KEW.
026 * @author Kuali Rice Team (rice.collab@kuali.org)
027 */
028 public interface NotificationWorkflowDocumentService {
029 /**
030 * This service method is responsible for creating a NotificationWorkflowDocument for the given user, which in turn,
031 * creates a workflow document in KEW. It then ad-hoc routes the document to the passed in recipient. This
032 * method will be used by the NotificationService.deliverNotification() service method.
033 * @param messageDelivery - the specific NotificationMessageDelivery that is associated with this ad hoc route
034 * @param initiatorUserId - the person/workflow user who is responsible for "initiating" this workflow document
035 * @param recipientUserId - the person/workflow user who will recieve this document via an ad hoc route
036 * @param annotation - a description of the workflow ad hoc route transaction
037 * @return String - the id of the workflow document
038 */
039 public String createAndAdHocRouteNotificationWorkflowDocument(NotificationMessageDelivery messageDelivery, String initiatorUserId,
040 String recipientUserId, String annotation) throws WorkflowException;
041
042 /**
043 * This method is responsible for canceling a workflow document; which in turn simulates the "checking-off"
044 * of a notification in the notification list by the system through an auto-removal.
045 * @param initiatorUserId
046 * @param workflowDocument
047 * @param annotation
048 * @throws WorkflowException
049 */
050 public void clearAllFyisAndAcknowledgeNotificationWorkflowDocument(String initiatorUserId, NotificationWorkflowDocument workflowDocument, String annotation) throws WorkflowException;
051
052 /**
053 * This method is responsible for unconditionally terminating a workflow document, after which there should be no
054 * pending action requests against this document.
055 * @param document workflow document to terminate
056 */
057 public void terminateWorkflowDocument(WorkflowDocument document) throws WorkflowException;
058
059 /**
060 * This service method is responsible for retrieving a NotificationWorkflowDocument from KEW.
061 * @param initiatorUserId
062 * @param workflowDocumentId
063 * @return NotificationWorkflowDocument
064 * @throws WorkflowException
065 */
066 public NotificationWorkflowDocument getNotificationWorkflowDocumentByDocumentId(String initiatorUserId, String workflowDocumentId) throws WorkflowException;
067 }