Source Code Cross Referenced for WorkflowState.java in  » Workflow-Engines » xflow1.2 » xflow » common » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » xflow1.2 » xflow.common 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ====================================================================
003:         *
004:         * XFLOW - Process Management System
005:         * Copyright (C) 2003 Rob Tan
006:         * All rights reserved.
007:         *
008:         * Redistribution and use in source and binary forms, with or without
009:         * modification, are permitted provided that the following conditions
010:         * are met:
011:         * 
012:         * 1. Redistributions of source code must retain the above copyright
013:         *    notice, this list of conditions, and the following disclaimer.
014:         *
015:         * 2. Redistributions in binary form must reproduce the above copyright
016:         *    notice, this list of conditions, and the disclaimer that follows 
017:         *    these conditions in the documentation and/or other materials 
018:         *    provided with the distribution.
019:         *
020:         * 3. The name "XFlow" must not be used to endorse or promote products
021:         *    derived from this software without prior written permission.  For
022:         *    written permission, please contact rcktan@yahoo.com
023:         * 
024:         * 4. Products derived from this software may not be called "XFlow", nor
025:         *    may "XFlow" appear in their name, without prior written permission
026:         *    from the XFlow Project Management (rcktan@yahoo.com)
027:         * 
028:         * In addition, we request (but do not require) that you include in the 
029:         * end-user documentation provided with the redistribution and/or in the 
030:         * software itself an acknowledgement equivalent to the following:
031:         *     "This product includes software developed by the
032:         *      XFlow Project (http://xflow.sourceforge.net/)."
033:         * Alternatively, the acknowledgment may be graphical using the logos 
034:         * available at http://xflow.sourceforge.net/
035:         *
036:         * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
037:         * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
038:         * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
039:         * DISCLAIMED.  IN NO EVENT SHALL THE XFLOW AUTHORS OR THE PROJECT
040:         * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
041:         * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
042:         * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
043:         * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
044:         * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
045:         * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
046:         * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
047:         * SUCH DAMAGE.
048:         *
049:         * ====================================================================
050:         * This software consists of voluntary contributions made by many 
051:         * individuals on behalf of the XFlow Project and was originally 
052:         * created by Rob Tan (rcktan@yahoo.com)
053:         * For more information on the XFlow Project, please see:
054:         *           <http://xflow.sourceforge.net/>.
055:         * ====================================================================
056:         */
057:        package xflow.common;
058:
059:        import java.util.*;
060:        import java.io.*;
061:
062:        /**
063:         *  This class represents the workflow's state - its variables and participant process states
064:         */
065:        public class WorkflowState implements  Serializable {
066:
067:            public WorkflowId workflowId;
068:            public String workflowName;
069:            public int version;
070:            public boolean isActive;
071:            public String state;
072:            public String initiator;
073:            public Date timeStarted;
074:            public Date timeEnded;
075:            public HashMap variables; // returns a hash table of Variables
076:            public Vector activeProcesses; // returns a list of ProcessStates for currently active processes
077:
078:            /**
079:             *   Constructor
080:             */
081:            public WorkflowState() {
082:                variables = new HashMap();
083:                activeProcesses = new Vector();
084:            }
085:
086:            /**
087:             *  Sets a workflow ID
088:             *
089:             *  @param workflowId  the workflow ID
090:             */
091:            public void setWorkflowId(WorkflowId wfid) {
092:                workflowId = wfid;
093:            }
094:
095:            /**
096:             *  Gets a workflow ID
097:             *
098:             *  @return workflowId  the workflow ID
099:             */
100:            public WorkflowId getWorkflowId() {
101:                return workflowId;
102:            }
103:
104:            /**
105:             *  Sets a workflow name
106:             *
107:             *  @param name  the workflow name
108:             */
109:            public void setWorkflowName(String name) {
110:                workflowName = name;
111:            }
112:
113:            /**
114:             *  Returns the workflow name
115:             *
116:             *  @return workflowName  the workflow name
117:             */
118:            public String getWorkflowName() {
119:                return workflowName;
120:            }
121:
122:            /**
123:             *  Sets a workflow version
124:             *
125:             *  @param v  the workflow version
126:             */
127:            public void setWorkflowVersion(int v) {
128:                version = v;
129:            }
130:
131:            /**
132:             *  Returns the workflow version
133:             *
134:             *  @param version the workflow version
135:             */
136:            public int getWorkflowVersion() {
137:                return version;
138:            }
139:
140:            /**
141:             *  Sets a workflow state
142:             *
143:             *  @param s  the workflow state name
144:             */
145:            public void setState(String s) {
146:                state = s;
147:            }
148:
149:            /**
150:             *  Returns the workflow state
151:             *
152:             *  @return workflowState  the workflow state name
153:             */
154:            public String getState() {
155:                return state;
156:            }
157:
158:            /**
159:             *  Sets the initiator
160:             *
161:             *  @param s  the initiator (user)
162:             */
163:            public void setInitiator(String s) {
164:                initiator = s;
165:            }
166:
167:            /**
168:             *  Returns the initiator
169:             *
170:             *  @return initiator  the user who initiated the workflow
171:             */
172:            public String getInitiator() {
173:                return initiator;
174:            }
175:
176:            /**
177:             *  Sets the active status 
178:             *
179:             *  @param b the active status
180:             */
181:            public void setIsActive(boolean b) {
182:                isActive = b;
183:            }
184:
185:            /**
186:             *  Gets the active status 
187:             *
188:             *  @return the active status
189:             */
190:            public boolean getIsActive() {
191:                return isActive;
192:            }
193:
194:            /**
195:             *  Sets the time started
196:             *
197:             *  @param d  the start time
198:             */
199:            public void setTimeStarted(Date ts) {
200:                timeStarted = ts;
201:            }
202:
203:            /**
204:             *  Gets the time started
205:             *
206:             *  @return the start time
207:             */
208:            public Date getTimeStarted() {
209:                return timeStarted;
210:            }
211:
212:            /**
213:             *  Sets the time ended
214:             *
215:             *  @param d  the end time
216:             */
217:            public void setTimeEnded(Date ts) {
218:                timeEnded = ts;
219:            }
220:
221:            /**
222:             *  Gets the time ended
223:             *
224:             *  @return the end time
225:             */
226:            public Date getTimeEnded() {
227:                return timeEnded;
228:            }
229:
230:            /**
231:             *  Sets the variables hash map
232:             *
233:             *  @param v the variables hash map
234:             */
235:            public void setVariables(HashMap v) {
236:                variables = v;
237:            }
238:
239:            /**
240:             *  Gets the variables hash map
241:             *
242:             *  @return the variables hash map
243:             */
244:            public HashMap getVariables() {
245:                return variables;
246:            }
247:
248:            /**
249:             *  Sets the vector of ProcessState objects of active processes
250:             *
251:             *  @param v the vector of ProcessState objects
252:             */
253:            public void setActiveProcesses(Vector v) {
254:                activeProcesses = v;
255:            }
256:
257:            /**
258:             *  Gets the vector of ProcessState objects of active processes
259:             *
260:             *  @return the vector of ProcessState objects
261:             */
262:            public Vector getActiveProcesses() {
263:                return activeProcesses;
264:            }
265:
266:            /**
267:             *  Gets the string representation of this object
268:             *
269:             *  @return the string representation
270:             */
271:            public String toString() {
272:                String result = "";
273:                result += "Workflow ID: " + workflowId.getValue() + "\n";
274:                result += "Workflow Name: " + workflowName + "\n";
275:                result += "Workflow Version: " + version + "\n";
276:                result += "IsActive: " + isActive + "\n";
277:                result += "State: " + state + "\n";
278:                result += "Initiator: " + initiator + "\n";
279:                result += "Time Started: " + timeStarted + "\n";
280:                result += "Time Ended: " + timeEnded + "\n";
281:
282:                result += "Variables: \n";
283:                Iterator itr = variables.keySet().iterator();
284:                while (itr.hasNext()) {
285:                    String key = (String) itr.next();
286:                    Object val = variables.get(key);
287:                    result += " Key: " + key;
288:                    result += " Value: " + val + "\n";
289:                }
290:
291:                result += "Processes: \n";
292:                for (int i = 0; i < activeProcesses.size(); i++) {
293:                    ProcessState ps = (ProcessState) activeProcesses
294:                            .elementAt(i);
295:                    result += ps.toString();
296:                }
297:
298:                return result;
299:            }
300:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.