1 PACKAGE PA_AUTOALLOC_WF_PKG AS
2 /* $Header: PAXWFALS.pls 120.2 2006/05/31 23:00:48 skannoji noship $ */
3
4 -- Public variables
5 PA_item_type Varchar2(10) := 'PASDALOC';
6 PA_item_key Varchar2(40) ;
7 G_FILE Varchar2(255) := null;
8 G_DIR Varchar2(255) ;
9 G_FILE_PTR utl_file.file_type;
10 G_err_name Varchar2(30);
11 G_err_msg Varchar2(2000);
12 G_err_stack Varchar2(32000);
13 G_Err_Stage Varchar2(200);
14 -------------------------------------------------------------------------------
15 -- Procedure
16 -- Launch_PA_WF
17 -- Purpose
18 -- Called from GL Workflow
19 -- It launches PA workflow.It creates PA Step Down Allocation Process
20 -- and starts it.
21 -- Arguments
22 -- standard work-flow activity arguments.
23
24 PROCEDURE Launch_PA_WF ( p_item_type IN VARCHAR2,
25 p_item_key IN VARCHAR2,
26 p_actid IN NUMBER,
27 p_funcmode IN VARCHAR2,
28 p_result OUT NOCOPY VARCHAR2);
29
30 -------------------------------------------------------------------------------
31 -- Procedure
32 -- initialize_pa_wf
33 -- Arguments
34 -- Nil
35 -- Purpose
36 -- Called from Launch_PA_WF
37 -- Initilize all work flow item attributes
38
39 PROCEDURE initialize_pa_wf;
40
41 -------------------------------------------------------------------------------
42
43 -- Procedure
44 -- Initialize_Debug
45 -- Arguments
46 -- None
47 -- Purpose
48 -- Called from Workflow activity
49 -- Determines what is the batch type of the step
50
51 PROCEDURE initialize_debug;
52
53 -------------------------------------------------------------------------------
54
55 -- Procedure
56 -- WriteDebugMsg
57 -- Arguments
58 -- debug_message
59 -- Purpose
60 -- Called from most of the procedures/functions in this package
61 -- Writes debug Msg to the log file if Debug Flag is on
62
63 Procedure WriteDebugMsg(debug_message in Varchar2);
64
65 --------------------------------------------------------------------------------
66
67 -- Procedure
68 -- Get_Status_And_Message
69 -- Arguments
70 -- conc_prog_code: Code of the Concurrent Program
71 -- ptype: context type like PENDING,COMPLETE,ERROR,RUNNING,EXCEPTION etc.
72 -- rollback_allowed: Flag indicates rollback is allowed or not
73 -- status_code: set status code like ALPC (Allocation Process is complete)
74 -- to update GL_AUTO_ALLOC_BATCH_HISTORY
75 -- message_name: set message name defined in workflow. This message will
76 -- be attached to notification
77 -- Purpose
78 -- Called from most of the procedures/functions in this package
79 -- Writes debug Msg to the log file if Debug Flag is on
80
81 Procedure Get_Status_and_Message(
82 p_conc_prg_code IN Varchar2
83 ,p_ptype IN Varchar2
84 ,p_rollback_allowed IN Varchar2
85 ,x_status_code OUT NOCOPY Varchar2
86 ,x_message_name OUT NOCOPY Varchar2 );
87 -------------------------------------------------------------------------------
88 /** This function submits a concurrent request and returns the request id **/
89
90 Function Submit_Conc_Process(
91 p_prog_code IN VARCHAR2
92 ,p_arg1 IN VARCHAR2 DEFAULT NULL
93 ,p_arg2 IN VARCHAR2 DEFAULT NULL
94 ,p_arg3 IN VARCHAR2 DEFAULT NULL
95 ,p_arg4 IN VARCHAR2 DEFAULT NULL
96 ,p_arg5 IN VARCHAR2 DEFAULT NULL
97 ,p_arg6 IN VARCHAR2 DEFAULT NULL
98 ,p_arg7 IN VARCHAR2 DEFAULT NULL
99 ,p_arg8 IN VARCHAR2 DEFAULT NULL
100 ,p_arg9 IN VARCHAR2 DEFAULT NULL
101 ,p_arg10 IN VARCHAR2 DEFAULT NULL
102 ,p_arg11 IN VARCHAR2 DEFAULT NULL
103 ,p_arg12 IN VARCHAR2 DEFAULT NULL
104 ,p_arg13 IN VARCHAR2 DEFAULT NULL
105 ,p_arg14 IN VARCHAR2 DEFAULT NULL
106 ,p_arg15 IN VARCHAR2 DEFAULT NULL)
107
108 Return Number;
109
110 -------------------------------------------------------------------------------
111
112 /** This function submits Concurrent Process to generate Project Allocation Transactions.This is called from PA Step down Allocation Work Flow **/
113
114 PROCEDURE Submit_Alloc_Process( p_item_type IN VARCHAR2,
115 p_item_key IN VARCHAR2,
116 p_actid IN NUMBER,
117 p_funcmode IN VARCHAR2,
118 p_result OUT NOCOPY VARCHAR2);
119
120 --------------------------------------------------------------------------------
121
122 /** This function submits Concurrent Process to release Project Allocation Transactions.This is called from PA Step down Allocation Work Flow **/
123
124 PROCEDURE Submit_Conc_AllocRls( p_item_type IN VARCHAR2,
125 p_item_key IN VARCHAR2,
126 p_actid IN NUMBER,
127 p_funcmode IN VARCHAR2,
128 p_result OUT NOCOPY VARCHAR2) ;
129
130 -------------------------------------------------------------------------------
131
132 /** This function submits Concurrent Process to Distribute Cost.This is called from PA Step down Allocation Work Flow **/
133
134 PROCEDURE Submit_Conc_Process_Dist( p_item_type IN VARCHAR2,
135 p_item_key IN VARCHAR2,
136 p_actid IN NUMBER,
137 p_funcmode IN VARCHAR2,
138 p_result OUT NOCOPY VARCHAR2);
139
140 -------------------------------------------------------------------------------
141
142 /** This function submits Concurrent Process to Update Project Summary Amounts.This is called from PA Step down Allocation Work Flow **/
143
144 PROCEDURE Submit_Conc_Sum( p_item_type IN VARCHAR2,
145 p_item_key IN VARCHAR2,
146 p_actid IN NUMBER,
147 p_funcmode IN VARCHAR2,
148 p_result OUT NOCOPY VARCHAR2);
149
150 -------------------------------------------------------------------------------
151 /** This function calls an API for Allocation Run Reversal.This is part of Rollback Process. This is called from PA Step down Allocation Work Flow **/
152
153 PROCEDURE Submit_Conc_AllocRev( p_item_type IN VARCHAR2,
154 p_item_key IN VARCHAR2,
155 p_actid IN NUMBER,
156 p_funcmode IN VARCHAR2,
157 p_result OUT NOCOPY VARCHAR2);
158
159 -------------------------------------------------------------------------------
160 /** This proc checks if all the expenditure groups i.e. target and offset expenditure groups have been costed or not **/
161
162 PROCEDURE Check_Exp_Groups( p_item_type IN VARCHAR2,
163 p_item_key IN VARCHAR2,
164 p_actid IN NUMBER,
165 p_funcmode IN VARCHAR2,
166 p_result OUT NOCOPY VARCHAR2);
167
168 -------------------------------------------------------------------------------
169
170 /** This is the function for checking the completion status of the concurrent process **/
171 Procedure Check_Process_Status( p_item_type IN VARCHAR2,
172 p_item_key IN VARCHAR2,
173 p_actid IN NUMBER,
174 p_funcmode IN VARCHAR2,
175 p_result OUT NOCOPY VARCHAR2);
176
177 -------------------------------------------------------------------------------
178 /** This is the function for checking the exceptions in the allocation run process **/
179
180 Procedure Check_Alloc_Run_Status( p_item_type IN VARCHAR2,
181 p_item_key IN VARCHAR2,
182 p_actid IN NUMBER,
183 p_funcmode IN VARCHAR2,
184 p_result OUT NOCOPY VARCHAR2);
185
186 -------------------------------------------------------------------------------
187 /** This procedure checks if allocation run is released or not.**/
188
189 PROCEDURE Check_Alloc_Release( p_item_type IN VARCHAR2,
190 p_item_key IN VARCHAR2,
191 p_actid IN NUMBER,
192 p_funcmode IN VARCHAR2,
193 p_result OUT NOCOPY VARCHAR2);
194
195 -------------------------------------------------------------------------------
196
197 /** This is the function for checking the exceptions in the distribute cost process **/
198
199 Procedure Check_Costing_Process( p_item_type IN VARCHAR2,
200 p_item_key IN VARCHAR2,
201 p_actid IN NUMBER,
202 p_funcmode IN VARCHAR2,
203 p_result OUT NOCOPY VARCHAR2);
204
205 -------------------------------------------------------------------------------
206
207 /** This is the function for checking the exceptions in the Summarization process **/
208
209 Procedure Check_Summary_Process( p_item_type IN VARCHAR2,
210 p_item_key IN VARCHAR2,
211 p_actid IN NUMBER,
212 p_funcmode IN VARCHAR2,
213 p_result OUT NOCOPY VARCHAR2);
214
215 -------------------------------------------------------------------------------
216 /*** This function checks if the request submitted for summarization
217 has any exceptions. Returns 'FAIL' if an exception occured,
218 'PASS' otherwise ***/
219
220 Function Check_Summarization_Status( p_request_id IN Number)
221 Return Varchar2;
222
223 -------------------------------------------------------------------------------
224 /** This procedure deletes an allocation run given a rule_id and run_id**/
225
226 Procedure Delete_Alloc_Run( p_item_type IN VARCHAR2,
227 p_item_key IN VARCHAR2,
228 p_actid IN NUMBER,
229 p_funcmode IN VARCHAR2,
230 p_result OUT NOCOPY VARCHAR2);
231
232 -------------------------------------------------------------------------------
233
234 /**This procedure sets a GL attribute value based on the result of PA Step Down
235 Allocation Process and issues a complete activity for the block. **/
236
237 PROCEDURE Set_PA_WF_Status( p_item_type IN VARCHAR2,
238 p_item_key IN VARCHAR2,
239 p_actid IN NUMBER,
240 p_funcmode IN VARCHAR2,
241 p_result OUT NOCOPY VARCHAR2);
242
243 -------------------------------------------------------------------------------
244
245 /* This procedure initializes WF_STACK with the argument passed
246 to it */
247 Procedure Init_PA_WF_STACK (p_item_type In Varchar2,
248 p_item_key In Varchar2,
249 p_err_stack In Varchar2);
250
251 -------------------------------------------------------------------------------
252
253 /* This procedure sets WF_STACK attribute with an argument */
254
255 Procedure Set_PA_WF_STACK (p_item_type In Varchar2,
256 p_item_key In Varchar2,
257 p_err_stack In Varchar2);
258
259 ------------------------------------------------------------------------------
260
261 /* This procedure resets WF_STACK attribute.It just removes last string from the stack */
262 Procedure Reset_PA_WF_STACK (p_item_type In Varchar2,
263 p_item_key In Varchar2);
264
265 -------------------------------------------------------------------------------
266
267 /* Set the WF_STAGE attribute with an argument */
268 Procedure Set_PA_WF_Stage (p_item_type In Varchar2,
269 p_item_key In Varchar2,
270 p_err_stage In Varchar2);
271
272 -------------------------------------------------------------------------------
273
274 Function DebugFlag
275 Return Boolean;
276 -------------------------------------------------------------------------------
277
278 -- Created this function for bug 5218394. This function will reterieve the debug
279 -- directory location using utl_log_dir
280 -------------------------------------------------------------------------------
281
282 Function GetDebugLogDir
283 Return Varchar2;
284 -------------------------------------------------------------------------------
285 END PA_AUTOALLOC_WF_PKG;