1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.api.action; |
17 | |
|
18 | |
import javax.xml.bind.annotation.XmlEnum; |
19 | |
import javax.xml.bind.annotation.XmlEnumValue; |
20 | |
import javax.xml.bind.annotation.XmlRootElement; |
21 | |
import javax.xml.bind.annotation.XmlType; |
22 | |
|
23 | |
import org.kuali.rice.core.api.mo.common.Coded; |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | 0 | @XmlRootElement(name = "actionType") |
32 | |
@XmlType(name = "ActionTypeType") |
33 | |
@XmlEnum |
34 | |
public enum ActionType implements Coded { |
35 | |
|
36 | 0 | @XmlEnumValue("k") SU_ACKNOWLEDGE("k", "SUPER USER ACKNOWLEDGE"), |
37 | |
|
38 | 0 | @XmlEnumValue("f") SU_FYI("f", "SUPER USER FYI"), |
39 | |
|
40 | 0 | @XmlEnumValue("m") SU_COMPLETE("m", "SUPER USER COMPLETE"), |
41 | |
|
42 | 0 | @XmlEnumValue("v") SU_APPROVE("v", "SUPER USER APPROVE"), |
43 | |
|
44 | 0 | @XmlEnumValue("r") SU_ROUTE_NODE_APPROVE("r", "SUPER USER ROUTE NODE APPROVE"), |
45 | |
|
46 | 0 | @XmlEnumValue("z") SU_RETURN_TO_PREVIOUS("z", "SUPER USER RETURN TO PREVIOUS"), |
47 | |
|
48 | 0 | @XmlEnumValue("d") SU_DISAPPROVE("d", "SUPER USER DISAPPROVE"), |
49 | |
|
50 | 0 | @XmlEnumValue("c") SU_CANCEL("c", "SUPER USER CANCEL"), |
51 | |
|
52 | 0 | @XmlEnumValue("a") SU_BLANKET_APPROVE("a", "SUPER USER BLANKET APPROVE"), |
53 | |
|
54 | 0 | @XmlEnumValue("B") BLANKET_APPROVE("B", "BLANKET APPROVE"), |
55 | |
|
56 | 0 | @XmlEnumValue("F") FYI("F", "FYI"), |
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | 0 | @XmlEnumValue("H") ADHOC_REQUEST("H", "ADHOC REQUEST"), |
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | 0 | @XmlEnumValue("V") ADHOC_REQUEST_REVOKE("V", "ADHOC REQUEST_REVOKE"), |
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | 0 | @XmlEnumValue("S") SAVE("S", "SAVED"), |
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | 0 | @XmlEnumValue("X") CANCEL("X", "CANCEL"), |
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | 0 | @XmlEnumValue("D") DISAPPROVE("D", "DISAPPROVE"), |
82 | |
|
83 | |
|
84 | |
|
85 | |
|
86 | 0 | @XmlEnumValue("K") ACKNOWLEDGE("K", "ACKNOWLEDGE"), |
87 | |
|
88 | |
|
89 | |
|
90 | |
|
91 | 0 | @XmlEnumValue("C") COMPLETE("C", "COMPLETE"), |
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | 0 | @XmlEnumValue("O") ROUTE("O", "ROUTE"), |
97 | |
|
98 | |
|
99 | |
|
100 | |
|
101 | 0 | @XmlEnumValue("A") APPROVE("A", "APPROVE"), |
102 | |
|
103 | |
|
104 | |
|
105 | |
|
106 | 0 | @XmlEnumValue("Z") RETURN_TO_PREVIOUS("Z", "RETURN TO PREVIOUS"), |
107 | |
|
108 | |
|
109 | |
|
110 | |
|
111 | 0 | @XmlEnumValue("R") LOG_MESSAGE("R", "LOG MESSAGE"), |
112 | |
|
113 | |
|
114 | |
|
115 | |
|
116 | 0 | @XmlEnumValue("w") TAKE_GROUP_AUTHORITY("w", "TAKE GROUP AUTHORITY"), |
117 | |
|
118 | |
|
119 | |
|
120 | |
|
121 | 0 | @XmlEnumValue("y") RELEASE_GROUP_AUTHORITY("y", "RELEASE GROUP AUTHORITY"), |
122 | |
|
123 | |
|
124 | |
|
125 | |
|
126 | 0 | @XmlEnumValue("M") MOVE("M", "MOVED"); |
127 | |
|
128 | |
private final String code; |
129 | |
private final String label; |
130 | |
|
131 | 0 | private ActionType(String code, String label) { |
132 | 0 | this.code = code; |
133 | 0 | this.label = label; |
134 | 0 | } |
135 | |
|
136 | |
@Override |
137 | |
public String getCode() { |
138 | 0 | return code; |
139 | |
} |
140 | |
|
141 | |
public String getLabel() { |
142 | 0 | return label; |
143 | |
} |
144 | |
|
145 | |
public static ActionType fromCode(String code) { |
146 | 0 | return fromCode(code, false); |
147 | |
} |
148 | |
|
149 | |
public static ActionType fromCode(String code, boolean allowMissing) { |
150 | 0 | if (code == null) { |
151 | 0 | return null; |
152 | |
} |
153 | 0 | for (ActionType status : values()) { |
154 | 0 | if (status.code.equals(code)) { |
155 | 0 | return status; |
156 | |
} |
157 | |
} |
158 | 0 | if (allowMissing) { |
159 | 0 | return null; |
160 | |
} |
161 | 0 | throw new IllegalArgumentException("Failed to locate the ActionType with the given code: " + code); |
162 | |
} |
163 | |
|
164 | |
} |