DBA Data[Home] [Help]

PACKAGE BODY: APPS.CUSTOMIZED_AG_ERR_MESSAGES

Source


1 PACKAGE BODY CUSTOMIZED_AG_ERR_MESSAGES AS
2 /* $Header: POXAGERB.pls 115.3 2002/11/23 03:36:21 sbull ship $ */
3 
4 
5 /*
6    Created : Imran Ali 02/11/99
7 */
8 
9 --
10 -- Set_Message_Attribute
11 --   Sets the workflow error attribute with an encoded form of the message to be
12 --   passed back to the client.
13 --   Can take a max of 3 tokens and their values.
14 -- IN
15 --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
16 --   itemkey   - A string generated by call to AOL's INITIALIZE routine.
17 --   funcmode  - Run/Cancel
18 -- OUT
19 --   Result
20 --	none
21 
22 --
23 -- Function Attributes
24 --	application_code - Short name of the application the message is associated with
25 --	message_name   	 - Message name as defined in the message dictionary
26 -- 	token1 		 - First token to be substituted in the message
27 -- 	token1_value 	 - Value of the first token to be substituted in the message
28 -- 	token2 		 - Second token to be substituted in the message
29 -- 	token2_value 	 - Value of the second token to be substituted in the message
30 -- 	token3 		 - Third token to be substituted in the message
31 -- 	token3_value 	 - Value of the third token to be substituted in the message
32 --
33 
34 procedure  Set_Message_Attribute ( itemtype        in  varchar2,
35                               	   itemkey         in  varchar2,
36 	                           actid           in number,
37                                    funcmode        in  varchar2,
38                                    result          out NOCOPY varchar2    )
39 IS
40 	application_code	varchar2(25);
41 	FB_ERROR_MSG  		varchar2(2000);
42         message_name 		varchar2(250);
43 	token1			varchar2(60);
44 	token1_value		varchar2(60);
45 	token2			varchar2(60);
46 	token2_value		varchar2(60);
47 	token3			varchar2(60);
48 	token3_value		varchar2(60);
49 	x_progress              varchar2(1) := '0';
50 begin
51 
52   -- Do nothing in cancel or timeout mode
53 
54   if (funcmode <> wf_engine.eng_run) then
55       result := wf_engine.eng_null;
56       return;
57   end if;
58 
59   -- Get the function activity attributes
60 
61   application_code := wf_engine.GetActivityAttrText(itemtype, itemkey, actid, 'APPLICATION_CODE');
62   message_name 	   := wf_engine.GetActivityAttrText(itemtype, itemkey, actid, 'MESSAGE_NAME');
63   token1 	   := wf_engine.GetActivityAttrText(itemtype, itemkey, actid, 'TOKEN1');
64   token1_value 	   := wf_engine.GetActivityAttrText(itemtype, itemkey, actid, 'TOKEN1_VALUE');
65   token2 	   := wf_engine.GetActivityAttrText(itemtype, itemkey, actid, 'TOKEN2');
66   token2_value 	   := wf_engine.GetActivityAttrText(itemtype, itemkey, actid, 'TOKEN2_VALUE');
67   token3 	   := wf_engine.GetActivityAttrText(itemtype, itemkey, actid, 'TOKEN3');
68   token3_value 	   := wf_engine.GetActivityAttrText(itemtype, itemkey, actid, 'TOKEN3_VALUE');
69 
70   x_progress := '1';
71 
72   Begin
73   	FND_MESSAGE.SET_NAME(application_code, message_name);
74 
75   	x_progress := '2';
76 	if token1 is not null then
77   		FND_MESSAGE.SET_TOKEN(token1, token1_value);
78 	end if;
79 
80 	if token2 is not null then
81   		FND_MESSAGE.SET_TOKEN(token2, token2_value);
82 	end if;
83 
84 	if token3 is not null then
85   		FND_MESSAGE.SET_TOKEN(token3, token3_value);
86 	end if;
87 
88   	FB_ERROR_MSG := FND_MESSAGE.GET_ENCODED;
89 
90   	x_progress := '3';
91 	if FB_ERROR_MSG is not null then
92   		wf_engine.SetItemAttrText (  itemtype=>itemtype,
93                 	                     itemkey=>itemkey,
94                         	             aname=>'ERROR_MESSAGE',
95                                 	     avalue=>FB_ERROR_MSG );
96 	end if;
97 
98   Exception
99 	When others then
100 		null;
101   End;
102 
103   return;
104 
105 EXCEPTION
106   WHEN OTHERS THEN
107     	wf_core.context('CUSTOMIZED_AG_ERR_MESSAGES','Set_Message_Attribute',x_progress);
108     	raise;
109 end Set_Message_Attribute;
110 
111 END CUSTOMIZED_AG_ERR_MESSAGES;