1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.rice.kew.actions; |
18 | |
|
19 | |
import java.io.Serializable; |
20 | |
import java.util.ArrayList; |
21 | |
import java.util.List; |
22 | |
|
23 | |
import org.kuali.rice.kew.util.KEWConstants; |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | 0 | public class ActionSet implements Serializable { |
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
private static final long serialVersionUID = 7857749268529671300L; |
37 | 0 | private List<String> actionSet = new ArrayList<String>(); |
38 | |
|
39 | |
public boolean hasAction(String actionCode) { |
40 | 0 | return actionSet.contains(actionCode); |
41 | |
} |
42 | |
|
43 | |
public boolean addAction(String actionCode) { |
44 | 0 | if (!actionSet.contains(actionCode)) { |
45 | 0 | actionSet.add(actionCode); |
46 | 0 | return true; |
47 | |
} |
48 | 0 | return false; |
49 | |
} |
50 | |
|
51 | |
public boolean removeAction(String actionCode) { |
52 | 0 | return actionSet.remove(actionCode); |
53 | |
} |
54 | |
|
55 | |
|
56 | |
|
57 | |
public boolean hasApprove() { |
58 | 0 | return hasAction(KEWConstants.ACTION_TAKEN_APPROVED_CD); |
59 | |
} |
60 | |
|
61 | |
public boolean hasComplete() { |
62 | 0 | return hasAction(KEWConstants.ACTION_TAKEN_COMPLETED_CD); |
63 | |
} |
64 | |
|
65 | |
public boolean hasAcknowledge() { |
66 | 0 | return hasAction(KEWConstants.ACTION_TAKEN_ACKNOWLEDGED_CD); |
67 | |
} |
68 | |
|
69 | |
public boolean hasFyi() { |
70 | 0 | return hasAction(KEWConstants.ACTION_TAKEN_FYI_CD); |
71 | |
} |
72 | |
|
73 | |
public boolean hasDisapprove() { |
74 | 0 | return hasAction(KEWConstants.ACTION_TAKEN_DENIED_CD); |
75 | |
} |
76 | |
|
77 | |
public boolean hasCancel() { |
78 | 0 | return hasAction(KEWConstants.ACTION_TAKEN_CANCELED_CD); |
79 | |
} |
80 | |
|
81 | |
public boolean hasRouted() { |
82 | 0 | return hasAction(KEWConstants.ACTION_TAKEN_ROUTED_CD); |
83 | |
} |
84 | |
|
85 | |
public boolean addApprove() { |
86 | 0 | return addAction(KEWConstants.ACTION_TAKEN_APPROVED_CD); |
87 | |
} |
88 | |
|
89 | |
public boolean addComplete() { |
90 | 0 | return addAction(KEWConstants.ACTION_TAKEN_COMPLETED_CD); |
91 | |
} |
92 | |
|
93 | |
public boolean addAcknowledge() { |
94 | 0 | return addAction(KEWConstants.ACTION_TAKEN_ACKNOWLEDGED_CD); |
95 | |
} |
96 | |
|
97 | |
public boolean addFyi() { |
98 | 0 | return addAction(KEWConstants.ACTION_TAKEN_FYI_CD); |
99 | |
} |
100 | |
|
101 | |
public boolean addDisapprove() { |
102 | 0 | return addAction(KEWConstants.ACTION_TAKEN_DENIED_CD); |
103 | |
} |
104 | |
|
105 | |
public boolean addCancel() { |
106 | 0 | return addAction(KEWConstants.ACTION_TAKEN_CANCELED_CD); |
107 | |
} |
108 | |
|
109 | |
public boolean addRouted() { |
110 | 0 | return addAction(KEWConstants.ACTION_TAKEN_ROUTED_CD); |
111 | |
} |
112 | |
} |