1: package body OKC_ASYNC_PVT as
2: /* $Header: OKCRASNB.pls 120.3.12020000.2 2012/07/16 16:14:41 harchand ship $ */
3:
4: l_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N');
5:
6: G_MUTE_PROFILE CONSTANT VARCHAR2(30) := 'OKC_SUPPRESS_EMAILS';
7: G_APP_NAME CONSTANT VARCHAR2(3) := OKC_API.G_APP_NAME;
8: G_PKG_NAME CONSTANT VARCHAR2(200) := 'OKC_ASYNC_PVT';
1099: -- RUN mode - normal process execution
1100: --
1101: /* MSENGUPT: Introduced the following code to re-read and reset the profile option in case of timeouts due to errors */
1102: if (funcmode <> 'RUN') then
1103: l_timeout_minutes := fnd_profile.value('OKC_ALERT_TIMEOUT');
1104: if l_timeout_minutes IS NOT NULL then
1105: wf_engine.SetItemAttrNumber (itemtype, itemkey, 'P_TIMEOUT_MINUTES', L_TIMEOUT_MINUTES);
1106: end if;
1107: end if;
2087: /* MSENGUPT: The following code is changed from the previous version to make it more effucient. ie. read c_wf_timeout only
2088: if l_timeout_minutes from profile options is NULL...... very less likely */
2089: -- determine the value of p_timeout_minutes
2090: If l_timeout_minutes IS NULL THEN
2091: l_timeout_minutes := fnd_profile.value('OKC_ALERT_TIMEOUT');
2092: IF l_timeout_minutes IS NULL THEN
2093: -- get the defualt value for p_timeout_minutes from the OKCALERT workflow
2094: OPEN c_wf_timeout;
2095: FETCH c_wf_timeout INTO l_wf_timeout_minutes;
2352: if (funcmode = 'RUN') then
2353: open c1(l_user_name);
2354: fetch c1 into l_user_id;
2355: close c1;
2356: l_p_value := FND_PROFILE.VALUE_SPECIFIC
2357: (NAME => G_MUTE_PROFILE||'_'||l_ntf_type,
2358: USER_ID => l_user_id,
2359: RESPONSIBILITY_ID => NULL,
2360: APPLICATION_ID => NULL);
2358: USER_ID => l_user_id,
2359: RESPONSIBILITY_ID => NULL,
2360: APPLICATION_ID => NULL);
2361: if (l_p_value is NULL) then
2362: l_p_value := FND_PROFILE.VALUE_SPECIFIC
2363: (NAME => G_MUTE_PROFILE,
2364: USER_ID => l_user_id,
2365: RESPONSIBILITY_ID=> NULL,
2366: APPLICATION_ID => NULL);
2453: if (funcmode = 'RUN') then
2454: open c1(l_user_name);
2455: fetch c1 into l_user_id;
2456: close c1;
2457: l_p_value := FND_PROFILE.VALUE_SPECIFIC
2458: (NAME => G_MUTE_PROFILE||'_'||l_ntf_type,
2459: USER_ID => l_user_id,
2460: RESPONSIBILITY_ID=> NULL,
2461: APPLICATION_ID => NULL);
2459: USER_ID => l_user_id,
2460: RESPONSIBILITY_ID=> NULL,
2461: APPLICATION_ID => NULL);
2462: if (l_p_value is NULL) then
2463: l_p_value := FND_PROFILE.VALUE_SPECIFIC
2464: (NAME => G_MUTE_PROFILE,
2465: USER_ID => l_user_id,
2466: RESPONSIBILITY_ID=> NULL,
2467: APPLICATION_ID => NULL);
2561: if (funcmode = 'RUN') then
2562: open c1(l_user_name);
2563: fetch c1 into l_user_id;
2564: close c1;
2565: l_p_value := FND_PROFILE.VALUE_SPECIFIC
2566: (NAME => G_MUTE_PROFILE||'_'||l_ntf_type,
2567: USER_ID => l_user_id,
2568: RESPONSIBILITY_ID=> NULL,
2569: APPLICATION_ID => NULL);
2567: USER_ID => l_user_id,
2568: RESPONSIBILITY_ID=> NULL,
2569: APPLICATION_ID => NULL);
2570: if (l_p_value is NULL) then
2571: l_p_value := FND_PROFILE.VALUE_SPECIFIC
2572: (NAME => G_MUTE_PROFILE,
2573: USER_ID => l_user_id,
2574: RESPONSIBILITY_ID=> NULL,
2575: APPLICATION_ID => NULL);
2671: if (funcmode = 'RUN') then
2672: open c1(l_user_name);
2673: fetch c1 into l_user_id;
2674: close c1;
2675: l_p_value := FND_PROFILE.VALUE_SPECIFIC
2676: (NAME => G_MUTE_PROFILE||'_'||l_ntf_type,
2677: USER_ID => l_user_id,
2678: RESPONSIBILITY_ID=> NULL,
2679: APPLICATION_ID => NULL);
2677: USER_ID => l_user_id,
2678: RESPONSIBILITY_ID=> NULL,
2679: APPLICATION_ID => NULL);
2680: if (l_p_value is NULL) then
2681: l_p_value := FND_PROFILE.VALUE_SPECIFIC
2682: (NAME => G_MUTE_PROFILE,
2683: USER_ID => l_user_id,
2684: RESPONSIBILITY_ID=> NULL,
2685: APPLICATION_ID => NULL);
2781: if (funcmode = 'RUN') then
2782: open c1(l_user_name);
2783: fetch c1 into l_user_id;
2784: close c1;
2785: l_p_value := FND_PROFILE.VALUE_SPECIFIC
2786: (NAME => G_MUTE_PROFILE||'_'||l_ntf_type,
2787: USER_ID => l_user_id,
2788: RESPONSIBILITY_ID=> NULL,
2789: APPLICATION_ID => NULL);
2787: USER_ID => l_user_id,
2788: RESPONSIBILITY_ID=> NULL,
2789: APPLICATION_ID => NULL);
2790: if (l_p_value is NULL) then
2791: l_p_value := FND_PROFILE.VALUE_SPECIFIC
2792: (NAME => G_MUTE_PROFILE,
2793: USER_ID => l_user_id,
2794: RESPONSIBILITY_ID=> NULL,
2795: APPLICATION_ID => NULL);
2891: if (funcmode = 'RUN') then
2892: open c1(l_user_name);
2893: fetch c1 into l_user_id;
2894: close c1;
2895: l_p_value := FND_PROFILE.VALUE_SPECIFIC
2896: (NAME => G_MUTE_PROFILE||'_'||l_ntf_type,
2897: USER_ID => l_user_id,
2898: RESPONSIBILITY_ID=> NULL,
2899: APPLICATION_ID => NULL);
2897: USER_ID => l_user_id,
2898: RESPONSIBILITY_ID=> NULL,
2899: APPLICATION_ID => NULL);
2900: if (l_p_value is NULL) then
2901: l_p_value := FND_PROFILE.VALUE_SPECIFIC
2902: (NAME => G_MUTE_PROFILE,
2903: USER_ID => l_user_id,
2904: RESPONSIBILITY_ID=> NULL,
2905: APPLICATION_ID => NULL);