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 is the process' current state - timeStarted, workitem being performed
064: */
065: public class ProcessState implements Serializable {
066:
067: public WorkflowId workflowId;
068: public String processName;
069: public Date timeStarted;
070: public WorkItemId workItemId;
071:
072: /**
073: * Constructor
074: */
075: public ProcessState() {
076: }
077:
078: /**
079: * Sets a workflow ID
080: *
081: * @param workflowId the workflow ID
082: */
083: public void setWorkflowId(WorkflowId id) {
084: workflowId = id;
085: }
086:
087: /**
088: * Gets a workflow ID
089: *
090: * @return workflowId the workflow ID
091: */
092: public WorkflowId getWorkflowId() {
093: return workflowId;
094: }
095:
096: /**
097: * Sets a process name
098: *
099: * @param n the process name
100: */
101: public void setProcessName(String n) {
102: processName = n;
103: }
104:
105: /**
106: * Returns the process name
107: *
108: * @param the process name
109: */
110: public String getProcessName() {
111: return processName;
112: }
113:
114: /**
115: * Sets the time started
116: *
117: * @param d the start time
118: */
119: public void setTimeStarted(Date d) {
120: timeStarted = d;
121: }
122:
123: /**
124: * Gets the time started
125: *
126: * @return d the start time
127: */
128: public Date getTimeStarted() {
129: return timeStarted;
130: }
131:
132: /**
133: * Sets the work item ID
134: *
135: * @param id the work item ID
136: */
137: public void setWorkItemId(WorkItemId id) {
138: workItemId = id;
139: }
140:
141: /**
142: * Gets the work item ID
143: *
144: * @return the work item ID
145: */
146: public WorkItemId getWorkItemId() {
147: return workItemId;
148: }
149:
150: /**
151: * Gets the string representation of this object
152: *
153: * @return the string representation
154: */
155: public String toString() {
156: String result = "";
157: result += "Workflow ID: " + workflowId.getValue() + "\n";
158: result += "Process Name: " + processName + "\n";
159: result += "Time Started: " + timeStarted + "\n";
160: result += "Work Item ID: " + workItemId + "\n";
161: return result;
162: }
163: }
|