DBA Data[Home] [Help]

PACKAGE BODY: APPS.XNP_DEF_JEOPARDY_LOGIC

Source


1 PACKAGE BODY xnp_def_jeopardy_logic AS
2 /* $Header: XNPJTMRB.pls 120.1 2005/06/21 04:08:18 appldev ship $ */
3 
4 --------------------------------------------------------------------------------
5 -----  API Name      : notify_fmc
6 -----  Type          : Private
7 -----  Purpose       : Starts a workflow to notify the FMC. The FMC waits for a
8 -----                  response from an FMC user.
9 -----  Parameters    : p_msg_header
10 --------------------------------------------------------------------------------
11 
12 
13 PROCEDURE notify_fmc (
14 	p_msg_header IN XNP_MESSAGE.MSG_HEADER_REC_TYPE
15 )
16 IS
17 l_item_type	VARCHAR2(1024);
18 l_item_key	VARCHAR2(1024);
19 
20 l_parent_item_type	VARCHAR2(1024);
21 l_parent_item_key	VARCHAR2(1024);
22 
23 CURSOR parent_process_rec(p_order_id IN NUMBER) IS
24 	SELECT	WF_ITEM_TYPE, WF_ITEM_KEY
25 	FROM	xdp_order_headers
26 	WHERE	order_id = p_order_id;
27 
28 BEGIN
29 
30 	l_item_type := 'XDPWFSTD';
31 
32 	l_item_key := 'XDP_ORDER_' || TO_CHAR(p_msg_header.order_id);
33 
34 	wf_core.context('XDP_WF_STANDARD',
35 			'ORDER_JEOPARDY_NOTIFICATION',
36 			l_item_type,
37 			l_item_key);
38 
39 	wf_engine.createprocess(l_item_type,
40 				l_item_key,
41 				'ORDER_JEOPARDY_NOTIFICATION');
42 
43 	-- BUG 1621513
44 	-- get the parent workflow  process keys
45 	-- and link the new workflow process to the parent
46 	-- BUG 2009983
47 	-- This may hinder the logic behind  "Notification" button on the FMC
48 
49 --	FOR rec IN parent_process_rec(p_msg_header.order_id)
50 --	LOOP
51 --		l_parent_item_type := rec.WF_ITEM_TYPE;
52 --		l_parent_item_key := rec.WF_ITEM_KEY;
53 --		exit;
54 --	END LOOP;
55 
56 --	wf_engine.SetItemParent(
57 --		itemType => l_item_type,
58 --		itemKey	 => l_item_key,
59 --		parent_itemType => l_parent_item_type,
60 --		parent_itemKey	 => l_parent_item_key,
61 --		parent_context	 => NULL);
62 
63 	wf_engine.SetItemAttrNumber(
64 		itemType => l_item_type,
65 		itemKey	 => l_item_key,
66 		aname => 'ORDER_ID',
67 		avalue => p_msg_header.order_id);
68 
69 	wf_engine.startprocess(l_item_type,
70 		l_item_key);
71 
72 END notify_fmc;
73 
74 END XNP_DEF_JEOPARDY_LOGIC;