HRMS API User Hook
HRMS API User Hook
HRMS API
User Hook
Labels
API, an abbreviation
HRMS
of Application
User Hooks
Program Interface, is
a set of routines,
specifies how
software
components should
used when
programming
graphical user
interface (GUI)
components.
API.
Oracle has
supplemented the
functionality by the
hooks.
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 2/43
11/13/24, 6:32 PM HRMS API User Hook
processing reaches a
product processing
customer specific
resumes.
functionality not
supplied directly by
Oracle Applications.
codes, Oracle
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 3/43
11/13/24, 6:32 PM HRMS API User Hook
Applications will be
unable to support
possible. Oracle
Applications only
to the published
package procedures
Oracle HRMS
not supported.
Hence, the
conclusion is User
User Hooks
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 4/43
11/13/24, 6:32 PM HRMS API User Hook
executes in the
HR_API_HOOKS -
Contains all the API
hooks
HR_API_MODULES
– Module list in
which hooks
available
Steps to
Implementing User
Hooks:
steps to
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 5/43
11/13/24, 6:32 PM HRMS API User Hook
implementing API
User Hooks.
2. Write the
PL/SQL procedure
3. Register or
associate the
hooks.
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 6/43
11/13/24, 6:32 PM HRMS API User Hook
forms OR APIs.
HR_API_HOOKS
Use
HR_API_MODULES
respective Module
Type.
to a procedure called
by that hook, can be
obtained by running
the script
$PER_TOP/admin/s
ql/hrahkpar.sql.
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 7/43
11/13/24, 6:32 PM HRMS API User Hook
HR_API_MODULES):
> Business Process
APIs:
1. AD – After
Delete
2. AI – After
Insert
> Row Handler APIs:
1. AP – After
Process
2. AU – After
Update
3. BP – Before
Process
Example:
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 8/43
11/13/24, 6:32 PM HRMS API User Hook
Business Process
User Hooks:
required on top of
the standard
business process
logic. For instance,
CREATE_EMPLOYEE
,
UPDATE_ELEMENT
_ENTRY,etc.
obtained by running
the following script:
SELECT
module_name
FROM
hr_api_modules
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 9/43
11/13/24, 6:32 PM HRMS API User Hook
WHERE
api_module_type='B
P'
completed and
database changes
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 10/43
11/13/24, 6:32 PM HRMS API User Hook
not be called.
CREATE_EMPLOYEE
business process.
SELECTahk.api_hook
_id,
ahk.api_module_id,
ahk.hook_package,
ahk.hook_procedure
FROM
hr_api_hooks ahk,
hr_api_modules
ahm
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 11/43
11/13/24, 6:32 PM HRMS API User Hook
WHERE
ahm.module_name='
CREATE_EMPLOYEE
'
and
ahm.api_module_ty
pe = 'BP'
and
ahk.api_hook_type =
'AP'
and
ahk.api_module_id=
ahm.api_module_id;
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 12/43
11/13/24, 6:32 PM HRMS API User Hook
if extra logic is
required prior to
performing an
Insert,Update or
Delete on a specific
table. As all the main
APIs
call the row handlers,
SELECT
module_name
FROM
hr_api_modules
WHERE
api_module_type='R
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 13/43
11/13/24, 6:32 PM HRMS API User Hook
H';
PER_ALL_PEOPLE_
F table:
SELECT
ahk.api_hook_id,
ahk.hook_package,
ahk.hook_procedure
FROM
hr_api_hooks ahk,
hr_api_modules
ahm
WHERE
(ahm.module_name='
PER_ALL_PEOPLE_
F'
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 14/43
11/13/24, 6:32 PM HRMS API User Hook
OR
ahm.module_name='
PER_PEOPLE_F')
AND
ahm.api_module_ty
pe = 'RH'
AND
ahk.api_hook_type =
'AI'
AND
ahk.api_module_id=
ahm.api_module_id;
by an API there is an
internal row handler
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 15/43
11/13/24, 6:32 PM HRMS API User Hook
implemented for
nearly all the tables
in the system where
APIs are available.
They
APIs. For
example, if a main
API needs to insert a
new row into the
PER_ALL_PEOPLE_
F table it
will not perform the
DML itself. Instead it
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 16/43
11/13/24, 6:32 PM HRMS API User Hook
then needs to be
registered, and
finally the hook
package
has to be modified to
call it. The example
used in this section
describes the
implementation of an
After Process hook in
the
CREATE_EMPLOYEE
Business Process API.
be written in a
PL/SQL server-side
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 17/43
11/13/24, 6:32 PM HRMS API User Hook
package procedure.
The
procedure is always
called if registered
(unless the main
validation logic
errors first), and, any
conditional logic
must be
implemented in the
code
and an application
error raised if
required.
NOTE: No commits
or rollbacks are
allowed in the hook
procedure. These are
always
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 18/43
11/13/24, 6:32 PM HRMS API User Hook
form.
compiled
successfully
on the database.
Example:
CREATE OR
REPLACE PACKAGE
scoop_nationality_c
heck AS
PROCEDURE
polish_name_check
(p_last_name in
VARCHAR2
,p_nationality in
VARCHAR2);
END
scoop_nationality_c
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 19/43
11/13/24, 6:32 PM HRMS API User Hook
heck;
/
CREATE OR
REPLACE PACKAGE
BODY
scoop_nationality_c
heck AS
PROCEDURE
polish_name_check
(p_last_name in
VARCHAR2
,p_nationality in
VARCHAR2)
IS
BEGIN
-- When the first
name entered is a
polish name then
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 20/43
11/13/24, 6:32 PM HRMS API User Hook
IF p_last_name =
'Chrosicka' THEN
IF p_nationality !=
'POL' THEN
dbms_standard.rais
e_application_error
(num => -20999
,msg
END
polish_name_check;
END
scoop_nationality_c
heck;
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 21/43
11/13/24, 6:32 PM HRMS API User Hook
DECLARE
l_api_hook_call_id
NUMBER;
l_object_version_nu
mber NUMBER;
BEGIN
hr_api_hook_call_a
pi.create_api_hook_
call
(p_validate
=> FALSE,
p_effective_date
=>
TO_DATE('01-JUL-
1999','DD-MON-
YYYY'),
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 22/43
11/13/24, 6:32 PM HRMS API User Hook
p_api_hook_id
=> 63,
p_api_hook_call_ty
pe => 'PP',
p_sequence
=> 3000,
p_enabled_flag
=> 'Y',
p_call_package
=>
'SCOOP_NATIONALI
TY_CHECK',
p_call_procedure
=>
'POLISH_NAME_CH
ECK',
p_api_hook_call_id
=>
l_api_hook_call_id,
p_object_version_n
umber =>
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 23/43
11/13/24, 6:32 PM HRMS API User Hook
l_object_version_nu
mber);
EXCEPTION WHEN
OTHERS
DBMS_OUTPUT.PU
T_LINE(SUBSTR(SQL
ERRM,1,300)); --
Handle exception
END;
Points to be noted:
a. See section
‘Business Process
api_hook_id. (Refer
above queries)
b. The hook
mechanism only
supports calls to
package procedures
currently
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 24/43
11/13/24, 6:32 PM HRMS API User Hook
so
api_hook_call_type
must be PP.
c. Sequence
recommended, as
sequences < than
2000 are
reserved for
Oracle seeded logic
which needs to be
processed first.
the sequence.
hook:
DECLARE
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 25/43
11/13/24, 6:32 PM HRMS API User Hook
l_api_hook_call_id
NUMBER := 2;
l_object_version_nu
mber NUMBER := 3;
BEGIN
hr_api_hook_call_a
pi.delete_api_hook_
call
(p_validate
=> FALSE,
p_api_hook_call_id
=>
l_api_hook_call_id,
p_object_version_n
umber =>
l_object_version_nu
mber);
EXCEPTION WHEN
OTHERS
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 26/43
11/13/24, 6:32 PM HRMS API User Hook
DBMS_OUTPUT.PU
T_LINE(SUBSTR(SQL
ERRM,1,300)); --
Handle exception
END;
deleting a specific
user hook. Please
made to the
HR_API_HOOK_CA
procedures or not,
run.
Processor
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 27/43
11/13/24, 6:32 PM HRMS API User Hook
logic to be called.
The pre-processor
program must be
called
first. This will look at
another package
body.
If successful, the
pre-processor will
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 28/43
11/13/24, 6:32 PM HRMS API User Hook
no extra logic is
implemented the
is
still created but
custom procedures.
program will be
automatically called
to create
the following
commands:
cd
$PER_TOP/admin/s
ql
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 29/43
11/13/24, 6:32 PM HRMS API User Hook
OR
SQL> @hrahkone.sql
api_module_id.
executed in
above(first query) to
obtain the
api_module_id.
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 30/43
11/13/24, 6:32 PM HRMS API User Hook
Tips on resolving
Invalid Hook
Packages
Occasionally when
applying patches
be for a variety of
reasons. Running the
report
$PER_TOP/patch/11
5/sql/hrahkall.sql
will provide a
comprehensive list of
the invalid hook
packages.
Sometimes the
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 31/43
11/13/24, 6:32 PM HRMS API User Hook
Refer HRMS
Implementation
guide for examples
SELECT
api_hook_id,
hook_procedure
FROM
hr_api_hooks
WHERE
api_hook_type = 'AP'
AND
hook_procedure
LIKE
'UPDATE_ORG_INF
ORMATION%';
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 32/43
11/13/24, 6:32 PM HRMS API User Hook
SELECT
call_package,
call_procedure,
legislation_code
FROM
hr_api_hook_calls
WHERE
api_hook_id =
5012; -- Got this
additional
information:
SELECT *
FROM
hr_api_hook_calls
WHERE api_hook_id
IN (SELECT
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 33/43
11/13/24, 6:32 PM HRMS API User Hook
api_hook_id
FROM
hr_api_hooks
WHERE
api_module_id =
(SELECT
api_module_id
FROM
hr_api_modules
WHERE
module_name LIKE
'UPDATE_ORG_INF
ORMATION%'));
*******************
*******************
*******************
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 34/43
11/13/24, 6:32 PM HRMS API User Hook
*******************
*******************
**
metalink note OR
HRMS
implementation
Using Application
Program Interface
73170.1]
Hooks’ section in
Oracle HRMS
Implementation
Guide
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 35/43
11/13/24, 6:32 PM HRMS API User Hook
List of APIs
process) :
applicant assignment
offer_apl_asg
update_apl_asg
contact relationship
create_contact_rela
tionship
delete_contact_relat
ionship
employee
actual_termination_
emp
final_process_emp
create_employee
employee assignment
activate_emp_asg
suspend_emp_asg
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 36/43
11/13/24, 6:32 PM HRMS API User Hook
final_process_emp_
asg
update_emp_asg
actual_termination_
emp_asg
employee assignment
criteria
update_emp_asg_cr
iteria
grade rate value
create_grade_rate_
value
update_grade_rate_
value
delete_grade_rate_
value
job requirement
create_job_require
ment
mass moves
mass_moves
alue
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 37/43
11/13/24, 6:32 PM HRMS API User Hook
update_pay_scale_v
alue
delete_pay_scale_va
lue
person address
create_person_addr
ess
update_person_add
ress
personal payment
method
create_personal_pay
ment_method
update_personal_pa
yment_method
position
create_position
update_position
position requirement
create_position_req
uirement
secondary applicant
assignment
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 38/43
11/13/24, 6:32 PM HRMS API User Hook
create_secondary_a
pl_asg
secondary employee
assignment
create_secondary_e
mp_asg
Row Handlers
PER_ADDRESSES
PER_ALL_PEOPLE_
F
PER_ALL_ASSIGNM
ENTS_F
PAY_PERSONAL_PA
YMENT_METHODS
_F
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 39/43
11/13/24, 6:32 PM HRMS API User Hook
PER_POSITIONS
PER_APPLICATIONS
PER_CONTACT_REL
ATIONSHIPS
LABELS: HRMS,
USER HOOKS
SHARE
Comments
Enter comment
How to
setup
and use
AME -
Approv
al
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 40/43
11/13/24, 6:32 PM HRMS API User Hook
Manage
ment
Engine
September 15,
2017
Approval
Management
Engine - AME
For Purchase…
SHARE
POST A
COMMENT
READ MORE
How to
compile
all
INVALI
D
objects
in
Oracle
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 41/43
11/13/24, 6:32 PM HRMS API User Hook
September 05,
2017
ways to
recompile
invalid objects
…
SHARE
POST A
COMMENT
READ MORE
Workfl
ow
Importa
nt
Debug
Queries
August 30, 2017
deq_time is
not always
populated in
WF_DEFERR…
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 42/43
11/13/24, 6:32 PM HRMS API User Hook
SHARE
POST A
COMMENT
READ MORE
About Me
Aniket
VISIT PROFILE
Powered by Blogger
Archive
Powered by Blogger
https://oracleappsessentials.blogspot.com/2018/01/hrms-api-user-hook.html 43/43