Following plsql block will create icx session ticket based on logged in user and his responsibility. If there is an existing session ticket, we can validate using API used in the block.
DECLARE
l_user_name VARCHAR2(50) := 'PANKAJ_MANDALIYA';
l_resp_name VARCHAR2(100) := 'Oracle Configurator Developer';
l_user_id NUMBER;
l_resp_id NUMBER;
l_appl_id NUMBER;
l_icx_ticket VARCHAR2(50);
l_session_id VARCHAR2(50);
l_result VARCHAR2(50);
BEGIN
SELECT fnd.user_id
INTO l_user_id
FROM fnd_user fnd
WHERE fnd.user_name = l_user_name;
SELECT DISTINCT fresp.responsibility_id,
fresp.application_id
INTO l_resp_id,
l_appl_id
FROM fnd_responsibility_tl fresp
WHERE fresp.responsibility_name = l_resp_name;
dbms_output.put_line('user_id = ' || l_user_id || ', resp_id = ' || l_resp_id || ', appl_id = ' || l_appl_id);
fnd_global.apps_initialize(l_user_id,l_resp_id,l_appl_id);
l_icx_ticket:=cz_cf_api.icx_session_ticket;
dbms_output.put_line('ICX Ticket = ' || l_icx_ticket);
l_session_id := fnd_session_utilities.XSID_to_SessionID(l_icx_ticket);
dbms_output.put_line('Session Id = ' || l_session_id);
l_result := fnd_session_management.check_session (p_session_id => l_session_id, p_resp_id => l_resp_id, p_app_resp_id => l_appl_id, p_tickle => 'N');
dbms_output.put_line('Session validation result = ' || l_result);
END;
DECLARE
l_user_name VARCHAR2(50) := 'PANKAJ_MANDALIYA';
l_resp_name VARCHAR2(100) := 'Oracle Configurator Developer';
l_user_id NUMBER;
l_resp_id NUMBER;
l_appl_id NUMBER;
l_icx_ticket VARCHAR2(50);
l_session_id VARCHAR2(50);
l_result VARCHAR2(50);
BEGIN
SELECT fnd.user_id
INTO l_user_id
FROM fnd_user fnd
WHERE fnd.user_name = l_user_name;
SELECT DISTINCT fresp.responsibility_id,
fresp.application_id
INTO l_resp_id,
l_appl_id
FROM fnd_responsibility_tl fresp
WHERE fresp.responsibility_name = l_resp_name;
dbms_output.put_line('user_id = ' || l_user_id || ', resp_id = ' || l_resp_id || ', appl_id = ' || l_appl_id);
fnd_global.apps_initialize(l_user_id,l_resp_id,l_appl_id);
l_icx_ticket:=cz_cf_api.icx_session_ticket;
dbms_output.put_line('ICX Ticket = ' || l_icx_ticket);
l_session_id := fnd_session_utilities.XSID_to_SessionID(l_icx_ticket);
dbms_output.put_line('Session Id = ' || l_session_id);
l_result := fnd_session_management.check_session (p_session_id => l_session_id, p_resp_id => l_resp_id, p_app_resp_id => l_appl_id, p_tickle => 'N');
dbms_output.put_line('Session validation result = ' || l_result);
END;