KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ofbiz > workflow > WfExecutionObject


1 /*
2  * $Id: WfExecutionObject.java 5462 2005-08-05 18:35:48Z jonesde $
3  *
4  * Copyright (c) 2001, 2002 The Open For Business Project - www.ofbiz.org
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
21  * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
22  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  *
24  */

25 package org.ofbiz.workflow;
26
27 import java.sql.Timestamp JavaDoc;
28 import java.util.Iterator JavaDoc;
29 import java.util.List JavaDoc;
30 import java.util.Map JavaDoc;
31
32 import org.ofbiz.entity.GenericDelegator;
33 import org.ofbiz.entity.GenericValue;
34
35 /**
36  * WfExecutionObject - Workflow Execution Object Interface
37  *
38  * @author <a HREF="mailto:jaz@ofbiz.org">Andy Zeneski</a>
39  * @version $Rev: 5462 $
40  * @since 2.0
41  */

42 public interface WfExecutionObject {
43
44     /**
45      * @throws WfException General workflow exception.
46      * @return Current state of this object.
47      */

48     public List JavaDoc workflowStateType() throws WfException;
49
50     /**
51      * @throws WfException General workflow exception.
52      * @return
53      */

54     public List JavaDoc whileOpenType() throws WfException;
55
56     /**
57      * @throws WfException General workflow exception.
58      * @return Reason for not running.
59      */

60     public List JavaDoc whyNotRunningType() throws WfException;
61
62     /**
63      * @throws WfException General workflow exception.
64      * @return Termination art of this process ot activity.
65      */

66     public List JavaDoc howClosedType() throws WfException;
67
68     /**
69      * Retrieve the list of all valid states.
70      * @throws WfException General workflow exception.
71      * @return List of valid states.
72      */

73     public List JavaDoc validStates() throws WfException;
74
75     /**
76      * Retrieve the current state of this process or activity.
77      * @throws WfException General workflow exception
78      * @return Current state.
79      */

80     public String JavaDoc state() throws WfException;
81
82     /**
83      * Set new state for this process or activity.
84      * @param newState New state to be set.
85      * @throws WfException General workflow exception.
86      * @throws InvalidState The state is invalid.
87      * @throws TransitionNotAllowed The transition is not allowed.
88      */

89     public void changeState(String JavaDoc newState) throws WfException, InvalidState, TransitionNotAllowed;
90
91     /**
92      * Getter for attribute 'name'.
93      * @throws WfException General workflow exception.
94      * @return Name of the object.
95      */

96     public String JavaDoc name() throws WfException;
97
98     /**
99      * Setter for attribute 'name'
100      * @param newValue Set the name of the object.
101      * @throws WfException General workflow exception.
102      */

103     public void setName(String JavaDoc newValue) throws WfException;
104
105     /** Getter for the runtime key
106      * @throws WfException
107      * @return Key of the runtime object
108      */

109     public String JavaDoc runtimeKey() throws WfException;
110
111     /**
112      * Getter for definition key
113      * @throws WfException General workflow exception.
114      * @return Key of the definition object.
115      */

116     public String JavaDoc key() throws WfException;
117
118     /**
119      * Getter for attribute 'description'.
120      * @throws WfException General workflow exception.
121      * @return Description of this object.
122      */

123     public String JavaDoc description() throws WfException;
124
125     /**
126      * Setter for attribute 'description'.
127      * @param newValue New value for attribute 'description'.
128      * @throws WfException General workflow exception.
129      */

130     public void setDescription(String JavaDoc newValue) throws WfException;
131
132     /**
133      * Getter for attribute 'context'.
134      * @throws WfException General workflow exception.
135      * @return Process context.
136      */

137     public Map JavaDoc processContext() throws WfException;
138
139     /**
140      * Set the process context
141      * @param newValue Set new process data.
142      * @throws WfException General workflow exception.
143      * @throws InvalidData The data is invalid.
144      * @throws UpdateNotAllowed Update the context is not allowed.
145      */

146     public void setProcessContext(Map JavaDoc newValue) throws WfException, InvalidData, UpdateNotAllowed;
147
148     /**
149      * Set the process context (with previously stored data)
150      * @param newValue RuntimeData entity key.
151      * @throws WfException General workflow exception.
152      * @throws InvalidData The data is invalid.
153      * @throws UpdateNotAllowed Update the context is not allowed.
154      */

155     public void setProcessContext(String JavaDoc newValue) throws WfException, InvalidData, UpdateNotAllowed;
156
157     /**
158      * Get the Runtime Data key (context)
159      * @return String primary key for the runtime (context) data
160      * @throws WfException
161      */

162     public String JavaDoc contextKey() throws WfException;
163
164     /**
165      * Getter for attribute 'priority'.
166      * @throws WfException General workflow exception.
167      * @return Getter Priority of
168      */

169     public long priority() throws WfException;
170
171     /**
172      * Setter for attribute 'priority'.
173      * @param newValue
174      * @throws WfException General workflow exception
175      */

176     public void setPriority(long newValue) throws WfException;
177
178     /**
179      * Resume this process or activity.
180      * @throws WfException General workflow exception.
181      * @throws CannotResume
182      * @throws NotRunning
183      * @throws NotSuspended
184      */

185     public void resume() throws WfException, CannotResume, NotRunning, NotSuspended;
186
187     /**
188      * Suspend this process or activity.
189      * @throws WfException General workflow exception.
190      * @throws CannotSuspend
191      * @throws NotRunning
192      * @throws AlreadySuspended
193      */

194     public void suspend() throws WfException, CannotSuspend, NotRunning, AlreadySuspended;
195
196     /**
197      * Terminate this process or activity.
198      * @throws WfException General workflow exception
199      * @throws CannotStop
200      * @throws NotRunning
201      */

202     public void terminate() throws WfException, CannotStop, NotRunning;
203
204     /**
205      * Abort the execution of this process or activity.
206      * @throws WfException General workflow exception.
207      * @throws CannotStop The execution cannot be sopped.
208      * @throws NotRunning The process or activity is not yet running.
209      */

210     public void abort() throws WfException, CannotStop, NotRunning;
211
212     /**
213      * Getter for history count.
214      * @throws WfException Generall workflow exception
215      * @throws HistoryNotAvailable History can not be retrieved
216      * @return Count of history Elements
217      */

218     public int howManyHistory() throws WfException, HistoryNotAvailable;
219
220     /**
221      * Search in the history for specific elements.
222      * @param query Search criteria.
223      * @param namesInQuery elements to search.
224      * @throws WfException General workflow exception
225      * @throws HistoryNotAvailable
226      * @return Found history elements that meet the search criteria.
227      */

228     public Iterator JavaDoc getIteratorHistory(String JavaDoc query, java.util.Map JavaDoc namesInQuery) throws WfException, HistoryNotAvailable;
229
230     /**
231      * Getter for history sequence.
232      * @param maxNumber Maximum number of element in result list.
233      * @throws WfException General workflow exception.
234      * @throws HistoryNotAvailable
235      * @return List of History objects.
236      */

237     public List JavaDoc getSequenceHistory(int maxNumber) throws WfException, HistoryNotAvailable;
238
239     /**
240      * Predicate to check if a 'member' is an element of the history.
241      * @param member An element of the history.
242      * @throws WfException General workflow exception.
243      * @return true if the element of the history, false otherwise.
244      */

245     public boolean isMemberOfHistory(WfExecutionObject member) throws WfException;
246
247     /**
248      * Getter for timestamp of last state change.
249      * @throws WfException General workflow exception.
250      * @return Timestamp of last state change.
251      */

252     public Timestamp JavaDoc lastStateTime() throws WfException;
253
254     /**
255      * Gets the GenericValue object of the definition.
256      * @returns GenericValue object of the definition.
257      * @throws WfException
258      */

259     public GenericValue getDefinitionObject() throws WfException;
260
261     /**
262      * Gets the GenericValue object of the runtime workeffort.
263      * @returns GenericValue object of the runtime workeffort.
264      * @throws WfException
265      */

266     public GenericValue getRuntimeObject() throws WfException;
267
268     /**
269      * Returns the delegator being used by this workflow
270      * @return GenericDelegator used for this workflow
271      * @throws WfException
272      */

273     public GenericDelegator getDelegator() throws WfException;
274
275 } // interface WfExecutionObjectOperations
276

277
Popular Tags