248: oe_debug_pub.add('header_id: ' || p_header_id);
249: oe_debug_pub.add('line_id: ' || p_line_id);
250: oe_debug_pub.add('profile option: '|| p_profile_option_name);
251: END IF;
252: IF OE_GLOBALS.G_FLOW_RESTARTED AND (l_debug_level > 0) THEN
253: oe_debug_pub.add('FLOW_RESTARTED GLOBAL set to TRUE');
254: ELSE
255: oe_debug_pub.add('FLOW_RESTARTED GLOBAL set to FALSE');
256: END IF;
254: ELSE
255: oe_debug_pub.add('FLOW_RESTARTED GLOBAL set to FALSE');
256: END IF;
257:
258: IF OE_GLOBALS.G_USE_CREATED_BY_CONTEXT AND (l_debug_level > 0) THEN
259: oe_debug_pub.add('USE CREATED_BY GLOBAL set to TRUE');
260: ELSE
261: oe_debug_pub.add('USE CREATED_BY GLOBAL set to FALSE');
262: END IF;
263:
264:
265:
266:
267: IF OE_GLOBALS.G_FLOW_RESTARTED
268: OR OE_GLOBALS.G_USE_CREATED_BY_CONTEXT
269: -- Bug 4884429, added following OR condition
270: OR (p_profile_option_name = 'OE_NOTIFICATION_APPROVER') THEN
271: --this profile is being accessed as part of a restarted flow or in a flow which should used the created by context
264:
265:
266:
267: IF OE_GLOBALS.G_FLOW_RESTARTED
268: OR OE_GLOBALS.G_USE_CREATED_BY_CONTEXT
269: -- Bug 4884429, added following OR condition
270: OR (p_profile_option_name = 'OE_NOTIFICATION_APPROVER') THEN
271: --this profile is being accessed as part of a restarted flow or in a flow which should used the created by context
272:
271: --this profile is being accessed as part of a restarted flow or in a flow which should used the created by context
272:
273:
274: IF p_header_id IS NOT NULL THEN
275: l_wf_entity := OE_GLOBALS.G_WFI_HDR;
276: p_entity_id := p_header_id;
277: l_id_passed := 'Y';
278: ELSIF p_line_id IS NOT NULL THEN
279: l_wf_entity := OE_GLOBALS.G_WFI_LIN;
275: l_wf_entity := OE_GLOBALS.G_WFI_HDR;
276: p_entity_id := p_header_id;
277: l_id_passed := 'Y';
278: ELSIF p_line_id IS NOT NULL THEN
279: l_wf_entity := OE_GLOBALS.G_WFI_LIN;
280: p_entity_id := p_line_id;
281: l_id_passed := 'Y';
282: END IF;
283:
303: BEGIN
304: IF l_debug_level > 0 THEN
305: oe_debug_pub.add('getting user and org from base tables');
306: END IF;
307: IF l_wf_entity = OE_GLOBALS.G_WFI_HDR THEN
308:
309: SELECT created_by, org_id
310: INTO l_cached_user_id, l_cached_org_id
311: FROM oe_order_headers_all
453: IF l_debug_level > 0 THEN
454: oe_debug_pub.add('profile option value from value: ' || l_profile_option_value);
455: END IF;
456: END IF;
457: -- end of OE_GLOBALS.G_FLOW_RESTARTED OR
458: -- OE_GLOBALS.G_USE_CREATED_BY_CONTEXT
459: -- at this point we should have the profile option value
460: IF l_debug_level > 0 THEN
461: oe_debug_pub.add('profile option value being returned: ' || l_profile_option_value);
454: oe_debug_pub.add('profile option value from value: ' || l_profile_option_value);
455: END IF;
456: END IF;
457: -- end of OE_GLOBALS.G_FLOW_RESTARTED OR
458: -- OE_GLOBALS.G_USE_CREATED_BY_CONTEXT
459: -- at this point we should have the profile option value
460: IF l_debug_level > 0 THEN
461: oe_debug_pub.add('profile option value being returned: ' || l_profile_option_value);
462: oe_debug_pub.add('EXITING OE_PROFILE.VALUE');
499: oe_debug_pub.add('entity_id: ' || p_entity_id);
500: END IF;
501:
502:
503: IF (p_entity = OE_GLOBALS.G_WFI_HDR) THEN
504: IF Header_Context_Tbl.EXISTS(p_entity_id) THEN
505: IF l_debug_level > 0 THEN
506: oe_debug_pub.add('Context was found in cache');
507: END IF;
523: x_org_id := null;
524: x_result := 'F';
525: END IF;
526: --end of Header_Context_Tbl.EXISTS(p_entity_id)
527: ELSIF (p_entity = OE_GLOBALS.G_WFI_LIN) THEN
528: IF Line_Context_Tbl.EXISTS(p_entity_id) THEN
529: IF l_debug_level > 0 THEN
530: oe_debug_pub.add('Context was found in cache');
531: END IF;
548: x_result := 'F';
549: END IF;
550: --end of Line_Context_Tbl.EXISTS(p_entity_id)
551: END IF;
552: --end of p_entity = OE_GLOBALS.G_WFI_HDR
553:
554: IF l_debug_level > 0 THEN
555: oe_debug_pub.add('application from cache: ' || x_application_id);
556: oe_debug_pub.add('user from cache: ' || x_user_id);
603: END IF;
604:
605:
606:
607: IF (p_entity = OE_GLOBALS.G_WFI_HDR) THEN
608: IF l_debug_level > 0 THEN
609: oe_debug_pub.add('the cache is currently holding ' || Header_Context_Tbl.count || ' records.');
610: END IF;
611:
674: END IF;
675: -- end of Header_Context_Tbl.count < MAX_CONTEXT_CACHE_SIZE
676:
677:
678: ELSIF (p_entity = OE_GLOBALS.G_WFI_LIN) THEN
679: IF l_debug_level > 0 THEN
680: oe_debug_pub.add('the cache is currently holding ' || Line_Context_Tbl.count || ' records.');
681: END IF;
682:
744: END IF;
745: -- end of Line_Context_Tbl.count < MAX_CONTEXT_CACHE_SIZE
746:
747: END IF;
748: -- End of p_entity = OE_GLOBALS.G_WFI_HDR
749:
750:
751: EXCEPTION
752: WHEN OTHERS THEN