1527: -- Business Rules :
1528: -- Parameters : itemtype, itemkey, actid, funcmode, resultout, p_user_id,
1529: -- x_name, x_description
1530: -- Version : 1.1
1531: -- MDOKAL : Bug 2902588, changed code to check for fnd_user info 1st
1532: -- and then WF_ROLES instead of WF_USERS.
1533: -- : 19-NOV-03 MDOKAL Bug 3262184 - changed order in which
1534: -- wf users are retrieved.
1535: -- End of comments
1548: FROM WF_ROLES
1549: WHERE orig_system_id = c_emp_id
1550: AND orig_system = c_system;
1551:
1552: CURSOR fnd_users_csr(c_user_id NUMBER)
1553: IS
1554: SELECT USER_NAME, DESCRIPTION, EMPLOYEE_ID
1555: FROM FND_USER
1556: WHERE user_id = c_user_id;
1551:
1552: CURSOR fnd_users_csr(c_user_id NUMBER)
1553: IS
1554: SELECT USER_NAME, DESCRIPTION, EMPLOYEE_ID
1555: FROM FND_USER
1556: WHERE user_id = c_user_id;
1557:
1558: l_user VARCHAR2(50);
1559: l_desc VARCHAR2(100);
1569: OKL_DEBUG_PUB.LOG_DEBUG(G_LEVEL_PROCEDURE,L_MODULE_NAME,'Begin(+)');
1570: END IF;
1571:
1572: /* The logic for retrieving a wf user follows this hierarchy:
1573: [Step 1] First check if p_user_id is for an FND user.
1574: [Step 2] If FND user found, then find if attached to a HR person
1575: [Step 3] If Step 2 is TRUE then get user where orig system is 'PER'
1576: based on the HR person id (l_emp)
1577: [Step 4] If Step 2 TRUE but l_emp is NULL therefore not attached
1570: END IF;
1571:
1572: /* The logic for retrieving a wf user follows this hierarchy:
1573: [Step 1] First check if p_user_id is for an FND user.
1574: [Step 2] If FND user found, then find if attached to a HR person
1575: [Step 3] If Step 2 is TRUE then get user where orig system is 'PER'
1576: based on the HR person id (l_emp)
1577: [Step 4] If Step 2 TRUE but l_emp is NULL therefore not attached
1578: to a HR person, use the FND user as is.
1574: [Step 2] If FND user found, then find if attached to a HR person
1575: [Step 3] If Step 2 is TRUE then get user where orig system is 'PER'
1576: based on the HR person id (l_emp)
1577: [Step 4] If Step 2 TRUE but l_emp is NULL therefore not attached
1578: to a HR person, use the FND user as is.
1579: [Step 5] If FND user not found, then check if the p_user_id passed
1580: is indeed for a HR person that is attached to an FND user.
1581: [Step 6] If FND user not found and PER user not found, check if the
1582: p_user_id pertains to a HR person not attached to an FND user.
1575: [Step 3] If Step 2 is TRUE then get user where orig system is 'PER'
1576: based on the HR person id (l_emp)
1577: [Step 4] If Step 2 TRUE but l_emp is NULL therefore not attached
1578: to a HR person, use the FND user as is.
1579: [Step 5] If FND user not found, then check if the p_user_id passed
1580: is indeed for a HR person that is attached to an FND user.
1581: [Step 6] If FND user not found and PER user not found, check if the
1582: p_user_id pertains to a HR person not attached to an FND user.
1583: [Step 7] Finally, this is an invalid user, user the sysadmin user.
1576: based on the HR person id (l_emp)
1577: [Step 4] If Step 2 TRUE but l_emp is NULL therefore not attached
1578: to a HR person, use the FND user as is.
1579: [Step 5] If FND user not found, then check if the p_user_id passed
1580: is indeed for a HR person that is attached to an FND user.
1581: [Step 6] If FND user not found and PER user not found, check if the
1582: p_user_id pertains to a HR person not attached to an FND user.
1583: [Step 7] Finally, this is an invalid user, user the sysadmin user.
1584:
1577: [Step 4] If Step 2 TRUE but l_emp is NULL therefore not attached
1578: to a HR person, use the FND user as is.
1579: [Step 5] If FND user not found, then check if the p_user_id passed
1580: is indeed for a HR person that is attached to an FND user.
1581: [Step 6] If FND user not found and PER user not found, check if the
1582: p_user_id pertains to a HR person not attached to an FND user.
1583: [Step 7] Finally, this is an invalid user, user the sysadmin user.
1584:
1585: */
1578: to a HR person, use the FND user as is.
1579: [Step 5] If FND user not found, then check if the p_user_id passed
1580: is indeed for a HR person that is attached to an FND user.
1581: [Step 6] If FND user not found and PER user not found, check if the
1582: p_user_id pertains to a HR person not attached to an FND user.
1583: [Step 7] Finally, this is an invalid user, user the sysadmin user.
1584:
1585: */
1586: -- 1st Check fnd users
1582: p_user_id pertains to a HR person not attached to an FND user.
1583: [Step 7] Finally, this is an invalid user, user the sysadmin user.
1584:
1585: */
1586: -- 1st Check fnd users
1587: OPEN fnd_users_csr(p_user_id);
1588: FETCH fnd_users_csr INTO l_user, l_desc, l_emp;
1589: IF fnd_users_csr%notfound THEN
1590: -- 2nd check if id passed belongs to an employee rather then fnd user
1583: [Step 7] Finally, this is an invalid user, user the sysadmin user.
1584:
1585: */
1586: -- 1st Check fnd users
1587: OPEN fnd_users_csr(p_user_id);
1588: FETCH fnd_users_csr INTO l_user, l_desc, l_emp;
1589: IF fnd_users_csr%notfound THEN
1590: -- 2nd check if id passed belongs to an employee rather then fnd user
1591: OPEN wf_roles_csr(p_user_id, 'PER');
1584:
1585: */
1586: -- 1st Check fnd users
1587: OPEN fnd_users_csr(p_user_id);
1588: FETCH fnd_users_csr INTO l_user, l_desc, l_emp;
1589: IF fnd_users_csr%notfound THEN
1590: -- 2nd check if id passed belongs to an employee rather then fnd user
1591: OPEN wf_roles_csr(p_user_id, 'PER');
1592: FETCH wf_roles_csr INTO l_user, l_desc;
1585: */
1586: -- 1st Check fnd users
1587: OPEN fnd_users_csr(p_user_id);
1588: FETCH fnd_users_csr INTO l_user, l_desc, l_emp;
1589: IF fnd_users_csr%notfound THEN
1590: -- 2nd check if id passed belongs to an employee rather then fnd user
1591: OPEN wf_roles_csr(p_user_id, 'PER');
1592: FETCH wf_roles_csr INTO l_user, l_desc;
1593: IF wf_roles_csr%notfound THEN
1586: -- 1st Check fnd users
1587: OPEN fnd_users_csr(p_user_id);
1588: FETCH fnd_users_csr INTO l_user, l_desc, l_emp;
1589: IF fnd_users_csr%notfound THEN
1590: -- 2nd check if id passed belongs to an employee rather then fnd user
1591: OPEN wf_roles_csr(p_user_id, 'PER');
1592: FETCH wf_roles_csr INTO l_user, l_desc;
1593: IF wf_roles_csr%notfound THEN
1594: CLOSE wf_roles_csr;
1591: OPEN wf_roles_csr(p_user_id, 'PER');
1592: FETCH wf_roles_csr INTO l_user, l_desc;
1593: IF wf_roles_csr%notfound THEN
1594: CLOSE wf_roles_csr;
1595: -- Maybe a HR user not attached to FND user
1596: OPEN wf_roles_csr(p_user_id, 'HZ_PARTY');
1597: FETCH wf_roles_csr INTO l_user, l_desc;
1598: CLOSE wf_roles_csr;
1599: ELSE
1599: ELSE
1600: CLOSE wf_roles_csr;
1601: END IF;
1602: END IF;
1603: CLOSE fnd_users_csr;
1604:
1605: -- if l_emp is not null then the user is attached to an employee
1606: IF l_emp IS NOT NULL THEN
1607: