1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.r2.core.constants;
17
18 import org.kuali.student.r2.common.constants.CommonServiceConstants;
19 import org.kuali.student.r2.core.class1.state.dto.StateInfo;
20 import org.kuali.student.r2.core.class1.state.dto.LifecycleInfo;
21
22
23
24
25
26
27
28 public class StateServiceConstants {
29
30
31
32
33 public static final String SERVICE_NAME_LOCAL_PART = "StateService";
34 public static final String NAMESPACE = CommonServiceConstants.REF_OBJECT_URI_GLOBAL_PREFIX + "state";
35 public static final String REF_OBJECT_URI_STATE = NAMESPACE + "/" + StateInfo.class.getSimpleName();
36 public static final String REF_OBJECT_URI_LIFECYCLE = NAMESPACE + "/" + LifecycleInfo.class.getSimpleName();
37
38
39
40
41 public static final String STATE_CHANGE_TYPE_KEY = "kuali.state.change.type";
42
43
44
45
46 public static final String PRECONDITION_STATE_CONSTRAINT_TYPE_KEY = "kuali.state.constraint.type.precondition";
47 public static final String PROPAGATION_STATE_CONSTRAINT_TYPE_KEY = "kuali.state.constraint.type.propagation";
48
49
50
51
52 public static final String STATE_PROPAGATION_TYPE_KEY = "kuali.state.propagation.type";
53
54
55
56
57
58
59 public static final String STATE_CHANGE_LIFECYCLE_KEY = "kuali.state.change.lifecycle";
60 public static final String STATE_CHANGE_STATE_ACTIVE_KEY = "kuali.state.change.state.active";
61
62 public static final String[] STATE_CHANGE_LIFECYCLE_STATE_KEYS = {
63 STATE_CHANGE_STATE_ACTIVE_KEY
64 };
65
66 public static boolean isValidStateChangeState(String possibleState) {
67 if (possibleState == null) {
68 return false;
69 }
70 for (String state: STATE_CHANGE_LIFECYCLE_STATE_KEYS) {
71 if (state.equals(possibleState)) {
72 return true;
73 }
74 }
75 return false;
76 }
77
78
79
80
81 public static final String STATE_CONSTRAINT_LIFECYCLE_KEY = "kuali.state.constraint.lifecycle";
82 public static final String STATE_CONSTRAINT_STATE_ACTIVE_KEY = "kuali.state.constraint.state.active";
83
84 public static final String[] STATE_CONSTRAINT_LIFECYCLE_STATE_KEYS = {
85 STATE_CONSTRAINT_STATE_ACTIVE_KEY
86 };
87
88 public static boolean isValidStateConstraintState(String possibleState) {
89 if (possibleState == null) {
90 return false;
91 }
92 for (String state: STATE_CONSTRAINT_LIFECYCLE_STATE_KEYS) {
93 if (state.equals(possibleState)) {
94 return true;
95 }
96 }
97 return false;
98 }
99
100
101
102
103 public static final String STATE_PROPAGATION_LIFECYCLE_KEY = "kuali.state.propagation.lifecycle";
104 public static final String STATE_PROPAGATION_STATE_ACTIVE_KEY = "kuali.state.propagation.state.active";
105
106 public static final String[] STATE_PROPAGATION_LIFECYCLE_STATE_KEYS = {
107 STATE_PROPAGATION_STATE_ACTIVE_KEY
108 };
109
110 public static boolean isValidStatePropagationState(String possibleState) {
111 if (possibleState == null) {
112 return false;
113 }
114 for (String state: STATE_PROPAGATION_LIFECYCLE_STATE_KEYS) {
115 if (state.equals(possibleState)) {
116 return true;
117 }
118 }
119 return false;
120 }
121 }