001: package org.emforge.xfer;
002:
003: import java.util.Date;
004:
005: /** Transfer Object for transferring data about Step
006: *
007: */
008: public class StepTO {
009: private Long id;
010: private Long taskId;
011: private String actor;
012: private String swimlane;
013: private String title;
014: private String name;
015: private PriorityTO priority;
016: private Date plannedStartTime;
017: private Date actualStartTime;
018: private Date dueDate;
019: private boolean hasEnded;
020: private String taskHelp;
021:
022: private VariableTO[] writableVariables;
023: private TransitionTO[] transitions;
024:
025: // followed 6 fields dublicates information with TaskTO - but we need them in StepTO also
026: private String projectName;
027: private String milestoneName;
028: private String taskOwner;
029:
030: private String workflowName;
031: private Integer workflowVersion;
032: private String workflowIconLink;
033:
034: /** Default empty contstructor */
035: public StepTO() {
036:
037: }
038:
039: /** Step Id */
040: public Long getId() {
041: return id;
042: }
043:
044: public void setId(Long i_id) {
045: id = i_id;
046: }
047:
048: /** ID of task, owned this step */
049: public Long getTaskId() {
050: return taskId;
051: }
052:
053: public void setTaskId(Long i_taskId) {
054: taskId = i_taskId;
055: }
056:
057: /** Task/Step title */
058: public String getTitle() {
059: return title;
060: }
061:
062: public void setTitle(String i_title) {
063: title = i_title;
064: }
065:
066: /** Step Name */
067: public String getName() {
068: return name;
069: }
070:
071: public void setName(String i_name) {
072: name = i_name;
073: }
074:
075: /** Step Priority
076: *
077: * It may be different from Task Priority.
078: * For example - somebody create some task with ASAP priority.
079: * During processing this task, some step is assigned to some actor.
080: * But -this actor (like Big-Boss :) ) has huge amount much more important ASAP tasks to do
081: * So, he can change priority for this assigned to him step to lower level.
082: * This changes will not affect whole task priority
083: */
084: public PriorityTO getPriority() {
085: return priority;
086: }
087:
088: public void setPriority(PriorityTO i_priority) {
089: priority = i_priority;
090: }
091:
092: /** Owner of step - user or group this step currently assigned to */
093: public String getActor() {
094: return actor;
095: }
096:
097: public void setActor(String i_actor) {
098: actor = i_actor;
099: }
100:
101: /** In case then task should be assigned to some swimlane this field contains name of this swimlane
102: *
103: * In EmForge swimlanes are linked with project roles
104: */
105: public String getSwimlane() {
106: return swimlane;
107: }
108:
109: public void setSwimlane(String i_swimlane) {
110: swimlane = i_swimlane;
111: }
112:
113: /** When it was planned to start this step */
114: public Date getPlannedStartTime() {
115: return plannedStartTime;
116: }
117:
118: public void setPlannedStartTime(Date i_plannedStartTime) {
119: plannedStartTime = i_plannedStartTime;
120: }
121:
122: /** When step was really started */
123: public Date getActualStartTime() {
124: return actualStartTime;
125: }
126:
127: public void setActualStartTime(Date i_actualStartTime) {
128: actualStartTime = i_actualStartTime;
129: }
130:
131: /** When step should be finished */
132: public Date getDueDate() {
133: return dueDate;
134: }
135:
136: public void setDueDate(Date i_dueDate) {
137: dueDate = i_dueDate;
138: }
139:
140: /** Is step already ended? */
141: public boolean isHasEnded() {
142: return hasEnded;
143: }
144:
145: public void setHasEnded(boolean i_hasEnded) {
146: hasEnded = i_hasEnded;
147: }
148:
149: /** Get help information for this step */
150: public String getTaskHelp() {
151: return taskHelp;
152: }
153:
154: public void setTaskHelp(String i_taskHelp) {
155: taskHelp = i_taskHelp;
156: }
157:
158: /** Waribles, that may be (or should be) changed during processing this step */
159: public VariableTO[] getWritableVariables() {
160: return writableVariables;
161: }
162:
163: public void setWritableVariables(VariableTO[] i_writableVariables) {
164: writableVariables = i_writableVariables;
165: }
166:
167: /** Returns Variable by name
168: *
169: * @param varName
170: * @return
171: */
172: public VariableTO getVariable(String varName) {
173: if (writableVariables == null) {
174: return null;
175: }
176:
177: for (VariableTO var : writableVariables) {
178: if (var.getLabel().equals(varName)) {
179: return var;
180: }
181: }
182:
183: return null;
184: }
185:
186: /** Set new variable value
187: *
188: * @param name
189: * @param value
190: */
191: public void setVariable(String name, String value) {
192: VariableTO var = getVariable(name);
193:
194: if (var == null) {
195: var = new VariableTO();
196: var.setLabel(name);
197: var.setWritable(true);
198: var.setReadable(true);
199: }
200:
201: var.setValue(value);
202: }
203:
204: /** Name of project step's task assigned to */
205: public String getProjectName() {
206: return projectName;
207: }
208:
209: public void setProjectName(String i_projectName) {
210: projectName = i_projectName;
211: }
212:
213: /** Name of milestone, step's task assigned to */
214: public String getMilestoneName() {
215: return milestoneName;
216: }
217:
218: public void setMilestoneName(String i_milestoneName) {
219: milestoneName = i_milestoneName;
220: }
221:
222: /** List of output transactions, allowed from this step
223: *
224: * @return
225: */
226: public TransitionTO[] getTransitions() {
227: return transitions;
228: }
229:
230: public void setTransitions(TransitionTO[] i_transitions) {
231: transitions = i_transitions;
232: }
233:
234: /** Name of workflow, used for step's task */
235: public String getWorkflowName() {
236: return workflowName;
237: }
238:
239: public void setWorkflowName(String i_workflowName) {
240: workflowName = i_workflowName;
241: }
242:
243: /** Version of workflow, used for step's task */
244: public Integer getWorkflowVersion() {
245: return workflowVersion;
246: }
247:
248: public void setWorkflowVersion(Integer i_workflowVersion) {
249: workflowVersion = i_workflowVersion;
250: }
251:
252: /** User, started the task */
253: public String getTaskOwner() {
254: return taskOwner;
255: }
256:
257: public void setTaskOwner(String i_taskOwner) {
258: taskOwner = i_taskOwner;
259: }
260:
261: /** link to workflow icon (if exists)
262: *
263: * @return
264: */
265: public String getWorkflowIconLink() {
266: return workflowIconLink;
267: }
268:
269: public void setWorkflowIconLink(String i_workflowIconLink) {
270: workflowIconLink = i_workflowIconLink;
271: }
272: }
|