View Javadoc

1   /**
2    * Copyright 2005-2012 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kew.framework.postprocessor;
17  
18  import org.kuali.rice.kew.framework.postprocessor.IDocumentEvent;
19  
20  /**
21   * <p><Title> </p>
22   * <p><Description> </p>
23   * <p><p><p>Copyright: Copyright (c) 2002</p>
24   * <p><p>Company: UIS - Indiana University</p>
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   */
27  public class DocumentRouteLevelChange implements IDocumentEvent {
28  	
29  	// TODO for now we will include the new node-based routing fields onto this object to avoid an interface
30  	// change to the PostProcessor interface.
31  	
32    private static final long serialVersionUID = 785552701611174468L;
33  
34    private String documentId;
35    private String appDocId;
36    private Integer oldRouteLevel;
37    private Integer newRouteLevel;
38    private String oldNodeName;
39    private String newNodeName;
40    private String oldNodeInstanceId;
41    private String newNodeInstanceId;
42    
43    //  this constructor is for backwards compatibility
44    public DocumentRouteLevelChange(String documentId, String appDocId, Integer oldRouteLevel, Integer newRouteLevel) {
45  	  this(documentId, appDocId, oldRouteLevel, newRouteLevel, null, null, null, null);
46    }
47    
48    public DocumentRouteLevelChange(String documentId, String appDocId, Integer oldRouteLevel,
49      Integer newRouteLevel, String oldNodeName, String newNodeName, String oldNodeInstanceId, String newNodeInstanceId) {
50      this.documentId = documentId;
51      this.oldRouteLevel = oldRouteLevel;
52      this.newRouteLevel = newRouteLevel;
53      this.oldNodeName = oldNodeName;
54      this.newNodeName = newNodeName;
55      this.oldNodeInstanceId = oldNodeInstanceId;
56      this.newNodeInstanceId = newNodeInstanceId;
57      this.appDocId = appDocId;
58    }
59  
60    public String getDocumentEventCode() {
61      return ROUTE_LEVEL_CHANGE;
62    }
63  
64    public String getDocumentId() {
65      return documentId;
66    }
67  
68    public Integer getOldRouteLevel() {
69      return oldRouteLevel;
70    }
71  
72    public Integer getNewRouteLevel() {
73      return newRouteLevel;
74    }
75  
76    public String getNewNodeInstanceId() {
77  	return newNodeInstanceId;
78    }
79  
80    public String getNewNodeName() {
81  	return newNodeName;
82    }
83  
84    public String getOldNodeInstanceId() {
85  	return oldNodeInstanceId;
86    }
87  
88    public String getOldNodeName() {
89  	return oldNodeName;
90    }
91  
92    public String toString() {
93      StringBuffer buffer = new StringBuffer();
94      buffer.append("DocumentId ").append(documentId);
95      buffer.append(" changing from routeLevel ").append(oldRouteLevel);
96      buffer.append(" to routeLevel ").append(newRouteLevel);
97  
98      return buffer.toString();
99    }
100 
101   /**
102    * @return
103    */
104   public String getAppDocId() {
105     return appDocId;
106   }
107 }