1 PACKAGE Error_Handler AS
2 /* $Header: BOMBOEHS.pls 120.4 2006/09/14 16:09:06 pdutta ship $ */
3 /*#
4 * You can use this API for logging/retrieving Error or Warning messages.This API should be used along with
5 * the other business object APIs like the BOM Business Object API for retrieving of errors
6 * or warning logged during processing.This API also retrieves the translated error/warning messages
7 * for a business object. The sequence in which the user needs to use the Error Handler is described below.
8 *
9 * <li>1.Initialize the Error Handler through Initialize procedure.</li>
10 * <li>2.If the debug flag is set to Y then valid values should be given for Output Directory and Output File otherwise it turns off the
11 * debug and logs the error to Error Handler.</li>
12 * <li>3.Open a Debug Session using the Open_Debug_Session procedure</li>
13 * <li>4.If the return status is Success then set the debug to Y otherwise set it to N</li>
14 * <li>5.If the debug status is Y then write to the error handler the entities as they are passed.</li>
15 * <li>6.After all the validation and processing of business entities,if the return status is not sucesss
16 * then Log error to the Error handler and write the error to Interface Table or Concurrent Log or Debug File
17 * based on the values of their respective flags.</li>
18 * The different record types used in this packages are given below.<BR>
19 *
20 *
21 * --------------------
22 * Error Record
23 * --------------------
24 *
25 *<code><pre>
26 * TYPE Error_Rec_Type IS RECORD
27 * ( organization_id NUMBER
28 * , entity_id VARCHAR2(30)
29 * , table_name VARCHAR2(30)
30 * , message_name VARCHAR2(30)
31 * , message_text VARCHAR2(2000)
32 * , entity_index NUMBER
33 * , message_type VARCHAR2(1)
34 * , row_identifier NUMBER
35 * , bo_identifier VARCHAR2(30) := 'ECO'
36 * );
37 *</pre></code>
38 *
39 * ------------------
40 * Parameters
41 * ------------------
42 *<pre>
43 * organization_id -- Organization Id
44 * entity_id -- A constant which indicates the entity for which the error is logged
45 * The possible values are
46 * 1.G_BO_LEVEL - Business Object - 0
47 * 2.G_ECO_LEVEL - Eng Change Order - 1
48 * 3.G_REV_LEVEL - Revision Level - 2
49 * 4.G_RI_LEVEL - Revised Item - 3
50 * 5.G_RC_LEVEL - Revised Component - 4
51 * 6.G_RD_LEVEL - Reference Designator - 5
52 * 7.G_SC_LEVEL - Substitute Component - 6
53 * 8.G_BH_LEVEL - Bill Header - 7
54 * table_name -- Production table name where the data goes in. This is useful when the same logical entity deals
55 * with multiple tables.A typical example would be extensible attributes for an
56 * entity. Logically, the entity is same but the data is going into two tables (ex: BOM_BILL_OF_MATERIALS and
57 * BOM_BILL_OF_MATERIALS_EXT)
58 * message_text -- Free Text in case of Unexpected Errors
59 * entity_index -- The order of the entity record within the entity table
60 * message_type -- W -> Warning E -> Error
61 * row_identifier -- Any unique identifier value for the entity record.In case of bulk load from interface table this can
62 * be used to store the transaction_id
63 * bo_identifier -- Business Object Identifier
64 *</pre>
65 *
66 * ---------------------------
67 * Message Token Record
68 * ---------------------------
69 *<code><pre>
70 * TYPE Mesg_Token_Rec_Type IS RECORD
71 * ( message_name VARCHAR2(30) := NULL
72 * , application_id VARCHAR2(3) := NULL
73 * , message_text VARCHAR2(2000) := NULL
74 * , token_name VARCHAR2(30) := NULL
75 * , token_value VARCHAR2(700) := NULL
76 * , translate BOOLEAN := FALSE
77 * , message_type VARCHAR2(1) := NULL
78 * )
79 *</pre></code>
80 *
81 * --------------------
82 * Parameters
83 * --------------------
84 *
85 *<pre>
86 * message_name -- FND Message Name
87 * application_id -- Application Short Name under which message is defined
88 * message_text -- Free Text in case off unexpected records
89 * token_name -- Token name for messages need to be translated
90 * token_value -- Token value for messages need to be translated
91 * translate -- Flag to decide whether message needs to be translated
92 * message_type -- E -> Error W -> Warning
93 *</pre>
94 *
95 * @rep:scope public
96 * @rep:product BOM
97 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
98 * @rep:displayname Error Handler
99 * @rep:lifecycle active
100 * @rep:compatibility S
101 */
102 G_PKG_NAME CONSTANT VARCHAR2(30) := 'Error_Handler';
103 G_BO_LEVEL CONSTANT NUMBER := 0;
104 G_ECO_LEVEL CONSTANT NUMBER := 1;
105 G_REV_LEVEL CONSTANT NUMBER := 2;
106 G_RI_LEVEL CONSTANT NUMBER := 3;
107 G_RC_LEVEL CONSTANT NUMBER := 4;
108 G_RD_LEVEL CONSTANT NUMBER := 5;
109 G_SC_LEVEL CONSTANT NUMBER := 6;
110 G_BH_LEVEL CONSTANT NUMBER := 7;
111 G_CL_LEVEL CONSTANT NUMBER := 21;
112 G_ATCH_LEVEL CONSTANT NUMBER := 22;
113
114 /* One to many operations support */
115 G_COP_LEVEL CONSTANT NUMBER := 13;
116 /*******************************************************
117 -- Followings are for Routing BO
118 ********************************************************/
119 G_RTG_LEVEL CONSTANT NUMBER := 8;
120 G_OP_LEVEL CONSTANT NUMBER := 9;
121 G_RES_LEVEL CONSTANT NUMBER := 10;
122 G_SR_LEVEL CONSTANT NUMBER := 11;
123 G_NWK_LEVEL CONSTANT NUMBER := 12;
124 -- Added by MK on 08/23/2000
125
126 G_STATUS_WARNING CONSTANT VARCHAR2(1) := 'W';
127 G_STATUS_UNEXPECTED CONSTANT VARCHAR2(1) := 'U';
128 G_STATUS_ERROR CONSTANT VARCHAR2(1) := 'E';
129 G_STATUS_FATAL CONSTANT VARCHAR2(1) := 'F';
130 G_STATUS_NOT_PICKED CONSTANT VARCHAR2(1) := 'N';
131
132 G_SCOPE_ALL CONSTANT VARCHAR2(1) := 'A';
133 G_SCOPE_RECORD CONSTANT VARCHAR2(1) := 'R';
134 G_SCOPE_SIBLINGS CONSTANT VARCHAR2(1) := 'S';
135 G_SCOPE_CHILDREN CONSTANT VARCHAR2(1) := 'C';
136 G_IS_BOM_OI BOOLEAN := FALSE;
137 Debug_File UTL_FILE.FILE_TYPE;
138
139 -- Error record type
140 TYPE Error_Rec_Type IS RECORD
141 ( organization_id NUMBER
142 , entity_id VARCHAR2(30)
143 , table_name VARCHAR2(30)
144 , message_name VARCHAR2(30)
145 , message_text VARCHAR2(2000)
146 , entity_index NUMBER
147 , message_type VARCHAR2(1)
148 , row_identifier NUMBER
149 , bo_identifier VARCHAR2(30) := 'ECO'
150 );
151
152 /* Fix for bug 4661753 - Added message_name to Error_Rec_Type record above */
153
154 TYPE Error_Tbl_Type IS TABLE OF Error_Rec_Type
155 INDEX BY BINARY_INTEGER;
156
157 TYPE Mesg_Token_Rec_Type IS RECORD
158 ( message_name VARCHAR2(30) := NULL
159 , application_id VARCHAR2(3) := NULL
160 , message_text VARCHAR2(2000) := NULL
161 , token_name VARCHAR2(30) := NULL
162 , token_value VARCHAR2(700) := NULL
163 , translate BOOLEAN := FALSE
164 , message_type VARCHAR2(1) := NULL
165 );
166
167 TYPE Mesg_Token_Tbl_Type IS TABLE OF Mesg_Token_Rec_Type
168 INDEX BY BINARY_INTEGER;
169
170 /*******************************************************
171 -- Increased token_value length to VARCHAR2(100) from
172 -- VARCHAR2(30). This is because revised item and
173 -- revised component names can be as long as 81
174 -- characters.
175 -- By AS on 10/22/99
176 ********************************************************/
177 TYPE Token_Rec_Type IS RECORD
178 ( token_value VARCHAR2(700) := NULL
179 , token_name VARCHAR2(30) := NULL
180 , translate BOOLEAN := FALSE
181 );
182
183 TYPE Token_Tbl_Type IS TABLE OF Token_Rec_Type INDEX BY BINARY_INTEGER;
184
185 G_MISS_TOKEN_TBL Token_Tbl_Type;
186 G_MISS_MESG_TOKEN_TBL Mesg_Token_Tbl_Type;
187
188
189 /*#
190 * You can use this method to initialize the global message list and reset the index variables to 0.
191 * User must initialize the message list before using it.
192 * @rep:scope public
193 * @rep:lifecycle active
194 * @rep:compatibility S
195 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
196 * @rep:displayname Initialize
197 */
198 PROCEDURE Initialize;
199
200 /*#
201 * You can use this method to reset the message index to the start of the list,as well as begin reading the
202 * messages again from the start.
203 * @rep:scope public
204 * @rep:lifecycle active
205 * @rep:compatibility S
206 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
207 * @rep:displayname Reset
208 */
209 PROCEDURE Reset;
210
211 /* Get procedures to access the errors in the PL/SQL stack*/
212 /*#
213 * You can use this method to retrieve individual messages from the message list.The method returns a
214 * copy of the message list. The procedure will return a
215 * the message list for the entire Business Object with the error status of the Business Object as well as
216 * the error status of the Business Object for each record in the table.
217 * @param x_message_list IN OUT NOCOPY processed Message List
218 * @rep:scope public
219 * @rep:lifecycle active
220 * @rep:compatibility S
221 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
222 * @rep:displayname Get Message List
223 */
224 PROCEDURE Get_Message_List
225 ( x_message_list IN OUT NOCOPY Error_Handler.Error_Tbl_Type);
226
227 /*#
228 * You can use this method to return all the messages for a specific Entity and retrieve the error
229 * or warning messages,the error type,scope of the error and Other Messages which will give the
230 * error status of other records due to the error in the current record.The user can get the message for
231 * Bill Header,Component,Reference Desigantor or Substitute Components based on the value of entity_id
232 * @param p_entity_id IN Entity for which the message to be returned
233 * @param x_message_list IN OUT NOCOPY Error Message List for the Entity
234 * @rep:scope public
235 * @rep:lifecycle active
236 * @rep:compatibility S
237 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
238 * @rep:displayname Get Entity Message
239 */
240 PROCEDURE Get_Entity_Message
241 ( p_entity_id IN VARCHAR2
242 , x_message_list IN OUT NOCOPY Error_Handler.Error_Tbl_Type
243 );
244
245 /*#
246 * This method will return the messages for an entity and the mesages can be specified through the
247 * entity index which gives the location of the messsage in the entity array. This will give the error or warning
248 * text,the error type,Other Message and the scope of the error.The user can get the messsages at any specific index
249 * as specified for Bill Header,Component,Reference Designator or Substitute Component.
250 * @param p_entity_id IN Entity for which the message to be returned
251 * @param p_entity_index IN Index of the Message to be returned
252 * @param x_message_list IN OUT NOCOPY Error Message List for the Entity at the index
253 * @rep:scope public
254 * @rep:lifecycle active
255 * @rep:compatibility S
256 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
257 * @rep:displayname Get Message List
258 */
259 PROCEDURE Get_Entity_Message
260 ( p_entity_id IN VARCHAR2
261 , p_entity_index IN NUMBER
262 , x_message_list IN OUT NOCOPY Error_Handler.Error_Tbl_Type
263 );
264
265 /*#
266 * This method will return all the messages for an entity and its row identifier.
267 * Row Identifier is any unique identifier value for the entity record.
268 * In case of bulk load from interface table this can
269 * be used to store the transaction_id.
270 * @param p_entity_id IN Entity for which the message to be returned
271 * @param p_row_identifier IN Row Identifier for the entity
272 * @param x_message_list IN OUT NOCOPY Error Message List for the Entity identified by the Row Id
273 * @rep:scope public
274 * @rep:lifecycle active
275 * @rep:compatibility S
276 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
277 * @rep:displayname Get Entity Message
278 */
279 PROCEDURE Get_Entity_Message
280 ( p_entity_id IN VARCHAR2
281 , p_row_identifier IN NUMBER
282 , x_message_list IN OUT NOCOPY Error_Handler.Error_Tbl_Type
283 );
284
285 /*#
286 * This method will return all the messages for an entity and its row identifier.
287 * Row Identifier is any unique identifier value for the entity record.
288 * In case of bulk load from interface table this can
289 * be used to store the transaction_id.
290 * @param p_entity_id IN Entity for which the message to be returned
291 * @param p_row_identifier IN Row Identifier for the entity
292 * @param p_table_name IN Table Name
293 * @param x_message_list IN OUT NOCOPY Error Message List for the Entity identified by the Row Id
294 * @rep:scope public
295 * @rep:lifecycle active
296 * @rep:compatibility S
297 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
298 * @rep:displayname Get Entity Message
299 */
300 PROCEDURE Get_Entity_Message
301 ( p_entity_id IN VARCHAR2
305 );
302 , p_table_name IN VARCHAR2
303 , p_row_identifier IN NUMBER
304 , x_message_list IN OUT NOCOPY Error_Handler.Error_Tbl_Type
306
307
308 /*#
309 * You can use this method to return the message at the current message index and advance the pointer to the
310 * next number. On retrieving the messages beyond the size of the message list,the message index
311 * will be reset to the start position irrespective of the message type(like Warning,Error).
312 * @param x_message_text IN OUT NOCOPY processed Message Text
313 * @param x_entity_index IN OUT NOCOPY Entity Index of the message retrieved
314 * @param x_entity_id IN OUT NOCOPY Entity for which the Message was retrieved
315 * @param x_message_type IN OUT NOCOPY Type of the Message W-Warning/Debug,E-Standard Error/Severe Error,F-Fatal Error,U-Unexpected Error
316 * @rep:scope public
317 * @rep:lifecycle active
318 * @rep:compatibility S
319 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
320 * @rep:displayname Get Message
321 */
322 PROCEDURE Get_Message
323 ( x_message_text IN OUT NOCOPY VARCHAR2
324 , x_entity_index IN OUT NOCOPY NUMBER
325 , x_entity_id IN OUT NOCOPY VARCHAR2
326 , x_message_type IN OUT NOCOPY VARCHAR2
327 );
328
329 /*#
330 * This function returns the current number of records in the message list.The user can
331 * use this function to get the current size of the message list.
332 * @return Number of messages in the List
333 * @rep:scope public
334 * @rep:lifecycle active
335 * @rep:compatibility S
336 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
337 * @rep:displayname Get Message Count
338 */
339
340 FUNCTION Get_Message_Count RETURN NUMBER;
341
342 /*#
343 * This method will delete a message for the particular entity specified.The entity index
344 * gives the location of entity array list and the entity id will provide the specific entity object.
345 * @param p_entity_id IN Entity of which the message is to be deleted
346 * @param p_entity_index IN Index of the message to be deleted
347 * @rep:scope public
348 * @rep:lifecycle active
349 * @rep:compatibility S
350 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
351 * @rep:displayname Delete Message
352 */
353
354 PROCEDURE Delete_Message
355 ( p_entity_id IN VARCHAR2
356 , p_entity_index IN NUMBER
357 );
358
359 /*#
360 * This method will delete all the messages for the particular entity.The
361 * entity is specified by the entity id.
362 * @param p_entity_id IN Entity of which the message is to be deleted
363 * @rep:scope public
364 * @rep:lifecycle active
365 * @rep:compatibility S
366 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
367 * @rep:displayname Delete Message
368 */
369
370 PROCEDURE Delete_Message
371 ( p_entity_id IN VARCHAR2 );
372
373 /*#
374 * This method will generate a dump of the message list using dbms_output.This in
375 * turn calls the Write_Debug method to write the Message for an entity
376 * @rep:scope public
377 * @rep:displayname Dump Message List
378 * @rep:compatibility S
379 * @rep:lifecycle active
380 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
381 */
382
383 PROCEDURE Dump_Message_List;
384
385 /*#
386 * This method will open a debug session with the debug file name in the supplied output directory as destination.
387 * It will also check the validity of the output directory and the debug file name given as input.
388 * @param p_debug_filename IN Name of the file to write the debug message
389 * @param p_output_dir IN Output Directory
390 * @param x_return_status IN OUT NOCOPY Return Status of the Business Object
391 * @param x_error_mesg IN OUT NOCOPY Error Message
392 * @rep:displayname Open Debug Session
393 * @rep:compatibility S
394 * @rep:lifecycle active
395 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
396 */
397 PROCEDURE Open_Debug_Session
398 ( p_debug_filename IN VARCHAR2
399 , p_output_dir IN VARCHAR2
400 , x_return_status IN OUT NOCOPY VARCHAR2
401 , x_error_mesg IN OUT NOCOPY VARCHAR2
402 );
403
404 /*#
405 * This method will open a debug session with the debug file name in the supplied output directory as destination.
406 * It will also check the validity of the output directory and the debug file name given as input
407 * @param p_debug_filename IN Name of the file to write the debug message
408 * @param p_output_dir IN Output Directory
409 * @param x_return_status IN OUT NOCOPY Return Status of the Business Object
410 * @param p_mesg_token_tbl IN Message Token Table as input
411 * @param x_mesg_token_tbl IN OUT NOCOPY processed Message Token Table
412 * @rep:scope public
413 * @rep:displayname Open Debug Session
414 * @rep:compatibility S
415 * @rep:lifecycle active
416 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
417 */
418
419 PROCEDURE Open_Debug_Session
420 ( p_debug_filename IN VARCHAR2
424 , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
421 , p_output_dir IN VARCHAR2
422 , x_return_status IN OUT NOCOPY VARCHAR2
423 , p_mesg_token_tbl IN Error_Handler.Mesg_Token_Tbl_Type
425 );
426
427 /*#
428 * This method will close the debug session currently in the open state
429 * @rep:scope public
430 * @rep:displayname Close Debug Session
431 * @rep:compatibility S
432 * @rep:lifecycle active
433 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
434 */
435 PROCEDURE Close_Debug_Session;
436 /*#
437 * This method is used by the error handler to put appropriate debug comments
441 * @rep:compatibility S
438 * @param p_debug_message IN Debug Message to be added
439 * @rep:scope public
440 * @rep:displayname Write Debug
442 * @rep:lifecycle active
443 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
444 */
445
446 PROCEDURE Write_Debug
447 ( p_debug_message IN VARCHAR2
448 );
449
450 /*#
451 * This method will write the errors to the Interface Table
452 * This will be effective only if the write to concurrent_log flag is properly set.
453 * @rep:scope public
454 * @rep:displayname Write to Interface Table
455 * @rep:compatibility S
456 * @rep:lifecycle active
457 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
458 */
459 PROCEDURE Write_To_InterfaceTable;
460
461
462 /*#
463 * This method will write the errors to the Concurrent Log.This
464 * will be effective only if the write to concurrent_log flag is properly set.
465 * @rep:scope public
466 * @rep:displayname Write to Concurrent Log
467 * @rep:compatibility S
468 * @rep:lifecycle active
469 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
470 */
471 PROCEDURE Write_To_ConcurrentLog;
472
473
474 /*#
475 * This method will write the errors to the Debug File.This
476 * will be effective only if the write to dbug_file flag is properly set.
477 * @rep:scope public
478 * @rep:displayname Write to Debug File
479 * @rep:compatibility S
480 * @rep:lifecycle active
481 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
482 */
483 PROCEDURE Write_To_DebugFile;
484
485
486 /*#
487 * This method will write the errors to Interface table or Concurrent Log or Debug File based on the Flag for each of these.
488 * This will take the messages already written to the Error Handler and then will log that based on the value of the
489 * flags passed.This method is useful when the user wants to Log all the errors irrespective of any particular entity.
490 * @param p_write_err_to_inttable IN Flag to write error to Interface Table
491 * @param p_write_err_to_conclog IN Flag to write error to Concurrent Log
492 * @param p_write_err_to_debugfile IN Flag to write error to Debug File
493 * @rep:scope public
494 * @rep:displayname Log Error
495 * @rep:compatibility S
496 * @rep:lifecycle active
497 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
498 */
499 PROCEDURE Log_Error(p_write_err_to_inttable IN VARCHAR2 := 'N'
500 ,p_write_err_to_conclog IN VARCHAR2 := 'N'
501 ,p_write_err_to_debugfile IN VARCHAR2 := 'N');
502
503 /*#
504 * This method takes the Message Token Table and seperates the message and their tokens, gets the
505 * token substitute messages from the message dictionary and puts in the error stack.
506 * Log Error will also make sure that the error propogates to the right levels of the business object
507 * and that the rest of the entities get the appropriate status and message.This will log the error based on the
508 * error level whether its Bill Header,Revision,Revised Components,Reference Designator,Substitute Components etc.
509 * @param p_bom_header_rec IN BOM Header Exposed Column Record
510 * @rep:paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Rec_Type}
511 * @param p_bom_revision_tbl IN Revision Exposed Column Table
512 * @rep:paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Revision_Tbl_Type}
513 * @param p_bom_component_tbl IN Components Exposed Column Table
514 * @rep:paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Comps_Tbl_Type}
515 * @param p_bom_ref_Designator_tbl IN Reference Designator Exposed Column Table
516 * @rep:paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Ref_Designator_Tbl_Type}
517 * @param p_bom_sub_component_tbl IN Substitute Components Exposed Column Table
518 * @rep:paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Sub_Component_Tbl_Type}
519 * @param p_Mesg_Token_tbl IN Message Token Table
520 * @rep:paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
521 * @param p_error_status IN S-Success,E-Error,F-Fatal Error,U-Enexpected Error
522 * @param p_error_scope IN R-error affects Current Record,S-error affects Sibling and Child Records,C-error affects
523 * Child Records,A-error affects All reords in the Business Object
524 * @param p_other_message IN An Other Message is a message that is logged for all records that are affected by an
525 * error in a particular record.This message essentially mentions:
526 * 1. How the error has affected this record, that is, it has been errored out to
527 * with a severe or fatal error status, or that it has not been processed.
528 * 2. Which record caused this record to be affected.
529 * 3. What process flow step in the offending record caused this record to be affected.
530 * 4. What transaction type in the offending record caused this record to be affected
531 * @param p_other_mesg_appid IN Other Message Application Id
532 * @param p_other_status IN Status the other affected records should be set to.
533 * @param p_other_token_tbl IN Other Message Token table
534 * @param p_error_level IN Business Object hierarchy level that current record is an instance of.
535 * That is, the entity that the record in error belongs to
536 * @param p_entity_index IN The index of the entity array this record belongs to.
537 * @param p_row_identifier IN Any unique identifier value for the entity record.
538 * In case of bulk load from interface table this can
539 * be used to store the transaction_id
540 * @param x_bom_header_rec IN OUT NOCOPY processed BOM Header Exposed Column Record
544 * @param x_bom_component_tbl IN OUT NOCOPY processed Components Exposed Column Table
541 * @rep:paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Bo_Pub.Bom_Head_Rec_Type}
542 * @param x_bom_revision_tbl IN OUT NOCOPY processed Revision Exposed Column Table
543 * @rep:paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Revision_Tbl_Type}
545 * @rep:paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Comps_Tbl_Type}
546 * @param x_bom_ref_Designator_tbl IN OUT NOCOPY processed Reference Designator Exposed Column Table
547 * @rep:paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Ref_Designator_Tbl_Type}
548 * @param x_bom_sub_component_tbl IN OUT NOCOPY processed Substitute Components Exposed Column Table
549 * @rep:paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Sub_Component_Tbl_Type}
550 * @rep:scope public
551 * @rep:lifecycle active
552 * @rep:compatibility S
553 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
554 * @rep:displayname Log Error Message
555 */
556
557
558 PROCEDURE Log_Error
559 ( p_bom_header_rec IN Bom_Bo_Pub.Bom_Head_Rec_Type :=
560 Bom_Bo_Pub.G_MISS_BOM_HEADER_REC
561 , p_bom_revision_tbl IN Bom_Bo_Pub.Bom_Revision_Tbl_Type :=
562 Bom_Bo_Pub.G_MISS_BOM_REVISION_TBL
563 , p_bom_component_tbl IN Bom_Bo_Pub.Bom_Comps_Tbl_Type :=
564 Bom_Bo_Pub.G_MISS_BOM_COMPONENT_TBL
565 , p_bom_ref_Designator_tbl IN Bom_Bo_Pub.Bom_Ref_Designator_Tbl_Type
566 := Bom_Bo_Pub.G_MISS_BOM_REF_DESIGNATOR_TBL
567 , p_bom_sub_component_tbl IN Bom_Bo_Pub.Bom_Sub_Component_Tbl_Type
568 := Bom_Bo_Pub.G_MISS_BOM_SUB_COMPONENT_TBL
569
570 , p_Mesg_Token_tbl IN Error_Handler.Mesg_Token_Tbl_Type
571 := Error_Handler.G_MISS_MESG_TOKEN_TBL
572 , p_error_status IN VARCHAR2
573 , p_error_scope IN VARCHAR2 := NULL
574 , p_other_message IN VARCHAR2 := NULL
575 , p_other_mesg_appid IN VARCHAR2 := 'BOM'
576 , p_other_status IN VARCHAR2 := NULL
577 , p_other_token_tbl IN Error_Handler.Token_Tbl_Type
578 := Error_Handler.G_MISS_TOKEN_TBL
579 , p_error_level IN NUMBER
580 , p_entity_index IN NUMBER := 1 -- := NULL
581 , x_bom_header_rec IN OUT NOCOPY Bom_Bo_Pub.Bom_Head_Rec_Type
582 , x_bom_revision_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Revision_Tbl_Type
583 , x_bom_component_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Comps_Tbl_Type
584 , x_bom_ref_Designator_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Ref_Designator_Tbl_Type
585 , x_bom_sub_component_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Sub_Component_Tbl_Type
586 , p_row_identifier IN NUMBER := NULL
587 );
588
589
590
591
592
593 /****************************************************************
594 * Procedure : Add_Message
595 *
596 * Paramaters IN : Message Text
597 * For explanation on entity id, entity index,
598 * message type,row identifier, table name,
599 * entity code parameters please refer to
600 * Add_Error_Message API
601 *
602 * Parameters OUT: None
603 * Purpose : Add_Message will push a message on the message
604 * stack and will convert the numeric entity id to
605 * character which will be easier for the user to
606 * understand. eg. Entity Id = 1 which will be ECO
607 *****************************************************************/
608
609 PROCEDURE Add_Message
610 ( p_mesg_text IN VARCHAR2
611 , p_entity_id IN NUMBER
612 , p_entity_index IN NUMBER
613 , p_message_type IN VARCHAR2
614 , p_row_identifier IN NUMBER := NULL
615 , p_table_name IN VARCHAR2 := NULL
616 , p_entity_code IN VARCHAR2 := NULL
617 , p_mesg_name IN VARCHAR2 := NULL
618 );
619
620 /* Fix for bug 4661753 - Added a new parameter p_mesg_name to both the Add_message procedure declarations above and below.*/
621
622 -- Bug 3458584 added new method
623
624
625 PROCEDURE Add_Message
626 ( p_mesg_text IN VARCHAR2
627 , p_entity_id IN NUMBER
628 , p_entity_index IN NUMBER
629 , p_message_type IN VARCHAR2
630 , p_row_identifier IN NUMBER := NULL
631 , p_table_name IN VARCHAR2 := NULL
632 , p_entity_code IN VARCHAR2 := NULL
633 , p_mesg_name IN VARCHAR2 := NULL
634 , p_bom_header_rec IN OUT NOCOPY Bom_Bo_Pub.Bom_Head_Rec_Type
635 , p_bom_revision_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Revision_Tbl_Type
636 , p_bom_component_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Comps_Tbl_Type
637 , p_bom_ref_Designator_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Ref_Designator_Tbl_Type
638 , p_bom_sub_component_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Sub_Component_Tbl_Type
639 , p_bom_comp_ops_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Comp_ops_Tbl_Type
640 );
641
642
643
644 /*********************************************************************
645 * Procedure : Translate_And_Insert_Messages
646 * Returns : None
647 * Parameters IN : Message Token Table
648 * Error Level
649 * The entity level at which the error has
650 * occured.This is same as entity id in the
651 * other procedures (Add_Message, Add_Error_Message)
655 * Add_Error_Message API
652 * For explanation on entity id, entity index,
653 * message type,row identifier, table name,
654 * entity code parameters please refer to
656 * Parameters OUT: Non
657 * Purpose : This procedure will read through the message token
658 * table and insert them into the message table with
659 * the proper business object context.
660 **********************************************************************/
661
662 PROCEDURE Translate_And_Insert_Messages
663 ( p_mesg_token_tbl IN Error_Handler.Mesg_Token_Tbl_Type
664 , p_error_level IN NUMBER := NULL
665 , p_entity_index IN NUMBER := NULL
666 , p_application_id IN VARCHAR2 := 'ENG'
667 , p_row_identifier IN NUMBER := NULL
668 , p_table_name IN VARCHAR2 := NULL
669 , p_entity_code IN VARCHAR2 := NULL
670 );
671
672 -- Bug 3458584 added new method
673
674 PROCEDURE Translate_And_Insert_Messages
675 ( p_mesg_token_tbl IN Error_Handler.Mesg_Token_Tbl_Type
676 , p_error_level IN NUMBER := NULL
677 , p_entity_index IN NUMBER := NULL
678 , p_application_id IN VARCHAR2 := 'ENG'
679 , p_row_identifier IN NUMBER := NULL
680 , p_table_name IN VARCHAR2 := NULL
681 , p_entity_code IN VARCHAR2 := NULL
682 , p_bom_header_rec IN OUT NOCOPY Bom_Bo_Pub.Bom_Head_Rec_Type
683 , p_bom_revision_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Revision_Tbl_Type
684 , p_bom_component_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Comps_Tbl_Type
685 , p_bom_ref_Designator_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Ref_Designator_Tbl_Type
686 , p_bom_sub_component_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Sub_Component_Tbl_Type
687 , p_bom_comp_ops_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Comp_Ops_Tbl_Type
688 );
689
690
691
692 /*********************************************************************
693 * Function : Translate_Message
694 * Returns : VARCHAR2 (Translated Message)
695 * Parameters IN : Application id
696 * Message Name
697 * Token Table
698 * Parameters OUT: Translated Message
699 **********************************************************************/
700
701 FUNCTION Translate_Message (p_application_id IN VARCHAR2
702 ,p_message_name IN VARCHAR2
703 ,p_token_tbl IN Error_Handler.Token_Tbl_Type :=
704 Error_Handler.G_MISS_TOKEN_TBL)
705 RETURN VARCHAR2;
706
707 /**********************************************************************
708 * Procedure : Add_Error_Token
709 * Parameters IN : Message Text (in case of unexpected errors)
710 * Message Name
711 * Mesg Token Tbl
712 * Token Table
713 * Parameters OUT: Mesg Token Table
714 * Purpose : This procedure will add the message to the
715 * message token table.
716 **********************************************************************/
717
718 PROCEDURE Add_Error_Token
719 ( p_message_name IN VARCHAR2 := NULL
720 , p_application_id IN VARCHAR2 := 'ENG'
721 , p_message_text IN VARCHAR2 := NULL
722 , x_Mesg_Token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
723 , p_Mesg_Token_Tbl IN Error_Handler.Mesg_Token_Tbl_Type :=
724 Error_Handler.G_MISS_MESG_TOKEN_TBL
725 , p_token_tbl IN Error_Handler.Token_Tbl_Type :=
726 Error_Handler.G_MISS_TOKEN_TBL
727 , p_message_type IN VARCHAR2 := 'E'
728 );
729
730 /**********************************************************************
731 * Procedure : Add_Error_Message
732 * Parameters IN : Message Text (in case of unexpected errors)
733 * Free text
734 * Message Name
735 * FND message name
736 * Application Id
737 * Applicaion short name under which the
738 * message is defined
739 * Token Table
740 * Token Table of type TOKEN_TBL_TYPE
741 * Message Type
742 * W -> Warning
743 * E -> Error
744 * Entity Id
745 * Entity identifier which is defined as a
746 * constant in the error handler
747 * Entity Index
748 * The order of the entity record within
749 * the entity table
750 * Entity Code
751 * Replacement for entity id. This can be
752 * used when there is no constant defined
753 * in the error handler for the entity.
754 * When both are passed entity code will be
755 * used as entity identifier.
756 * Row Identifier
757 * Any unique identifier value for the entity record.
758 * In case of bulk load from interface table this can
759 * be used to store the transaction_id
760 * Table Name
761 * Production table name where the data goes in.
762 * This is useful when the same logical entity deals
763 * with multiple tables.
764 * A typical example would be extensible attributes for an
765 * entity. Logically, the entity is same but the data is
766 * going into two tables (ex: BOM_BILL_OF_MATERIALS and
767 * BOM_BILL_OF_MATERIALS_EXT)
768 *
769 * Parameters OUT: None
770 * Purpose : This procedure will translate and add the message directly into
771 * the error stack with all the context information.
772 **********************************************************************/
773
774 PROCEDURE Add_Error_Message
775 ( p_message_name IN VARCHAR2 := NULL
776 , p_application_id IN VARCHAR2 := 'BOM'
777 , p_message_text IN VARCHAR2 := NULL
778 , p_token_tbl IN Error_Handler.Token_Tbl_Type :=
779 Error_Handler.G_MISS_TOKEN_TBL
780 , p_message_type IN VARCHAR2 := 'E'
781 , p_row_identifier IN NUMBER := NULL
782 , p_entity_id IN NUMBER := NULL
783 , p_entity_index IN NUMBER := NULL
784 , p_table_name IN VARCHAR2 := NULL
785 , p_entity_code IN VARCHAR2 := NULL
786 , p_addto_fnd_stack IN VARCHAR2 := 'N'
787 );
788
789 -- Bug 3458584 added new method
790
791
792 PROCEDURE Add_Error_Message
793 ( p_message_name IN VARCHAR2 := NULL
794 , p_application_id IN VARCHAR2 := 'BOM'
795 , p_message_text IN VARCHAR2 := NULL
796 , p_token_tbl IN Error_Handler.Token_Tbl_Type :=
797 Error_Handler.G_MISS_TOKEN_TBL
798 , p_message_type IN VARCHAR2 := 'E'
799 , p_row_identifier IN NUMBER := NULL
800 , p_entity_id IN NUMBER := NULL
801 , p_entity_index IN NUMBER := NULL
802 , p_table_name IN VARCHAR2 := NULL
803 , p_entity_code IN VARCHAR2 := NULL
804 , p_addto_fnd_stack IN VARCHAR2 := 'N'
805 , p_bom_header_rec IN OUT NOCOPY Bom_Bo_Pub.Bom_Head_Rec_Type
806 , p_bom_revision_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Revision_Tbl_Type
807 , p_bom_component_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Comps_Tbl_Type
808 , p_bom_ref_Designator_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Ref_Designator_Tbl_Type
809 , p_bom_sub_component_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Sub_Component_Tbl_Type
810 , p_bom_comp_ops_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Comp_Ops_Tbl_Type
811 );
812
813
814
815
816
817
818 PROCEDURE Get_Entity_Message
819 ( p_entity_id IN VARCHAR2
820 , p_entity_index IN NUMBER
821 , x_message_text IN OUT NOCOPY /* file.sql.39 change */ VARCHAR2
822 );
823
824 PROCEDURE Set_Bo_Identifier(p_bo_identifier IN VARCHAR2);
825 FUNCTION Get_Bo_Identifier RETURN VARCHAR2;
826
827 /* One to many operations support */
828
829 PROCEDURE Set_Bom_Specific( p_bom_comp_ops_tbl IN Bom_Bo_Pub.Bom_Comp_Ops_Tbl_type);
830
831 PROCEDURE Get_Bom_Specific( x_bom_comp_ops_tbl IN OUT NOCOPY Bom_Bo_Pub.Bom_Comp_Ops_Tbl_type);
832
833
834 PROCEDURE Set_Debug (p_debug_flag IN VARCHAR2 := 'N');
835
836 FUNCTION Get_Debug RETURN VARCHAR2;
837
838 PROCEDURE Set_BOM_OI;
839 PROCEDURE UnSet_BOM_OI;
840
841 END Error_Handler;