1 PACKAGE BODY FND_USER_VALIDATION as
2 /* $Header: AFSCUVAB.pls 120.0 2005/07/26 23:45:14 appldev noship $ */
3 -- Start of Comments
4 -- Package name : FND_USER_VALIDATION
5 -- Purpose :
6 -- This package contains specification individual user registration
7
8 --
9 -- Function
10 -- Custom_validation
11 --
12 -- Description
13 -- This method is a subscriber to the event oracle.apps.fnd.user.name.validate
14 -- This method will validate a Email as username policy
15 -- This method will return Success if Email is in proper format
16 -- Else It will raise an application Error
17 -- IN
18 -- the signature follows Workflow business events standards
19 -- p_subscription_guid -
20 -- IN/OUT
21 -- p_event - WF_EVENT_T which holds the data that needs to passed from/to
22 -- subscriber of the event
23 --
24
25
26 function Custom_Validation(p_subscription_guid in raw,
27 p_event in out NOCOPY WF_EVENT_T
28 ) return varchar2 is
29
30 l_dot_pos number;
31 l_at_pos number;
32 l_str_length number;
33 l_user_name FND_USER.USER_NAME%TYPE;
34
35 begin
36
37 l_user_name := p_event.getEventKey();
38 l_dot_pos := instr( l_user_name, '.');
39 l_at_pos := instr( l_user_name, '@');
40 l_str_length := length(l_user_name);
41
42 if (
43 (l_dot_pos = 0) or
44 (l_at_pos = 0) or
45 (l_dot_pos = l_at_pos +1 ) or
46 (l_at_pos = 1) or
47 (l_at_pos = l_str_length) or
48 (l_dot_pos = l_str_length)
49 )then
50 WF_EVENT.setErrorInfo(p_event,'ERROR');
51 FND_MESSAGE.SET_NAME('FND','FND_INVLD_EMAIL_FRMT');
52 -- we are raising an app exception since Fnd_user_pkg.validate
53 -- expects an exception. Typically Wf_event.GetErrorInfo should be handled
54 -- by fnd_user_pkg
55 app_exception.RAISE_EXCEPTION;
56 end if;
57 return 'SUCCESS';
58 end Custom_Validation;
59
60 end FND_USER_VALIDATION;