1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kim.bo.ui;
17
18 import javax.persistence.CascadeType;
19 import javax.persistence.Column;
20 import javax.persistence.Convert;
21 import javax.persistence.Entity;
22 import javax.persistence.GeneratedValue;
23 import javax.persistence.Id;
24 import javax.persistence.JoinColumn;
25 import javax.persistence.ManyToOne;
26 import javax.persistence.Table;
27 import javax.persistence.Transient;
28
29 import org.kuali.rice.kew.api.util.CodeTranslator;
30 import org.kuali.rice.kim.api.responsibility.Responsibility;
31 import org.kuali.rice.kim.api.services.KimApiServiceLocator;
32 import org.kuali.rice.kim.impl.responsibility.ResponsibilityBo;
33 import org.kuali.rice.kim.impl.role.RoleResponsibilityBo;
34 import org.kuali.rice.krad.data.KradDataServiceLocator;
35 import org.kuali.rice.krad.data.jpa.converters.BooleanYNConverter;
36 import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
37
38
39
40
41
42
43
44 @Entity
45 @Table(name = "KRIM_PND_ROLE_RSP_ACTN_MT")
46 public class KimDocumentRoleResponsibilityAction extends KimDocumentBoEditableBase {
47
48 private static final long serialVersionUID = 696663543888096105L;
49
50 @PortableSequenceGenerator(name = "KRIM_ROLE_RSP_ACTN_ID_S")
51 @GeneratedValue(generator = "KRIM_ROLE_RSP_ACTN_ID_S")
52 @Id
53 @Column(name = "ROLE_RSP_ACTN_ID")
54 protected String roleResponsibilityActionId;
55
56 @Column(name = "ROLE_RSP_ID")
57 protected String roleResponsibilityId;
58
59 @Column(name = "ROLE_MBR_ID")
60 protected String roleMemberId;
61
62 @Column(name = "ACTN_TYP_CD")
63 protected String actionTypeCode;
64
65 @Column(name = "ACTN_PLCY_CD")
66 protected String actionPolicyCode;
67
68 @Column(name = "PRIORITY_NBR")
69 protected Integer priorityNumber;
70
71 @Column(name = "FRC_ACTN")
72 @Convert(converter = BooleanYNConverter.class)
73 protected boolean forceAction;
74
75
76
77
78
79 @Transient
80 protected ResponsibilityBo kimResponsibility;
81
82 @ManyToOne(targetEntity = RoleResponsibilityBo.class, cascade = { CascadeType.REFRESH })
83 @JoinColumn(name = "ROLE_RSP_ID", referencedColumnName = "ROLE_RSP_ID", insertable = false, updatable = false)
84 protected RoleResponsibilityBo roleResponsibility;
85
86
87
88
89
90
91
92
93
94 public ResponsibilityBo getKimResponsibility() {
95 if (kimResponsibility == null && getRoleResponsibility() != null) {
96
97
98
99 Responsibility info = KimApiServiceLocator.getResponsibilityService().getResponsibility(getRoleResponsibility().getResponsibilityId());
100 kimResponsibility = ResponsibilityBo.from(info);
101 }
102 return kimResponsibility;
103 }
104
105
106
107
108 public void setKimResponsibility(ResponsibilityBo kimResponsibility) {
109 this.kimResponsibility = kimResponsibility;
110 }
111
112 public String getRoleResponsibilityActionId() {
113 return this.roleResponsibilityActionId;
114 }
115
116 public void setRoleResponsibilityActionId(String roleResponsibilityResolutionId) {
117 this.roleResponsibilityActionId = roleResponsibilityResolutionId;
118 }
119
120 public String getRoleResponsibilityId() {
121 return this.roleResponsibilityId;
122 }
123
124 public void setRoleResponsibilityId(String roleResponsibilityId) {
125 this.roleResponsibilityId = roleResponsibilityId;
126 }
127
128 public String getActionTypeCode() {
129 return this.actionTypeCode;
130 }
131
132 public void setActionTypeCode(String actionTypeCode) {
133 this.actionTypeCode = actionTypeCode;
134 }
135
136 public Integer getPriorityNumber() {
137 return this.priorityNumber;
138 }
139
140 public void setPriorityNumber(Integer priorityNumber) {
141 this.priorityNumber = priorityNumber;
142 }
143
144 public String getActionPolicyCode() {
145 return this.actionPolicyCode;
146 }
147
148 public void setActionPolicyCode(String actionPolicyCode) {
149 this.actionPolicyCode = actionPolicyCode;
150 }
151
152 public String getRoleMemberId() {
153 return this.roleMemberId;
154 }
155
156 public void setRoleMemberId(String roleMemberId) {
157 this.roleMemberId = roleMemberId;
158 }
159
160
161
162
163
164
165
166 public String getActionPolicyDescription() {
167 return CodeTranslator.approvePolicyLabels.get(this.actionPolicyCode);
168 }
169
170
171
172
173
174
175
176 public String getActionTypeDescription() {
177 return CodeTranslator.arLabels.get(this.actionTypeCode);
178 }
179
180
181
182
183 public RoleResponsibilityBo getRoleResponsibility() {
184 if (roleResponsibility == null && roleResponsibilityId != null) {
185
186
187
188 roleResponsibility = KradDataServiceLocator.getDataObjectService().find(RoleResponsibilityBo.class, getRoleResponsibilityId());
189 }
190 return roleResponsibility;
191 }
192
193
194
195
196 public void setRoleResponsibility(RoleResponsibilityBo roleResponsibility) {
197 this.roleResponsibility = roleResponsibility;
198 }
199
200
201
202
203 public boolean isForceAction() {
204 return this.forceAction;
205 }
206
207
208
209
210 public void setForceAction(boolean forceAction) {
211 this.forceAction = forceAction;
212 }
213 }