001/**
002 * Copyright 2005-2016 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 */
016package org.kuali.rice.kew.framework.postprocessor;
017
018import org.kuali.rice.kew.framework.postprocessor.IDocumentEvent;
019
020/**
021 * <p>
022 * <Title>
023 * </p>
024 * <p>
025 * <Description>
026 * </p>
027 * <p>
028 * <p>
029 * <p>
030 * Copyright: Copyright (c) 2002
031 * </p>
032 * <p>
033 * <p>
034 * Company: UIS - Indiana University
035 * </p>
036 * 
037 * @author Kuali Rice Team (rice.collab@kuali.org)
038 */
039public class DocumentRouteStatusChange implements IDocumentEvent {
040
041        private static final long serialVersionUID = -5170568498563302803L;
042        private String appDocId;
043        private String documentId;
044        private String newRouteStatus;
045        private String oldRouteStatus;
046
047        public DocumentRouteStatusChange(String documentId, String appDocId, String oldStatus, String newStatus) {
048                this.documentId = documentId;
049                this.appDocId = appDocId;
050                this.newRouteStatus = newStatus;
051                this.oldRouteStatus = oldStatus;
052        }
053
054        public String getDocumentEventCode() {
055                return ROUTE_STATUS_CHANGE;
056        }
057
058        public String getDocumentId() {
059                return documentId;
060        }
061
062        public String getNewRouteStatus() {
063                return newRouteStatus;
064        }
065
066        public String getOldRouteStatus() {
067                return oldRouteStatus;
068        }
069
070        public String toString() {
071                StringBuffer buffer = new StringBuffer();
072                buffer.append("DocumentId ").append(documentId);
073                buffer.append(" changing from routeStatus ").append(oldRouteStatus);
074                buffer.append(" to routeStatus ").append(newRouteStatus);
075
076                return buffer.toString();
077        }
078
079        /*
080         * (non-Javadoc)
081         * 
082         * @see org.kuali.rice.kew.IDocumentEvent#getAppDocId()
083         */
084        public String getAppDocId() {
085                return this.appDocId;
086        }
087}