1 23 24 package org.infoglue.cms.entities.mydesktop; 25 26 import java.util.ArrayList ; 27 import java.util.Collections ; 28 import java.util.Date ; 29 import java.util.List ; 30 31 import org.infoglue.cms.entities.kernel.BaseEntityVO; 32 import org.infoglue.cms.util.ConstraintExceptionBuffer; 33 34 39 40 public class WorkflowStepVO implements BaseEntityVO 41 { 42 private static final long serialVersionUID = 1L; 43 44 private WorkflowVO workflow; 45 private Long workflowId; 46 private Integer id; 47 private Integer stepId; 48 private String name; 49 private String status; 50 private String owner; 51 private String caller; 52 private Date startDate; 53 private Date finishDate; 54 private List actions = new ArrayList (); 55 56 public WorkflowStepVO() {} 57 public WorkflowStepVO(final WorkflowVO workflow) 58 { 59 this.workflow = workflow; 60 } 61 62 public WorkflowVO getWorkflow() 63 { 64 return this.workflow; 65 } 66 67 public Integer getId() 68 { 69 return this.id; 70 } 71 72 public void setId(Integer id) 73 { 74 this.id = id; 75 } 76 77 public Long getWorkflowId() 78 { 79 return workflowId; 80 } 81 82 public void setWorkflowId(Long workflowId) 83 { 84 this.workflowId = workflowId; 85 } 86 87 public Integer getStepId() 88 { 89 return this.stepId; 90 } 91 92 public void setStepId(Integer stepId) 93 { 94 this.stepId = stepId; 95 } 96 97 public String getName() 98 { 99 return name; 100 } 101 102 public void setName(String name) 103 { 104 this.name = name; 105 } 106 107 public String getOwner() 108 { 109 return owner; 110 } 111 112 public void setOwner(String owner) 113 { 114 this.owner = owner; 115 } 116 117 public String getCaller() 118 { 119 return caller; 120 } 121 122 public void setCaller(String caller) 123 { 124 this.caller = caller; 125 } 126 127 public Date getFinishDate() 128 { 129 return this.finishDate; 130 } 131 132 public Date getStartDate() 133 { 134 return this.startDate; 135 } 136 137 public String getStatus() 138 { 139 return this.status; 140 } 141 142 public void setFinishDate(Date finishDate) 143 { 144 this.finishDate = finishDate; 145 } 146 147 public void setStartDate(Date startDate) 148 { 149 this.startDate = startDate; 150 } 151 152 public void setStatus(String status) 153 { 154 this.status = status; 155 } 156 157 public List getActions() 158 { 159 return Collections.unmodifiableList(actions); 160 } 161 162 166 public void addAction(WorkflowActionVO action) 167 { 168 if (actions == null) 169 actions = new ArrayList (); 170 171 action.setStep(this); 172 actions.add(action); 173 } 174 175 179 public boolean hasOwner() 180 { 181 return owner != null && owner.length() > 0; 182 } 183 184 189 public boolean isOwner(String user) 190 { 191 return (owner == null) ? owner == user : owner.equalsIgnoreCase(user); 192 } 193 194 public ConstraintExceptionBuffer validate() 195 { 196 return new ConstraintExceptionBuffer(); 197 } 198 199 public String toString() 200 { 201 return new StringBuffer (getClass().getName()) 202 .append(" stepId=").append(stepId) 203 .append(" name=").append(name) 204 .append(" status=").append(status) 205 .append(" owner=").append(owner) 206 .append(" caller=").append(caller) 207 .append(" startDate=").append(startDate) 208 .append(" finishDate=").append(finishDate) 209 .append(" id=").append(id) 210 .append(" workflowId=").append(workflowId).toString(); 211 } 212 } 213 | Popular Tags |