1 PACKAGE BODY UMX_PUB AS
2 /* $Header: UMXPRRSB.pls 120.5.12010000.2 2009/07/22 19:00:12 jstyles ship $ */
3
4 -- Function : get_attribute_value
5 -- Type : Public
6 -- Pre_reqs : None
7 -- Description : Get the attribute value from the workflow.
8 -- input parameters :
9 -- @param p_reg_request_id
10 -- Description : Registration Request ID
11 -- Required : Yes
12 -- @param p_attribute_name
13 -- Description : Attribute name
14 -- Required : Yes
15 -- Output :
16 -- Description : Attribute value
17 --
18 function get_attribute_value (
19 p_reg_request_id in UMX_REG_REQUESTS.REG_REQUEST_ID%TYPE,
20 p_attribute_name in varchar2
21 ) return varchar2 is
22
23 l_value varchar2 (4000);
24 l_registration_data wf_event_t;
25
26 begin
27
28 l_value := wf_engine.GetItemAttrText (
29 itemtype => UMX_REGISTRATION_UTIL.G_ITEM_TYPE,
30 itemkey => p_reg_request_id,
31 aname => p_attribute_name,
32 ignore_notfound => true);
33
34 if (l_value is null) then
35
36 -- Try to get the attribute value from the Event Object
37 l_registration_data :=
38 wf_engine.getitemattrevent (itemtype => UMX_REGISTRATION_UTIL.G_ITEM_TYPE,
39 itemkey => p_reg_request_id,
40 name => 'REGISTRATION_DATA');
41
42 l_value := wf_event.GetValueForParameter (
43 p_name => p_attribute_name,
44 p_parameterlist => l_registration_data.getParameterList);
45 end if;
46 return (l_value);
47
48 end get_attribute_value;
49
50 --
51 -- Procedure : assign_role
52 -- Type : Public
53 -- Pre_reqs : None
54 -- Description : This API will assign or launch wf to assign role.
55 -- Input Parameters (Mandatory):
56 -- p_registration_data : Table of record type of UMX_REGISTRATION_DATA
57 -- Output Parameters:
58 -- p_registration_data : Table of record type of UMX_REGISTRATION_DATA
59 --
60
61 procedure assign_role (p_registration_data in out NOCOPY UMX_REGISTRATION_PVT.UMX_REGISTRATION_DATA_TBL) IS
62
63 x_return_status varchar2 (4000);
64 x_message_data varchar2 (4000);
65 begin
66
67 if (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_PROCEDURE) then
68 FND_LOG.STRING (FND_LOG.LEVEL_PROCEDURE, 'fnd.plsql.UMXPRRSB.assignRole.begin', '');
69 end if;
70
71 UMX_PUB.assign_role (p_registration_data, x_return_status, x_message_data);
72
73 if (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_PROCEDURE) then
74 FND_LOG.STRING (FND_LOG.LEVEL_PROCEDURE, 'fnd.plsql.UMXPRRSB.assignRole.end', '');
75 end if;
76 end assign_role;
77
78
79 procedure assign_role (p_registration_data in out NOCOPY UMX_REGISTRATION_PVT.UMX_REGISTRATION_DATA_TBL
80 , x_return_status out NOCOPY varchar2
81 , x_message_data out NOCOPY varchar2) IS
82 begin
83
84 if (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_PROCEDURE) then
85 FND_LOG.STRING (FND_LOG.LEVEL_PROCEDURE,
86 'fnd.plsql.UMXPRRSB.assignRole.begin', '');
87 end if;
88
89 UMX_REGISTRATION_PVT.assign_role (p_registration_data, x_return_status, x_message_data);
90
91 if (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_PROCEDURE) then
92 FND_LOG.STRING (FND_LOG.LEVEL_PROCEDURE,
93 'fnd.plsql.UMXPRRSB.assignRole.end', '');
94 end if;
95 end assign_role;
96
97 --
98 -- Procedure : updateWfAttribute
99 -- Type : Public
100 -- Pre_reqs : None
101 -- Description : This API can be invoked by anyone who registers a pl/sql subscription to
102 -- UMX raised Business Events during registration. This api will update the main
103 -- User Management workflow event(payload) object and also the corresponding
104 -- workflow attribute. If p_attr_name doesnt exist in the workflow, one is created.
105 -- This API can also be called by anyone who has a custom notification workflow
106 -- defined, and want this name value pair to be reflected in the main workflow;
107 -- this name value pair will be available to rest of subscriptions and workflow
108 -- activities.
109 -- thi
110 -- Input Parameters (Mandatory):
111 -- p_event : Oracle Worflow WF_EVENT_T object type
112 -- Input params (Optional)
113 -- p_attr_name : Varchar2, name of the attribute, maps to workflow attribute name.
114 -- p_attr_value : varchar2, value of the attribute, maps to workflow attibute string value.
115
116 -- Output Parameters:
117 -- p_event : Oracle Worflow WF_EVENT_T object type
118 --
119 procedure updateWfAttribute (p_event in out NOCOPY WF_EVENT_T,
120 p_attr_name in VARCHAR2 DEFAULT NULL,
121 p_attr_value in VARCHAR2 DEFAULT NULL) is
122 l_status varchar2(30);
123 begin
124 l_status := umx_registration_util.set_event_object (p_event => p_event,
125 p_attr_name => p_attr_name,
126 p_attr_value => p_attr_value);
127 EXCEPTION
128 WHEN OTHERS THEN
129 RAISE;
130 end updateWfAttribute;
131 --
132 -- Procedure : notification_process_done
133 -- Type : Public
134 -- Pre_reqs : None
135 -- Description : This api will restart the sleeping main workflow.
136 procedure Notification_Process_Done (item_type in varchar2,
137 item_key in varchar2,
138 activity_id in number,
139 command in varchar2,
140 resultout out NOCOPY varchar2) is
141 BEGIN
142
143 UMX_NOTIFICATION_UTIL.Notification_process_done
144 ( item_type => item_type,
145 item_key => item_key,
146 activity_id => activity_id,
147 command => command,
148 resultout => resultout);
149
150 EXCEPTION
151 WHEN OTHERS THEN
152 RAISE;
153
154 END Notification_process_done;
155
156 --
157 -- Procedure : get_suggested_username
158 -- Type : Public
159 -- Pre_reqs : None
160 -- Description : This API will return the suggested user name for a person.
161 -- The user name will be generated via the
162 -- oracle.apps.fnd.umx.username.generate Business Event
163 -- which will be raised by this API. The event could
164 -- return a null value as the user name if the user name
165 -- could not be generated.
166 -- Input Parameters :
167 -- @param p_person_party_id
168 -- Description: Person Party ID of the person who to generate
169 -- a username for.
170 -- Required : N
171 -- Output Parameters :
172 -- x_suggested_username: Username generated by the Username Policy. May return null.
173 --
174 --
175 procedure get_suggested_username (p_person_party_id in HZ_PARTIES.PARTY_ID%TYPE default null,
176 x_suggested_username out nocopy FND_USER.USER_NAME%TYPE) is
177 begin
178
179 if (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_PROCEDURE) then
180 FND_LOG.STRING (FND_LOG.LEVEL_PROCEDURE,
181 'fnd.plsql.UMXPRRSB.get_suggested_username.begin',
182 'p_person_party_id: ' || p_person_party_id);
183 end if;
184
185 UMX_USERNAME_POLICY_PVT.get_suggested_username (p_person_party_id => p_person_party_id,
186 x_suggested_username => x_suggested_username);
187
188 if (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_PROCEDURE) then
189 FND_LOG.STRING (FND_LOG.LEVEL_PROCEDURE,
190 'fnd.plsql.UMXPRRSB.get_suggested_username.end',
191 'x_suggested_username: ' || x_suggested_username);
192 end if;
193
194 end get_suggested_username;
195
196 --
197 -- Procedure : get_username_policy_desc
198 -- Type : Public
199 -- Pre_reqs : None
200 -- Description : This API will return the description of the user name
201 -- policy. The return parameters / user name policy is
202 -- based on the UMX: User Name Policy (UMX_USERNAME_POLICY)
203 -- profile option, which points to a LOOKUP TYPE that
204 -- should include the following:
205 --
206 -- LOOKUP CODES: DESCRIPTION, PROMPT, HINT
207 --
208 -- with the appropriate LOOKUP MEANING defined. Example:
209 --
210 -- LOOKUP TYPE: UMX_USERNAME_POLICY:EMAIL
211 --
212 -- LOOKUP CODE MEANING DESCRIPTION
213 -- ----------- -------------------------- -------------------------------
214 -- PROMPT User Name Prompt of the user name text
215 -- input field.
216 --
217 -- DESCRIPTION User Names must be based Description of the policy
218 -- on Email Address
219 --
220 -- HINT example: [email protected] Example of what the username should
221 -- look like.
222 --
223 -- Input Parameters :
224 -- Output Parameters :
225 -- x_policy_code: User Name Policy code. Preseeded policies are:
226 --
227 -- Code: UMX_USERNAME_POLICY:EMAIL
228 -- Meaning: User name should be defined as Email Address.
229 -- Product teams may choose to hide the email
230 -- field in any account creation / registration
231 -- UI's as long as the entered username (email)
232 -- is copied into the fnd_user.email_address field
233 -- as well.
234 --
235 -- Code: UMX_USERNAME_POLICY:NONE
236 -- Meaning: No username policy / format defined, freetext
237 --
238 -- Code: Anything else, this would be a custom policy defined
239 -- at a client site.
240 --
241 -- x_description: User Name Policy description. May be null. For example:
242 --
243 -- "User Names must be based on <b>Email Address</b>".
244 -- The description can be displayed as a quick tip in
245 -- the user account creation/registration page.
246 --
247 -- x_prompt: Prompt of the User Name field. Defaults to "User Name" if
248 -- none is defined in the policy.
249 --
250 -- x_hint: An example of the user name format. May be null. For
251 -- example:
252 --
253 -- "(example: [email protected])"
254 --
255 -- The hint can be displayed as an inline hint below the
256 -- User Name field in any user account creation/registration
257 -- page.
258 --
259 --
260 procedure get_username_policy_desc
261 (x_policy_code out nocopy FND_LOOKUP_TYPES.LOOKUP_TYPE%TYPE,
262 x_description out nocopy FND_LOOKUP_VALUES.MEANING%TYPE,
263 x_prompt out nocopy FND_LOOKUP_VALUES.MEANING%TYPE,
264 x_hint out nocopy FND_LOOKUP_VALUES.MEANING%TYPE) is
265
266 begin
267
268 if (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_PROCEDURE) then
269 FND_LOG.STRING (FND_LOG.LEVEL_PROCEDURE,
270 'fnd.plsql.UMXPRRSB.get_username_policy_desc.begin', '');
271 end if;
272
273 UMX_USERNAME_POLICY_PVT.get_username_policy_desc (x_policy_code => x_policy_code,
274 x_description => x_description,
275 x_prompt => x_prompt,
276 x_hint => x_hint);
277
278
279 if (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_PROCEDURE) then
280 FND_LOG.STRING (FND_LOG.LEVEL_PROCEDURE,
281 'fnd.plsql.UMXPRRSB.get_username_policy_desc.end',
282 'x_policy_code: ' || x_policy_code ||
283 ' | x_description: ' || x_description ||
284 ' | x_prompt: ' || x_prompt ||
285 ' | x_hint: ' || x_hint);
286 end if;
287
288 end get_username_policy_desc;
289
290 END UMX_PUB;