001: /*
002: * Copyright (c) 2002-2003 by OpenSymphony
003: * All rights reserved.
004: */
005: package com.opensymphony.workflow.spi.ojb;
006:
007: import com.opensymphony.workflow.spi.Step;
008:
009: import java.util.Date;
010: import java.util.Iterator;
011: import java.util.List;
012:
013: /**
014: * @author picard
015: * Created on 9 sept. 2003
016: */
017: public abstract class OJBStep implements Step {
018: //~ Instance fields ////////////////////////////////////////////////////////
019:
020: Date dueDate;
021: Date finishDate;
022: Date startDate;
023: List previousSteps;
024: OJBWorkflowEntry entry;
025: String caller;
026: String owner;
027: String status;
028: int actionId;
029: int stepId;
030: long entryId;
031: long id;
032:
033: //~ Constructors ///////////////////////////////////////////////////////////
034:
035: public OJBStep() {
036: super ();
037: }
038:
039: public OJBStep(OJBStep step) {
040: this .actionId = step.getActionId();
041: this .caller = step.getCaller();
042: this .finishDate = step.getFinishDate();
043: this .dueDate = step.getDueDate();
044: this .startDate = step.getStartDate();
045: this .id = step.getId();
046: this .owner = step.getOwner();
047: this .status = step.getStatus();
048: this .stepId = step.getStepId();
049: this .previousSteps = step.getPreviousSteps();
050: }
051:
052: //~ Methods ////////////////////////////////////////////////////////////////
053:
054: public void setActionId(int i) {
055: actionId = i;
056: }
057:
058: public int getActionId() {
059: return actionId;
060: }
061:
062: public void setCaller(String string) {
063: caller = string;
064: }
065:
066: public String getCaller() {
067: return caller;
068: }
069:
070: public void setDueDate(Date date) {
071: dueDate = date;
072: }
073:
074: public Date getDueDate() {
075: return dueDate;
076: }
077:
078: public void setEntry(OJBWorkflowEntry entry) {
079: this .entry = entry;
080: }
081:
082: public OJBWorkflowEntry getEntry() {
083: return entry;
084: }
085:
086: public void setEntryId(long l) {
087: entryId = l;
088: }
089:
090: public long getEntryId() {
091: return entryId;
092: }
093:
094: public void setFinishDate(Date date) {
095: finishDate = date;
096: }
097:
098: public Date getFinishDate() {
099: return finishDate;
100: }
101:
102: public void setId(long l) {
103: id = l;
104: }
105:
106: public long getId() {
107: return id;
108: }
109:
110: public void setOwner(String string) {
111: owner = string;
112: }
113:
114: public String getOwner() {
115: return owner;
116: }
117:
118: public long[] getPreviousStepIds() {
119: if (previousSteps == null) {
120: return new long[0];
121: }
122:
123: long[] previousStepIds = new long[previousSteps.size()];
124: int i = 0;
125:
126: for (Iterator iterator = previousSteps.iterator(); iterator
127: .hasNext();) {
128: OJBStep ojbStep = (OJBStep) iterator.next();
129: previousStepIds[i] = ojbStep.getId();
130: i++;
131: }
132:
133: return previousStepIds;
134: }
135:
136: public void setPreviousSteps(List list) {
137: previousSteps = list;
138: }
139:
140: public List getPreviousSteps() {
141: return previousSteps;
142: }
143:
144: public void setStartDate(Date date) {
145: startDate = date;
146: }
147:
148: public Date getStartDate() {
149: return startDate;
150: }
151:
152: public void setStatus(String string) {
153: status = string;
154: }
155:
156: public String getStatus() {
157: return status;
158: }
159:
160: public void setStepId(int i) {
161: stepId = i;
162: }
163:
164: public int getStepId() {
165: return stepId;
166: }
167: }
|