01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04:
05: package com.tctest.spring.bean;
06:
07: import java.io.Serializable;
08:
09: /**
10: * Encapsulates logic for the demo webflow
11: */
12: public class WebFlowBean implements Serializable { // TODO required by SerializedFlowExecutionContinuation
13:
14: public static final String STATEA = "stateA";
15: public static final String STATEB = "stateB";
16: public static final String STATEC = "stateC";
17: public static final String STATED = "stateD";
18: public static final String COMPLETE = "complete";
19:
20: private String state;
21:
22: private String valueA;
23: private String valueB;
24: private String valueC;
25: private String valueD;
26:
27: public String getState() {
28: return state;
29: }
30:
31: public String setState(String state) {
32: this .state = state;
33: return state;
34: }
35:
36: public String setA(String value) {
37: this .valueA = value;
38: setState(value == null ? STATEA : STATEB);
39: return getState();
40: }
41:
42: public String setB(String value) {
43: this .valueB = value;
44: setState(value == null ? STATEB : STATEC);
45: return getState();
46: }
47:
48: public String setC(String value) {
49: this .valueC = value;
50: setState(value == null ? STATEC : STATED);
51: return getState();
52: }
53:
54: public String setD(String value) {
55: this .valueD = value;
56:
57: if (valueA != null && valueB != null && valueC != null
58: && valueD != null) {
59: setState(COMPLETE);
60: } else {
61: setState(STATED);
62: }
63: return getState();
64: }
65:
66: public String getA() {
67: return valueA;
68: }
69:
70: public String getB() {
71: return valueB;
72: }
73:
74: public String getC() {
75: return valueC;
76: }
77:
78: public String getD() {
79: return valueD;
80: }
81:
82: }
|