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 import org.kuali.rice.kew.api.KewApiConstants;
25
26 @XmlRootElement(name = "actionRequestStatus")
27 @XmlType(name = "ActionRequestStatusType")
28 @XmlEnum
29 public enum ActionRequestStatus implements Coded {
30
31
32
33
34 @XmlEnumValue(KewApiConstants.ActionRequestStatusVals.DONE)
35 DONE(KewApiConstants.ActionRequestStatusVals.DONE, "DONE"),
36
37
38
39
40 @XmlEnumValue(KewApiConstants.ActionRequestStatusVals.ACTIVATED)
41 ACTIVATED(KewApiConstants.ActionRequestStatusVals.ACTIVATED, "ACTIVATED"),
42
43
44
45
46 @XmlEnumValue(KewApiConstants.ActionRequestStatusVals.INITIALIZED)
47 INITIALIZED(KewApiConstants.ActionRequestStatusVals.INITIALIZED, "INITIALIZED");
48
49 private final String code;
50 private final String label;
51
52 ActionRequestStatus(String code, String label) {
53 this.code = code;
54 this.label = label;
55 }
56
57 @Override
58 public String getCode() {
59 return code;
60 }
61
62 public String getLabel() {
63 return label;
64 }
65
66 public static ActionRequestStatus fromCode(String code) {
67 if (code == null) {
68 return null;
69 }
70 for (ActionRequestStatus request : values()) {
71 if (request.code.equals(code)) {
72 return request;
73 }
74 }
75 throw new IllegalArgumentException("Failed to locate the ActionRequestStatus with the given code: " + code);
76 }
77
78 }