Professional Documents
Culture Documents
Self Service Scenario SIT
Self Service Scenario SIT
Our Scenario Starts with Applying for a new Loan Request, you are required to enter Loan date,
Amount and any Comments related to Loan request , your Loan Request entries will be
Validated, for Example if the login user working for the Upper Management then he can Enter
any Loan Date or any Loan Amount Moreover such Request does not require any Approval , if
the user is not working for the upper Management then the entered Loan date should be the
same as the System date or greater than the System date and Loan Amount entered should not
be greater than 10.000$, within 10.000$, The Approval Hierarchy Varies according to the Loan
amount, the Amount equal or less than 5000$ requires just the Supervisor hierarchy, the
Amount equal or less then 10.000$ and greater than 5000$ requires the Supervisor Approval
plus The Upper Management Approval, after Approving the Request from the Approval
Hierarchy a Notification will sent to the Treasury Account asking them to give the requestor the
loan Amount required, other Notification will be sent to Requestor asking him to go to the
.treasury to get the loan Amount required
Requirements
Create a new user Account and link it to an Employee (in Scenario username: 567, pwd: -1
123456 employee name: “Abby, Caroline”)
Create an Other new user Account and link it to an Employee whom is the Supervisor of -2
the Employee in step 1 (in Scenario username: 566, pwd: 123456 employee name: “Ross,
Dan”)
Create an Other new AME Administrator user Account (in Scenario username : -3
:AME_ADMIN , pwd : 123456) as Below
* Login as SYSADMIN user.
* Create a New user account and give an appropriate effective date. Do NOT add any Responsibility
After selecting the Roles, provide the Justification for the roles and the effective date *
* Press apply
* After Finish Assigning Rules, you can query back the same user and can verify the list of roles
being attached to the user by pressing update again
* Now switch the responsibility to Functional Administrator
Click on create grants under the grants sub‐tab *
* Enter a Grant Name and provide an effective date
* Navigate to the Security Context region and select the Grantee Type as ‘Specific User’
* In the Grantee field select the newly created User
In the Data Security region select ‘AME Transaction Types’ as the Object *
* Pressing Next will take you to the ‘Select Object Data Context’ page
You have a default value of ‘All Rows’ in the Data Context Type, leave it as it is, and navigate *
further
Create a New role and name it “Upper management”, attach at least an employee to it -5
and then make sure that all attached Employees to this role have a valid Account (in
Scenario I attached two employees to the Upper Management Role (“Adams, Mr. Brian”
:and ” Alexander, Mr. Felix”) as Below
To Create the Upper management Role Follow this path: HRMS ManagementTransaction MaintenanceRoles
: Now let's start the Scenario, our steps will be as follow
1- Creating Extra Information Types , Create Loan Request Web Page (EIT) , Personalize Loan
Request Page
making Validation to Loan Request web Page (User hook) -2
Setting up Approval Hierarchy based on Login User and Loan Amount (AME) -3
Sending Notifications To different Work lists(Requestor and Treasury) after Approving the -4
Request (Database Trigger(Instead Of Alert) - Workflow)
Creating a new Loan Request from Scratch -5
1- Creating Extra Information Types , Create Loan Request Web Page (EIT) ,
Personalize Loan Request Page
Login as Sysadmin -1
Go To Application developer Flexfield Descriptive Segments -2
"Filter in Title Field with "Extra Person information -3
uncheck freeze Flexfield Definition -4
:create a new Structure named "XXMM_LOAN" as Below -5
: create Segments as Below -6
Note : the Process In Red will be Created Later (in step 15)
attach your new function to the Menu " Employee Self Service " of Responsibility -13
: “Employee Self-Service” as below
:attach your new function to the menu " Global Self Service Functions Custom " as below -14
Create the Function process " XXMM_HR_EIT_JSP_PRC " we mentioned above in step 12 -15
:(in red line) as Below
Here I will Launch Workflow builder and establish the connection to Database then search for
HR Item Type
:Search the process name “HR_EIT_JSP_PRC” then copy it as Below *
Paste the Process “HR_EIT_JSP_PRC” on Processes Node then modify the internal name to be *
“XXMM_HR_EIT_JSP_PRC” as below
Double click on the newly created process “XXMM_HR_EIT_JSP_PRC” then Double click on the
Node “HR_REVIEW_CHANGES_JSP_FCT” then switch to Node Attributes Tab then scroll to
Attribute named “HR_APPROVAL_REQ_FLAG” and change its value to be “YES – Dynamic
:Approval” as Below
The previous step is very Important to be able to display the Request Approvers
attach the Responsibility “Employee Self-Service” to Employee “Abby, Caroline” -16
(Requirements step 1) then login as “567 (Abby, Caroline)” then click on the Loan Request,
:you will find it as Below
Here you will see all your EIT Structures and to restrict it to just your Loan Request EIT, you *
should click on Personalize Page and then change Style to be Flex and press go
Here you should click on the yellow pencil and then insert the Structure “XXMM_LOAN”And *
: its segments into Segment List on Function level like this
||XXMM_LOAN|DECISION_NO|LOAN_AMOUNT|LOAN_DATE|NOTES
Then Apply and return to Application, you will find just your Loan request *
Then click to add a new loan request , you will see all your Request Segments but what we
:should do to make the Decision number Just Read Only as Below
You should click on Personalize Page and then change Style to be Flex and press go *
Here you should click on the yellow pencil and then insert the Structure “XXMM_LOAN”And *
:its segments into Segment List on Function level like this
||XXMM_LOAN|DECISION_NO($RO$)|LOAN_AMOUNT|LOAN_DATE|NOTES
Then Apply and return to Application, you will find the decision number Segment just read Only
.because of this : DECISION_NO($RO$) , just suffix your Segment with ($RO$)
making Validation to Loan Request web Page (User hook) -2
Error : Here we got the Error ” ORA-20001 KINDLY YOU CAN GET THE LOAN IN THE
SAME DAY OF THE REQUEST OR ANY DAY AFTER THE DAY OF REQUEST” Because I
Entered a Date less than the system Date (System Date : 06-Feb-2013) and the Login User is not
in the Upper Management
.Solution : we should enter a Date 06-Feb-2013 (System date) at least or greater than this Date
Error : Here I got the Error “ORA-20001 KINDLY LOAN AMOUNT SHOULD BE WITHEN
10000$” because I entered Amount more than 10000$
Solution : as you are not an Employee in the upper Management, you are not allowed to ask for
a loan amount more than 10000$ (Just Upper management Employees can ask for any
Amount)
Validation Code -3
Here in this step I attached all the validations I wish in the Package Procedure
“XXMM_LOAN_PKG. XXMM_LOAN_PROC”,I Registered and Activated this Package
Procedure to “HR_PERSON_EXTRA_INFO_BK1.CREATE_PERSON_EXTRA_INFO_B” By
“hr_api_hook_call_api.create_api_hook_call” for Registration and
“hr_api_user_hooks_utility.create_hooks_one_module” for Activation
Package Header
CREATE OR REPLACE package APPS.XXMM_LOAN_PKG as
procedure XXMM_LOAN_PROC (P_PERSON_ID in NUMBER
,P_INFORMATION_TYPE in VARCHAR2
,P_PEI_ATTRIBUTE_CATEGORY in VARCHAR2
,P_PEI_ATTRIBUTE1 in VARCHAR2
,P_PEI_ATTRIBUTE2 in VARCHAR2
,P_PEI_ATTRIBUTE3 in VARCHAR2
,P_PEI_ATTRIBUTE4 in VARCHAR2
,P_PEI_ATTRIBUTE5 in VARCHAR2
,P_PEI_ATTRIBUTE6 in VARCHAR2
,P_PEI_ATTRIBUTE7 in VARCHAR2
,P_PEI_ATTRIBUTE8 in VARCHAR2
,P_PEI_ATTRIBUTE9 in VARCHAR2
,P_PEI_ATTRIBUTE10 in VARCHAR2
,P_PEI_ATTRIBUTE11 in VARCHAR2
,P_PEI_ATTRIBUTE12 in VARCHAR2
,P_PEI_ATTRIBUTE13 in VARCHAR2
,P_PEI_ATTRIBUTE14 in VARCHAR2
,P_PEI_ATTRIBUTE15 in VARCHAR2
,P_PEI_ATTRIBUTE16 in VARCHAR2
,P_PEI_ATTRIBUTE17 in VARCHAR2
,P_PEI_ATTRIBUTE18 in VARCHAR2
,P_PEI_ATTRIBUTE19 in VARCHAR2
,P_PEI_ATTRIBUTE20 in VARCHAR2
,P_PEI_INFORMATION_CATEGORY in VARCHAR2
,P_PEI_INFORMATION1 in VARCHAR2
,P_PEI_INFORMATION2 in VARCHAR2
,P_PEI_INFORMATION3 in VARCHAR2
,P_PEI_INFORMATION4 in VARCHAR2
,P_PEI_INFORMATION5 in VARCHAR2
,P_PEI_INFORMATION6 in VARCHAR2
,P_PEI_INFORMATION7 in VARCHAR2
,P_PEI_INFORMATION8 in VARCHAR2
,P_PEI_INFORMATION9 in VARCHAR2
,P_PEI_INFORMATION10 in VARCHAR2
,P_PEI_INFORMATION11 in VARCHAR2
,P_PEI_INFORMATION12 in VARCHAR2
,P_PEI_INFORMATION13 in VARCHAR2
,P_PEI_INFORMATION14 in VARCHAR2
,P_PEI_INFORMATION15 in VARCHAR2
,P_PEI_INFORMATION16 in VARCHAR2
,P_PEI_INFORMATION17 in VARCHAR2
,P_PEI_INFORMATION18 in VARCHAR2
,P_PEI_INFORMATION19 in VARCHAR2
,P_PEI_INFORMATION20 in VARCHAR2
,P_PEI_INFORMATION21 in VARCHAR2
,P_PEI_INFORMATION22 in VARCHAR2
,P_PEI_INFORMATION23 in VARCHAR2
,P_PEI_INFORMATION24 in VARCHAR2
,P_PEI_INFORMATION25 in VARCHAR2
,P_PEI_INFORMATION26 in VARCHAR2
,P_PEI_INFORMATION27 in VARCHAR2
,P_PEI_INFORMATION28 in VARCHAR2
,P_PEI_INFORMATION29 in VARCHAR2
,P_PEI_INFORMATION30 in VARCHAR2
);
end; --XXMM_LOAN_PKG
/
Package Body
CREATE OR REPLACE package body APPS.XXMM_LOAN_PKG as
procedure XXMM_LOAN_PROC(P_PERSON_ID in NUMBER
,P_INFORMATION_TYPE in VARCHAR2
,P_PEI_ATTRIBUTE_CATEGORY in VARCHAR2
,P_PEI_ATTRIBUTE1 in VARCHAR2
,P_PEI_ATTRIBUTE2 in VARCHAR2
,P_PEI_ATTRIBUTE3 in VARCHAR2
,P_PEI_ATTRIBUTE4 in VARCHAR2
,P_PEI_ATTRIBUTE5 in VARCHAR2
,P_PEI_ATTRIBUTE6 in VARCHAR2
,P_PEI_ATTRIBUTE7 in VARCHAR2
,P_PEI_ATTRIBUTE8 in VARCHAR2
,P_PEI_ATTRIBUTE9 in VARCHAR2
,P_PEI_ATTRIBUTE10 in VARCHAR2
,P_PEI_ATTRIBUTE11 in VARCHAR2
,P_PEI_ATTRIBUTE12 in VARCHAR2
,P_PEI_ATTRIBUTE13 in VARCHAR2
,P_PEI_ATTRIBUTE14 in VARCHAR2
,P_PEI_ATTRIBUTE15 in VARCHAR2
,P_PEI_ATTRIBUTE16 in VARCHAR2
,P_PEI_ATTRIBUTE17 in VARCHAR2
,P_PEI_ATTRIBUTE18 in VARCHAR2
,P_PEI_ATTRIBUTE19 in VARCHAR2
,P_PEI_ATTRIBUTE20 in VARCHAR2
,P_PEI_INFORMATION_CATEGORY in VARCHAR2
,P_PEI_INFORMATION1 in VARCHAR2
,P_PEI_INFORMATION2 in VARCHAR2
,P_PEI_INFORMATION3 in VARCHAR2
,P_PEI_INFORMATION4 in VARCHAR2
,P_PEI_INFORMATION5 in VARCHAR2
,P_PEI_INFORMATION6 in VARCHAR2
,P_PEI_INFORMATION7 in VARCHAR2
,P_PEI_INFORMATION8 in VARCHAR2
,P_PEI_INFORMATION9 in VARCHAR2
,P_PEI_INFORMATION10 in VARCHAR2
,P_PEI_INFORMATION11 in VARCHAR2
,P_PEI_INFORMATION12 in VARCHAR2
,P_PEI_INFORMATION13 in VARCHAR2
,P_PEI_INFORMATION14 in VARCHAR2
,P_PEI_INFORMATION15 in VARCHAR2
,P_PEI_INFORMATION16 in VARCHAR2
,P_PEI_INFORMATION17 in VARCHAR2
,P_PEI_INFORMATION18 in VARCHAR2
,P_PEI_INFORMATION19 in VARCHAR2
,P_PEI_INFORMATION20 in VARCHAR2
,P_PEI_INFORMATION21 in VARCHAR2
,P_PEI_INFORMATION22 in VARCHAR2
,P_PEI_INFORMATION23 in VARCHAR2
,P_PEI_INFORMATION24 in VARCHAR2
,P_PEI_INFORMATION25 in VARCHAR2
,P_PEI_INFORMATION26 in VARCHAR2
,P_PEI_INFORMATION27 in VARCHAR2
,P_PEI_INFORMATION28 in VARCHAR2
,P_PEI_INFORMATION29 in VARCHAR2
,P_PEI_INFORMATION30 in VARCHAR2
)is
IS_USER_UPPER_MNG VARCHAR2(10);
begin
IS_USER_UPPER_MNG := XXMM_IS_USER_UPPER_MNGR_FNC(P_PERSON_ID);
hr_utility.set_message(800,’XXMM_LOAN_DATE_MSG’);
--hr_utility.set_message_token (‘ERROR’, v_abs_msg );
hr_utility.raise_error;
end if;
hr_utility.set_message(800,’XXMM_LOAN_AMOUNT_MSG’);
--hr_utility.set_message_token (‘ERROR’, v_abs_msg );
hr_utility.raise_error;
end if;
--xxmda_send_treasury_proc(P_PEI_INFORMATION2,P_PEI_INFORMATION30);
end if;
end if;
end;--XXMM_LOAN_PROC
end; --XXMM_LOAN_PKG
/
Function “XXMM_IS_USER_UPPER_MNGR_FNC”
I used this function into my Own package Procedure to Check the login User if he is working for the upper management or not
CREATE OR REPLACE FUNCTION APPS.XXMM_IS_USER_UPPER_MNGR_FNC(P_PERSON_ID in NUMBER)
RETURN CHAR
IS
RTN_VAL VARCHAR2(10);
BEGIN
SELECT PPEI.PERSON_ID
INTO RTN_VAL
FROM PER_PEOPLE_EXTRA_INFO PPEI,
FND_USER USR,
PER_ALL_PEOPLE_F PAPF,
PER_ALL_ASSIGNMENTS_F PAAF
WHERE PPEI.INFORMATION_TYPE = 'PQH_ROLE_USERS'
AND TO_NUMBER(PPEI.PEI_INFORMATION3) = 3193
AND PPEI.PEI_INFORMATION5 = 'Y'
AND PPEI.PERSON_ID = P_PERSON_ID
AND PPEI.PERSON_ID = USR.EMPLOYEE_ID
AND USR.END_DATE IS NULL
AND PPEI.PERSON_ID = PAPF.PERSON_ID
AND TRUNC(SYSDATE) BETWEEN PAPF.EFFECTIVE_START_DATE AND
NVL(PAPF.EFFECTIVE_END_DATE,TO_DATE('31/12/4000','dd/mm/yyyy'))
AND PPEI.PERSON_ID = PAAF.PERSON_ID
AND TRUNC(SYSDATE) BETWEEN PAAF.EFFECTIVE_START_DATE AND
NVL(PAAF.EFFECTIVE_END_DATE,TO_DATE('31/12/4000','dd/mm/yyyy'));
RETURN 'E';
EXCEPTION
END;
/
Activate & Register Validation code-4
As i said in the previous step I Registered my Own Package using API Called
“hr_api_hook_call_api.create_api_hook_call” and Activated it using API Called
:“hr_api_user_hooks_utility.create_hooks_one_module” as Below
hr_api_hook_call_api.create_api_hook_call
declare
l_api_hook_call_id number ;
;l_object_version_number number
begin
hr_api_hook_call_api.create_api_hook_call
,p_validate => false(
,p_effective_date => sysdate
,p_api_hook_id => 86
,’p_api_hook_call_type => 'PP
,p_sequence => 3010
,’p_enabled_flag => 'Y
,’p_call_package => ‘XXMM_LOAN_PKG
,’p_call_procedure => ‘XXMM_LOAN_PROC
,p_api_hook_call_id => l_api_hook_call_id
p_object_version_number => l_object_version_number
;)
;dbms_output.put_line ('Finished’)
;dbms_output.put_line ('API Hook Call ID : ' || l_api_hook_call_id)
;dbms_output.put_line ('Object Version Number : ' || l_object_version_number)
Exception
when others then
;dbms_output.put_line (substr (sqlerrm, 1, 255))
;end
*Explannation Of the API (hr_api_hook_call_api.create_api_hook_call)Parameters
p_validate : False (if you want to make changes to Database) Or true (if you do not want to make changes to Database)
p_effective_date: means Activation date
: p_api_hook_id: Means “api_hook_id” you want to link your own Package Procedure to as Below
As you see in table “HR_API_HOOKS” the api_hook_id = 86 and its Package name is
“HR_PERSON_EXTRA_INFO_BK1” and the procedure name is
“CREATE_PERSON_EXTRA_INFO_B” , I want to link my own Package Procedure to system
”package procedure “HR_PERSON_EXTRA_INFO_BK1.CREATE_PERSON_EXTRA_INFO_B
p_api_hook_call_type: “PP” Means Package Procedure
p_sequence: it should be a number differs all numbers in this field so I did it 3010 , after
:Run this package you will get a new Record in Table “HR_API_HOOK_CALLS” as Below
p_enabled_flag: ‘Y’ to enable your Package Procedure, ‘N’ to disable your package
Procedure
”p_call_package: your own Package “XXMM_LOAN_PKG
”p_call_procedure: your own Procedure “XXMM_LOAN_PROC
p_api_hook_call_id: out Parameter, return api_hook_call_id , you can see “api_hook_call_id” in
:the newly created Record in table “HR_API_HOOK_CALLS” after running this API as Below
p_object_version_number: out Parameter, means newly Created Record Version number
: in table “HR_API_HOOK_CALLS” as below
hr_api_user_hooks_utility.create_hooks_one_module
DECLARE
BEGIN
hr_api_user_hooks_utility.create_hooks_one_module
)p_api_module_id => 39 ( ;
;DBMS_OUTPUT.put_line ('Finished’)
EXCEPTION
WHEN OTHERS THEN
;DBMS_OUTPUT.put_line (SUBSTR (SQLERRM, 1, 255))
;END
/
*After Registration you should Activate the Module by the API Above,you can get the Module id
you should run from the table “HR_API_HOOKS” as Below:
Building Messages Raised when Loan Request Entries are Mistaken -5
*Go to Functional AdministratorCore servicesMessages Tab
*Press Create Message
*fill in Message ” XXMM_LOAN_AMOUNT_MSG” Body as Below:
*Repeat the previous step for the Message” XXMM_LOAN_DATE_MSG” as Below:
Setting up Approval Hierarchy based on Login User and Loan Amount (AME)-3
About Scenario Approval Management Engine (AME) - 1
Available Scenario Rules -2
Scenario AME Setup -3
Here in Picture above the Employee name: Abby, Caroline with User name : 567 Created a
new Loan Request with Amount 5000$ so the Approver was just its Supervisor “Ross, Dan
”with User name : 566
Here in Picture above the Employee name: Abby, Caroline with User name : 567 Created a
new Loan Request with Amount 10000$ so the Approvers were its Supervisor “Ross, Dan
with User name : 566” Plus the Upper Management Members (“Adams, Mr. Brian” and ”
Alexander, Mr. Felix”)
Here in Picture above the Employee name: Abby, Caroline with User name : 567 could not
create a new Loan Request with Amount 10001$ as “Abby, Caroline” is not a member in
.the Upper Management to be able to ask for a loan Amount more than 10000$
Note : I know that I mentioned this case in User Hook Section but I repeated it here to show you how to solve this Problem through the picture Below
Here in the Picture above Because “Alexander, Felix” is one of the Upper management
Members so he was able to ask for a loan Amount more than 10000$ (in Picture above the
Loan Amount is: 15000$), Plus there is not any approver because he is a member in the upper
management (there is not any Approvers for any request created by Upper Management
.Members )as I mentioned before
3- Scenario AME Setup
Here I will use Function Process “XXMM_HR_EIT_JSP_PRC”, Login User Type and Loan
,Amount as Basics to dedicate which Rule should run
Here I turned the Basics (Function Process “XXMM_HR_EIT_JSP_PRC”, Login User Type
and Loan Amount) into Attributes (Variables holding Values) in order to use them in
,building the Conditions and then Setting up the Rules
:Steps of doing so
* Login as a user that has AME responsibilities (ame_admin)
Go to and Click on “Approvals Management Business Analyst” responsibility *
* Type “Oracle Self Service Human Resources” in “Select Transaction Type”
* Click on “Attributes”
* Create a New Attribute (press – "Create")
* fill in the Attribute Body using the data in the table below :
Name XXMM_GET_LOAN_AMOUNT
Item Class Header
Description GET LOAN AMOUNT
“I built this attribute to know the loan Request Amount entry and then use it as a base to
define the Approval Hierarchy should approve it”
Data Type Number
Approver None
type
Value Set -
Usage type Dynamic
Value SELECT TV.VARCHAR2_VALUE AMOUNT
,FROM HR_API_TRANSACTION_STEPS TS
HR_API_TRANSACTION_VALUES TV
WHERE TS.TRANSACTION_STEP_ID = TV.TRANSACTION_STEP_ID
AND TS.TRANSACTION_ID = :transactionId
'AND TV.NAME = 'P_INFORMATION2_1
*after finish building of the Attribute Press Validate to check that the attribute syntax was built
successfully through information message appear in the upper left of window “ The query is
valid.”
* press Apply
Run the two below Database Functions on apps Schema as we will use them while building the attribute “ XXMM_IS_USER_UPPER_MANGEMENT”
BEGIN
SELECT CREATOR_PERSON_ID
INTO RTN_VAL
FROM HR_API_TRANSACTIONS
WHERE TRANSACTION_ID = P_TRANS_ID
AND ITEM_TYPE = 'HRSSA'
AND PROCESS_NAME = 'XXMM_HR_EIT_JSP_PRC';
RETURN RTN_VAL;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN 0;
WHEN TOO_MANY_ROWS THEN
RETURN 0;
WHEN OTHERS THEN
RETURN 0;
END;
/
XXMM_IS_USER_UPPER_MNGR_FNC CREATE OR REPLACE FUNCTION APPS.XXMM_IS_USER_UPPER_MNGR_FNC(P_PERSON_ID
in NUMBER)
RETURN CHAR
IS
RTN_VAL VARCHAR2(10);
BEGIN
SELECT PPEI.PERSON_ID
INTO RTN_VAL
FROM PER_PEOPLE_EXTRA_INFO PPEI,
FND_USER USR,
PER_ALL_PEOPLE_F PAPF,
PER_ALL_ASSIGNMENTS_F PAAF
WHERE PPEI.INFORMATION_TYPE = 'PQH_ROLE_USERS'
AND TO_NUMBER(PPEI.PEI_INFORMATION3) = 3193
AND PPEI.PEI_INFORMATION5 = 'Y'
AND PPEI.PERSON_ID = P_PERSON_ID
AND PPEI.PERSON_ID = USR.EMPLOYEE_ID
AND USR.END_DATE IS NULL
AND PPEI.PERSON_ID = PAPF.PERSON_ID
AND TRUNC(SYSDATE) BETWEEN PAPF.EFFECTIVE_START_DATE AND
NVL(PAPF.EFFECTIVE_END_DATE,TO_DATE('31/12/4000','dd/mm/yyyy'))
AND PPEI.PERSON_ID = PAAF.PERSON_ID
AND TRUNC(SYSDATE) BETWEEN PAAF.EFFECTIVE_START_DATE AND
NVL(PAAF.EFFECTIVE_END_DATE,TO_DATE('31/12/4000','dd/mm/yyyy'));
RETURN 'E';
EXCEPTION
END;
/
* Create another Attribute and fill in the Attribute Body using the data in the table below :
Name XXMM_IS_USER_UPPER_MANGEMENT
Item Class Header
Description IS USER UPPER MANGEMENT?
“I built this attribute to know the Login User Type (Member in Upper management or
not a Member In Upper Management) and then use it as a base to define the Approval
Hierarchy should approve it”
Data Type String
Approver None
type
Value Set -
Usage type Dynamic
Value SELECT XXMM_IS_USER_UPPER_MNGR_FNC(XXMM_GET_PERSON_ID(:transactionId))
from dual
I used here the two Database functions I mentioned above, one to get the person id “
and the other to get the type of the login user (Member in Upper management or not
a Member In Upper Management)
*after finish building of the Attribute Press Validate to check that the attribute syntax was built
successfully through information message appear in the upper left of window “ The query is
valid.”
* press Apply
* Create another Attribute and fill in the Attribute Body using the data in the table below :
Name WORKFLOW_PROCESS_NAME
“this Attribute is built in, so there is no need to build it again”
Item Class Header
Description Oracle Self Service Workflow process name for the given item type
Data Type String
Approver None
type
Value Set -
Usage type Dynamic
Value SELECT XXMM_IS_USER_UPPER_MNGR_FNC(XXMM_GET_PERSON_ID(:transactionId))
from dual SELECT hr_ameutil_ss.get_process_name(:transactionId)
FROM DUAL
*after finish building of the Attribute Press Validate to check that the attribute syntax was built
successfully through information message appear in the upper left of window “ The query is
valid.”
* press Apply
Note: after applying for a new Loan request , you should know that your Loan Request Entries
have not been saved / committed to HR Tables but saved to Temp Tables
“HR_API_TRANSACTIONS, HR_API_TRANSACTION_STEPS, HR_API_TRANSACTION_VALUES” ,
as soon as the Loan Request has been Approved , the Loan Request Entries will be moved to
HR Tables, I want to say that according to the Loan request entries in Temp Tables, the Rules
and then Approval Hierarchy are Defined.
Now let us start building the Conditions based on the Attributes we build earlier *
go to Conditions on Setup Tab and make sure that you make a condition of type Regular *
Create a New condition (press – "Create") *
: fill in the condition body using the Data in Table Below *
Press Apply *
Create a New condition (press – "Create") and fill in the condition body using the Data in *
:Table Below
Press Apply *
Create a New condition (press – "Create") and fill in the condition body using the Data in *
:Table Below
Condition type Ordinary
Attribute WORKFLOW_PROCESS_NAME
String Value XXMM_HR_EIT_JSP_PRC
Press Apply *
: after building All conditions, they should appear as below *
Name UPPER_MANAGEMENT_APPROVER
Description UPPER MANAGEMENT APPROVER
Order Number 10
Voting Method Serial
Usage Type Dynamic
Query SELECT 'PER:'||PPEI.PERSON_ID
,FROM PER_PEOPLE_EXTRA_INFO PPEI
,FND_USER USR,PER_ALL_PEOPLE_F PAPF
PER_ALL_ASSIGNMENTS_F PAAF
'WHERE PPEI.INFORMATION_TYPE = 'PQH_ROLE_USERS
AND TO_NUMBER(PPEI.PEI_INFORMATION3) = 3193
'AND PPEI.PEI_INFORMATION5 = 'Y
AND PPEI.PERSON_ID = USR.EMPLOYEE_ID
AND USR.END_DATE IS NULL
AND PPEI.PERSON_ID = PAPF.PERSON_ID
AND TRUNC(SYSDATE) BETWEEN PAPF.EFFECTIVE_START_DATE AND
NVL(PAPF.EFFECTIVE_END_DATE,TO_DATE('31/12/4000','dd/mm/yyyy'))
AND PPEI.PERSON_ID = PAAF.PERSON_ID
AND TRUNC(SYSDATE) BETWEEN PAAF.EFFECTIVE_START_DATE AND
NVL(PAAF.EFFECTIVE_END_DATE,TO_DATE('31/12/4000','dd/mm/yyyy'))
*after finish building of the Approver group Press Validate to check that the syntax was built
successfully through information message appear in the upper left of window “ The query is
valid.”
* Press Apply
: after building the Approver group, it should appear as below *
* Now let us start Building the Rules Based on the Conditions built earlier, as you can see
conditions depend on the attributes, rules depends on conditions plus the Approver groups
*Switch to Rules tab and press create
*Type the Rule Name “LOAN AMOUNT LESS OR EQUAL 5000” and select the Rule type “List
Creation”
Note : (this Rule will run when Loan Amount is less or equal 5000)
*Press Next
*Press Add Condition
*Search for conditions built earlier in Attribute field , Search then press go and then select
“WORKFLOW_PROCESS_NAME in (XXMM_HR_EIT_JSP_PRC)” condition and press
Continue as below:
*Press Add Condition Again , search for “XXMM_IS_USER_UPPER_MANGEMENT in (NE)”
Condition and press Continue as below:
*Press Next
*select Action type to be “supervisory Level” and select Action to be “Require approvals up to
the first superior, at most.” As below :
*Press Next
* review the rule and press finish
*Create another Rule as Below :
*Type the Rule Name “LOAN AMOUNT GREATER 5000” and select the Rule type “List Creation
Exception”
Note : (this Rule will run when Loan Amount is greater than 5000 and less or equal 10000, this type of rule should contain one exception
condition at least, this condition give the rule the priority to run, in more details the two rules in our Scenario have the same conditions but
the List creation exception Rule differ the list creation rule with this exception condition which give the rule the priority to run if it was
achieved)
*Press Next
*Press Add Condition
*Search for conditions built earlier in Attribute field , search then press go and then select
“WORKFLOW_PROCESS_NAME in (XXMM_HR_EIT_JSP_PRC)” condition and press
Continue as below:
*Press Add Condition Again , search for “XXMM_IS_USER_UPPER_MANGEMENT in (NE)”
Condition and press Continue as below:
*Press Add Condition Again , search for “XXMM_GET_LOAN_AMOUNT is greater than 5000
and less than or equal to 10000” Exception Condition and press Continue as below:
*Press Next
*select Action type to be “supervisory Level” and select Action to be “Require approvals up to
the first superior, at most.” As below :
*Press Add Action again and change the new Action type to be “approval-group chain of
authority” and change its action
To be “Require approval from UPPER_MANAGEMENT_APPROVER” (this approver group were
built earlier in approver groups) as below:
*Press Next
* Review the rule and press finish
Important Note : when a member of the Upper Management creates a new Loan Request , you can’t see any Approver for its Request, you know why?,
because our two available Rules just run for any Employee except the members of the Upper Management, the two rules(LOAN AMOUNT LESS OR EQUAL
5000,LOAN AMOUNT GREATER 5000) contain a Condition “XXMM_IS_USER_UPPER_MANGEMENT in (NE)”, which does not match if a member of the Upper
Management created a new Loan Request, but you can get Approvers for the Upper Management members Requests if you used the same Attribute with
another value in building a new condition like this “XXMM_IS_USER_UPPER_MANGEMENT in (E)” and joined this condition to a new rule.
Additional AME Knowledge -4
)Please do not try to Apply this Section unless you finished and tested the Scenario as a whole successfully (
Here I will build a new Substitution Rule, this rule is responsible for substitute an Approver with
another , substitute an approver with another may be because of absence or any other
.Reasons
:Steps of doing so
Go to Action Types on Setup Tab and Press Create in “Actions: Substitution” Region *
*Change Approver Type to be “HR People” and Approver to be the Employee you want to
substitute with(here I selected the employee “Reilly, Lauri” to substitute with) And press Apply
*Go to Conditions on Setup Tab and make sure that you make a condition of type List Modifiers
Press Create *
Change Approver Order to be “Any Approver” and Change Approver type to be “HR People” *
and Change Approver Name to be “Alexander, Felix” (Alexander is a member of Upper
Management as we mentioned earlier, he is absent and therefore we want to substitute him
:with another Approver) as below
Press Apply *
Go to Rules Tab and Press Create *
*Type the Rule Name “substitute an approver” and select the Rule type “Substitution”
*Press Next
*Press Conditions twice to insert our two conditions we mentioned earlier
“WORKFLOW_PROCESS_NAME in (XXMM_HR_EIT_JSP_PRC)” and
“XXMM_IS_USER_UPPER_MANGEMENT in (NE)” as Below:
*in “List Modification Conditions” Section , change Approver order to be “any Approver” and
change Approver to be “Alexander, Felix” and press Next
*change Action type to be “substitution” and Action to be “Substitute HR People: Reilly, Lauri
for the approver.” And press Next
*Review the Rule and press finish
BEGIN
/*
SELECT PAPF.FULL_NAME
INTO FULL_NAME
FROM PER_PEOPLE_EXTRA_INFO PPEI,PER_ALL_PEOPLE_F PAPF
WHERE PPEI.PERSON_ID = :NEW.PERSON_ID
AND TRUNC(SYSDATE) BETWEEN PAPF.EFFECTIVE_START_DATE AND
PAPF.EFFECTIVE_END_DATE;
*/
--INSERT INTO
TEST_TBL(PERSON_ID,LOAN_DEC_NO,LOAN_AMOUNT,LOAN_DATE)
VALUES(:NEW.PERSON_ID,:NEW.PEI_INFORMATION1,:NEW.PEI_INFORMATION2,:
NEW.PEI_INFORMATION3);
XXMM_SEND_TREASURY_PROC(:NEW.PERSON_ID,:NEW.PEI_INFORMATION1,:
NEW.PEI_INFORMATION2,:NEW.PEI_INFORMATION3,:NEW.PEI_INFORMATION4
);
END;
/
Procedure
Name XXMM_SEND_TREASURY_PROC
Syntax CREATE OR REPLACE procedure
APPS.XXMM_SEND_TREASURY_PROC(P_PERSON_ID VARCHAR2,P_DEC_NO
VARCHAR2,P_loan_amount VARCHAR2,p_loan_date VARCHAR2,P_loan_NOTES
VARCHAR2)
is
l_item_type varchar2(100);
l_item_key varchar2(100);
l_full_name varchar2(100);
l_user_name varchar2(100);
BEGIN
l_item_type :='TREASURY';
l_item_key:= TO_CHAR(SYSTIMESTAMP,'SS.FF3');
wf_engine.CREATEPROCESS(l_item_type,l_item_key,'TREASURY_PROC');
wf_engine.SETITEMATTRTEXT(itemtype=>l_item_type,
itemkey=>l_item_key,
aname=>'LOAN_REQUESTOR_NM',
avalue=>l_full_name);
wf_engine.SETITEMATTRTEXT(itemtype=>l_item_type,
itemkey=>l_item_key,
aname=>'LOAN_REQUESTOR_UN',
avalue=>l_user_name);
--Assign the Decision number to Attribute DECISION_NO —----------------------
wf_engine.SETITEMATTRTEXT(itemtype=>l_item_type,
itemkey=>l_item_key,
aname=>'DECISION_NO',
avalue=>P_DEC_NO);
wf_engine.SETITEMATTRTEXT(itemtype=>l_item_type,
itemkey=>l_item_key,
aname=>'LOAN_AMOUNT',
avalue=>P_loan_amount);
wf_engine.STARTPROCESS(l_item_type,l_item_key) ;
end;--xxmda_send_ntfy_proc
/
*I know that the Procedure “XXMM_SEND_TREASURY_PROC” is not well understood so I will show the meaning of it while Building the Custom Workflow
'TREASURY' But Please Try to Read the Comments, I think it is very Helpful to Understand.
*Click Verify
*Press OK and Press Save
5-Creating a new Loan Request from Scratch
Check the Notification Contents and then Press Ok (it is an FYI ”FOR YOUR INFORMATION” *
Notification)
Note that the Body of the Notification is the same as the Message Body Built earlier
اسألكم الدعاء لوالدى
بالرحمة والمغفرة