1 5 package com.opensymphony.workflow.spi.hibernate; 6 7 import com.opensymphony.workflow.spi.Step; 8 9 import java.util.Date ; 10 import java.util.Iterator ; 11 import java.util.List ; 12 13 14 21 public abstract class HibernateStep implements Step { 22 24 Date dueDate; 25 Date finishDate; 26 Date startDate; 27 HibernateWorkflowEntry entry; 28 List previousSteps; 29 String caller; 30 String owner; 31 String status; 32 int actionId; 33 int stepId; 34 long id = -1; 35 36 38 public HibernateStep() { 39 } 40 41 public HibernateStep(HibernateStep step) { 42 this.actionId = step.getActionId(); 43 this.caller = step.getCaller(); 44 this.finishDate = step.getFinishDate(); 45 this.dueDate = step.getDueDate(); 46 this.startDate = step.getStartDate(); 47 48 this.owner = step.getOwner(); 51 this.status = step.getStatus(); 52 this.stepId = step.getStepId(); 53 this.previousSteps = step.getPreviousSteps(); 54 this.entry = step.entry; 55 } 56 57 59 public void setActionId(int actionId) { 60 this.actionId = actionId; 61 } 62 63 public int getActionId() { 64 return actionId; 65 } 66 67 public void setCaller(String caller) { 68 this.caller = caller; 69 } 70 71 public String getCaller() { 72 return caller; 73 } 74 75 public void setDueDate(Date dueDate) { 76 this.dueDate = dueDate; 77 } 78 79 public Date getDueDate() { 80 return dueDate; 81 } 82 83 public void setEntry(HibernateWorkflowEntry entry) { 84 this.entry = entry; 85 } 86 87 public HibernateWorkflowEntry getEntry() { 88 return entry; 89 } 90 91 public long getEntryId() { 92 return entry.getId(); 93 } 94 95 public void setFinishDate(Date finishDate) { 96 this.finishDate = finishDate; 97 } 98 99 public Date getFinishDate() { 100 return finishDate; 101 } 102 103 public void setId(long id) { 104 this.id = id; 105 } 106 107 public long getId() { 108 return id; 109 } 110 111 public void setOwner(String owner) { 112 this.owner = owner; 113 } 114 115 public String getOwner() { 116 return owner; 117 } 118 119 public long[] getPreviousStepIds() { 120 if (previousSteps == null) { 121 return new long[0]; 122 } 123 124 long[] previousStepIds = new long[previousSteps.size()]; 125 int i = 0; 126 127 for (Iterator iterator = previousSteps.iterator(); iterator.hasNext();) { 128 HibernateStep hibernateStep = (HibernateStep) iterator.next(); 129 previousStepIds[i] = hibernateStep.getId(); 130 i++; 131 } 132 133 return previousStepIds; 134 } 135 136 public void setPreviousSteps(List previousSteps) { 137 this.previousSteps = previousSteps; 138 } 139 140 public List getPreviousSteps() { 141 return previousSteps; 142 } 143 144 public void setStartDate(Date startDate) { 145 this.startDate = startDate; 146 } 147 148 public Date getStartDate() { 149 return startDate; 150 } 151 152 public void setStatus(String status) { 153 this.status = status; 154 } 155 156 public String getStatus() { 157 return status; 158 } 159 160 public void setStepId(int stepId) { 161 this.stepId = stepId; 162 } 163 164 public int getStepId() { 165 return stepId; 166 } 167 } 168 | Popular Tags |