01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.workflow.spi.hibernate;
06:
07: import com.opensymphony.workflow.spi.WorkflowEntry;
08:
09: import java.util.ArrayList;
10: import java.util.List;
11:
12: /**
13: * @author Hani
14: */
15: public class HibernateWorkflowEntry implements WorkflowEntry {
16: //~ Instance fields ////////////////////////////////////////////////////////
17:
18: List currentSteps = new ArrayList();
19: List historySteps = new ArrayList();
20: String workflowName;
21: long id = -1;
22: private int state;
23: private int version;
24:
25: //~ Methods ////////////////////////////////////////////////////////////////
26:
27: public void setCurrentSteps(List currentSteps) {
28: this .currentSteps = currentSteps;
29: }
30:
31: public List getCurrentSteps() {
32: return currentSteps;
33: }
34:
35: public void setHistorySteps(List historySteps) {
36: this .historySteps = historySteps;
37: }
38:
39: public List getHistorySteps() {
40: return historySteps;
41: }
42:
43: public void setId(long id) {
44: this .id = id;
45: }
46:
47: public long getId() {
48: return id;
49: }
50:
51: public boolean isInitialized() {
52: return state > 0;
53: }
54:
55: public void setState(int state) {
56: this .state = state;
57: }
58:
59: public int getState() {
60: return state;
61: }
62:
63: public void setWorkflowName(String workflowName) {
64: this .workflowName = workflowName;
65: }
66:
67: public String getWorkflowName() {
68: return workflowName;
69: }
70:
71: public void addCurrentSteps(HibernateCurrentStep step) {
72: step.setEntry(this );
73: getCurrentSteps().add(step);
74: }
75:
76: public void addHistorySteps(HibernateHistoryStep step) {
77: step.setEntry(this );
78: getHistorySteps().add(step);
79: }
80:
81: public void removeCurrentSteps(HibernateCurrentStep step) {
82: getCurrentSteps().remove(step);
83: }
84:
85: protected void setVersion(int version) {
86: this .version = version;
87: }
88:
89: protected int getVersion() {
90: return version;
91: }
92: }
|