DBA Data[Home] [Help]

PACKAGE: APPS.BOM_ROLLUP_PUB

Source


1 PACKAGE Bom_Rollup_Pub AS
2 /* $Header: BOMRLUPS.pls 120.1 2007/02/26 12:35:14 vhymavat ship $ */
3 /*# Rollup will happen on the objects within a BOM.Every object would have a
4  * Attribute Map, with every attribute identifying the compute function. If the
5  * Compute function for the attribute is not specified, the value of the attribute
6  * is taken as-is.
7  * Attribute Map is created from the Object attributes' metadata and is not required
8  * for the calling application to be aware of or even to modify it directly within this
9  * sub-process.
10  * Every object also has a list of rollup actions that it supports.
11  * Every supported action has a rollup function. When object in a Product structure
12  * is modified it may warrant a rollup action. A calling application can indicate which
13  * rollup actions should be performed on the Object.<BR>
14  * The rollup actions are always performed in a reverse topological order. i.e Attribute
15  * computation or propogation would start at the leaf nodes and end with parent.
16  * Rollup actions can be registered along with the rollup function to perform corresponding
17  * to the action. A rollup function is called for every level in the reverse tolological order
18  * and has access to all the child item objects in that subtree.
19  * Rollup function can determine if the rolled up attribute affects the current level or only the
20  * top level. for eg.  Top GTIN computation. Top GTIN computation only impact the top level and has
21  * no impact on the intermediate levels of a hierarchy.<BR>
22  * Two methods are available for rollup functions to call, Set_Parent_Attribute and Set_Top_Item_Attribute
23  * depending on the impact, Rollup function can call one or the other. Although no restriction
24  * is placed in calling both the methods, we do not believe this would be functionally required.
25  * Following explains the reverse topology processing of the Rollup and the point(s) at which
26  * Rollup function and Attribute Compute functions are invoked.
27  *<code><pre>
28  *                                      Item-X  (0)
29  *                      |-----------------|-----------------|
30  *                     Item-x1          Item-x2            Item-X3   (1)
31  *               |------|-----|    |------|-----|          |---|---|
32  *              x1c1  x1c2  x1c3   x2c1  x2c2  x2c3       x3c1    Item-X5     (2)
33  *                                                             |------|------|
34  *                                                            x5c1           x5c2  (3)
35  *
36  *</pre></code>
37  * Considering the above hierarchy and rollup starting with x5c1, would result into a map of
38  * x5c1-->Item-X5-->Item-X3-->Item-X
39  * The numbers in paranthesis indicate level.
40  *
41  * <li>Start</li>
42  * <li>Rollup Process would begin at level-3</li>
43  * <li>Attribute computation function would be called for components at level-3</li>
44  * <li>Rollup Function would be invoked for the parent, level-2</li>
45  * <li>Updates are issued for the modified attributes of the parent. Modifications to the Top Item's attributes
46  *   are cached until reaching level-0</li>
47  * <li>Repeat for all subsequent levels</li>
48  * <li>Issue updates for modified attributes of the Top Item</li>
49  * <li>End</li>
50  *The Records used in this API are listed below.<BR>
51  *
52  * --------------------------
53  * Attribute Metadata Entry
54  * --------------------------
55  *<code><pre>
56  * Type Attr_MetaData_Entry IS RECORD
57  * (  Attribute_Id     NUMBER
58  *  , Object_Name      VARCHAR2(30)
59  *  , Attribute_Name   VARCHAR2(30)
60  *  , Attribute_Type               VARCHAR2(81)
61  *  , Attribute_Table_Name         VARCHAR2(30)
62  *  , Compute_Function             VARCHAR2(240)
63  *  , Affects_Top_Item_Only        BOOLEAN := false
64  * )
65  *</pre></code>
66  *
67  * ------------------
68  *    Parameters
69  * ------------------
70  * <pre>
71  * Attribute_Id                 -- Attribute Identifier.
72  * Object_Name                  -- Name of the Object.Exampl is EGO_ITEM
73  * Attribute_Name               -- Attribute Name.Some of the permitted values are
74  * NET_WEIGHT_UOM,GROSS_WEIGHT_UOM,UNIT_WEIGHT,GROSS_WEIGHT,COMPONENT_QUANTITY,IS_TRADE_ITEM_INFO_PRIVATE,BRAND_OWNER_NAME etc
75  * Attribute_Type               -- Type of the Attribute.Values allowed are VARCHAR2,NUMBER
76  * Attribute_Table_Name         -- Table in which the attribute column exist.Eg MTL_SYSTEM_ITEMS_B,EGO_ITEM_GTN_ATTRS_B etc
77  * Compute_Function             -- Compute Function.Eg.Compute_Net_Weight,Compute_Gross_Weight.
78  * Affects_Top_Item_Only        -- Boolean Flag indicating whether the rollup will affect only top item.
79  *</pre>
80  *
81  * ------------------------------
82  *   Attribute  Map Entry Type
83  * ------------------------------
84  *<code><pre>
85  * TYPE Attr_Map_Entry_Type IS RECORD
86  * (  Object_Name      VARCHAR2(30)
87  *  , Attribute_Group    VARCHAR2(80)
88  *  , Attribute_Name   VARCHAR2(30)
89  *  , Attribute_Value    VARCHAR2(2000)
90  *  , Computed_Value               VARCHAR2(2000)
91  *  , Compute_Function             VARCHAR2(240)
92  *  , Attribute_Type   VARCHAR2(81)
93  * )
94  *</pre></code>
95  *
96  * ---------------
97  *   Parameters
98  * ---------------
99  *<pre>
100  * Most of the attributes have same meaning as explained above.
101  * Attribute_Value               -- Value of the Attribute to be rolled up
102  * Computed_Value                -- Result value after Rollup computation
103  * </pre>
104  * -------------------------------
105  *   Rollup Action Entry Type
106  * -------------------------------
107  * <code><pre>
108  * TYPE Rollup_Action_Entry_Type IS RECORD
109  * (  Object_Name       VARCHAR2(81)
110  *  , Rollup_Action     VARCHAR2(240)
111  *  , Rollup_Function   VARCHAR2(240)
112  *  , DML_Function      VARCHAR2(240)
113  *  , DML_Delayed_Write VARCHAR2(1)
114  *  )
115  * </pre></code>
116  *
117  * ----------------
118  *   Parameters
119  * ----------------
120  * <pre>
121  * Object_Name                 -- Name of the Object.Exampl is EGO_ITEM
122  * Rollup_Action               -- A Consatnt indicating the Rollup Action.Eg G_COMPUTE_GROSS_WEIGHT,G_COMPUTE_NET_WEIGHT
123  * Rollup_Function             -- Rollup function defined on the object
124  * DML_Function                -- Values possible are Set_Private_Flag,Set_Brand_Info,Set_Top_GTIN_Flag,Set_Multirow_Attributes
125  * DML_Delayed_Write           -- Flag indicating whether write needs to be delayed.Possible values are Y and N
126  * </pre>
127  * @rep:scope public
128  * @rep:product BOM
129  * @rep:displayname Rollup Engine
130  * @rep:compatibility S
131  * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
132 */
133 
134 
135 
136   Type Attr_MetaData_Entry IS RECORD
137   (  Attribute_Id     NUMBER
138    , Object_Name      VARCHAR2(30)
139    , Attribute_Name   VARCHAR2(30)
140    , Attribute_Type               VARCHAR2(81)
141    , Attribute_Table_Name         VARCHAR2(30)
142    , Compute_Function             VARCHAR2(240)
143    , Affects_Top_Item_Only        BOOLEAN := false
144   );
145   --
146   -- Attribute / Function Map
147   -- Maintains a map of the Attributes for an Object
148   -- If the attribute is a computed attribute, its also identifies a
149   -- compute function. The compute function will have a access to the
150   -- object and the attribute already in the Map
151   --
152   TYPE Attr_Map_Entry_Type IS RECORD
153   (  Object_Name      VARCHAR2(30)
154    , Attribute_Group    VARCHAR2(80)
155    , Attribute_Name   VARCHAR2(30)
156    , Attribute_Value    VARCHAR2(2000)
157    , Computed_Value               VARCHAR2(2000)
158    , Compute_Function             VARCHAR2(240)
159    , Attribute_Type   VARCHAR2(81)
160   );
161 
162   TYPE Attribute_Map IS TABLE OF Attr_Map_Entry_Type
163     INDEX BY BINARY_INTEGER;
164 
165   TYPE Component_Seq_Entry IS RECORD
166   (  Component_Sequence_id  NUMBER
167    , Component_Item_Id      NUMBER
168    , Transaction_Type       VARCHAR2(10)
169 -- bug 4055202: got rid of map from within this record
170 --  (incompatible with 8i)
171 --   , Component_Attrs    Attribute_Map
172   );
173 
174   TYPE Component_Seq_Tbl IS TABLE OF Component_Seq_Entry
175     INDEX BY BINARY_INTEGER;
176 
177   TYPE Modified_Attrs_Map IS TABLE OF Component_Seq_Entry
178     INDEX BY BINARY_INTEGER;
179 
180   TYPE Component_Seq_Attr_Entry IS RECORD
181   (  Component_Sequence_id  NUMBER
182 -- for 8i: can't embed table or record with composite fields into this
183    , Object_Name      VARCHAR2(30)
184    , Attribute_Group    VARCHAR2(80)
185    , Attribute_Name   VARCHAR2(30)
186    , Attribute_Value    VARCHAR2(2000)
187    , Computed_Value               VARCHAR2(2000)
188    , Compute_Function             VARCHAR2(240)
189    , Attribute_Type   VARCHAR2(81)
190     );
191 
192   TYPE Component_Seq_Attrs_Tbl IS TABLE OF Component_Seq_Attr_Entry
193     INDEX BY BINARY_INTEGER;
194 
195   --
196   -- Rollup Function map will be used for identifying all the rollup actions
197   -- an object supports. Every action identifies the rollup function that
198   -- should be invoked. A rollup function presumeably sets one or more related
199   -- attributes. Hence, when user invokes a Rollup Action, it is not required
200   -- for actual attributes to be specified but just the set of Rollup Actions to be
201   -- performed.
202   -- The Rollup Function will have access to the Object instance and all the
203   -- the attributes in its Attribute Map.
204   --
205   TYPE Rollup_Action_Entry_Type IS RECORD
206   (  Object_Name       VARCHAR2(81)
207    , Rollup_Action     VARCHAR2(240)
208    , Rollup_Function   VARCHAR2(240)
209    , DML_Function      VARCHAR2(240)
210    , DML_Delayed_Write VARCHAR2(1)
211    -- 'Y' if DML_Function should be called with p_perform_dml = N first
212    --     then again at the end of the rollup with p_perform_dml = Y
213    -- Note that currently only 'N' is supported (immediate write)
214   );
215 
216   TYPE Rollup_Action_Map IS TABLE OF Rollup_Action_Entry_Type
217     INDEX BY BINARY_INTEGER;
218 
219 
220   TYPE Item_Org_Rec IS RECORD
221   ( Inventory_Item_Id NUMBER
222   , Organization_Id NUMBER
223   );
224 
225   TYPE Item_Org_Tbl IS TABLE OF Item_Org_Rec
226     INDEX BY BINARY_INTEGER;
227 
228   G_EMPTY_ATTR_MAP_ENTRY    Bom_Rollup_Pub.Attr_Map_Entry_Type;
229   G_EMPTY_ITEM_MAP    Bom_Rollup_Pub.Attribute_Map;
230 
231   G_EMPTY_ACTION_MAP_ENTRY  Bom_Rollup_Pub.Rollup_Action_Entry_Type;
232   G_EMPTY_ACTION_MAP    Bom_Rollup_Pub.Rollup_Action_Map;
233 
234   G_Attribute_Map                 Bom_Rollup_Pub.Attribute_Map;
235   G_Instance_Map                  Bom_Rollup_Pub.Attribute_Map;
236   G_Rollup_Action_Map   Bom_Rollup_Pub.Rollup_Action_Map;
237 
238   G_COMPUTE_GROSS_WEIGHT  CONSTANT  VARCHAR2(240) := 'COMPUTE GROSS WEIGHT';
239   G_COMPUTE_NET_WEIGHT    CONSTANT  VARCHAR2(240) := 'COMPUTE NET WEIGHT';
240   G_PROPOGATE_PRIVATE_FLAG  CONSTANT  VARCHAR2(240) := 'PROPOGATE PRIVATE FLAG';
241   G_PROPOGATE_BRAND_INFO  CONSTANT  VARCHAR2(240) := 'PROPOGATE BRAND INFOMATION';
242   G_COMPUTE_TOP_GTIN_FLAG CONSTANT  VARCHAR2(240) := 'COMPUTE AND PROPOGATE TOP GTIN FLAG';
243   G_COMPUTE_MULTI_ROW_ATTRS    CONSTANT  VARCHAR2(240) := 'COMPUTE MULTI ROW ATTRS';
244   G_PROPAGATE_SH_TEMPS         CONSTANT  VARCHAR2(240) := 'PROPAGATE SH TEMPS';
245 
246   --
247   --  Error Handler Constants
248   --
249   G_LOG_FILE        VARCHAR2(240);
250   G_LOG_FILE_DIR        VARCHAR2(1000);
251   G_DEBUG_FLAG      VARCHAR2(1) := 'N';
252   G_BO_IDENTIFIER   VARCHAR2(8) := 'BOM_RLUP';
253 
254 
255 
256   --
257   -- the following maps are defined in the spec for re-useability and are for
258   -- internal use only. They are therefore prefixed as l_ instead of G_
259   -- Defined to overcome the 8i limitation of collections in dynamic sql
260   --
261   l_Component_Seq_Tbl   Bom_Rollup_Pub.Component_Seq_Tbl;
262   l_Component_Attrs   Bom_Rollup_Pub.Attribute_Map;
263   l_Header_Attrs_Map  Bom_Rollup_Pub.Attribute_Map;
264   l_Top_Item_Attrs_Map  Bom_Rollup_Pub.Attribute_Map;
265   l_Component_Seq_Attrs_Tbl Bom_Rollup_Pub.Component_Seq_Attrs_Tbl;
266 
267 --
268 --  the following global variables are being used for multi-row attribute
269 --  updates.
270   g_pk_column_name_value_pairs    EGO_COL_NAME_VALUE_PAIR_ARRAY;
271   g_class_code_name_value_pairs   EGO_COL_NAME_VALUE_PAIR_ARRAY;
272   g_data_level_name_value_pairs   EGO_COL_NAME_VALUE_PAIR_ARRAY;
273   g_attr_diffs                    EGO_USER_ATTR_DIFF_TABLE;
274   g_transaction_type              VARCHAR2(10);
275   g_attr_group_id                 NUMBER;
276 
277 /************************************************************************
278 * Procedure: WRITE_DEBUG_LOG
279 * Purpose  : This method will write debug information to the
280 *            to the log file based on MRP_DEBUG Flag
281 * Parameters:
282 *      p_bo_identifier      IN
283 *      p_message            IN
284 **************************************************************************/
285 /*#
286 * This method log the debug info into the log file
287 * @param p_bo_identifier Business Object Identifier
288 * @param p_message Error/Debug Message
289 * @rep:scope public
290 * @rep:lifecycle active
291 * @rep:displayname Write Logs for Rollup Actions
292 */
293   PROCEDURE WRITE_DEBUG_LOG
294   (  p_bo_identifier    IN  varchar2
295    , p_message          IN  varchar2
296    );
297 
298 /************************************************************************
299 * Procedure: WRITE_ERROR_LOG
300 * Purpose  : This method will write Errors to
301 *            error handler
302 * Parameters:
303 *      p_bo_identifier      IN
304 *      p_message            IN
305 **************************************************************************/
306 /*#
307 * This method will initialization of error handler if necessary
311 * @rep:scope public
308 * and log the error to the error handler tables.
309 * @param p_bo_identifier Business Object Identifier
310 * @param p_message Error/Debug Message
312 * @rep:lifecycle active
313 * @rep:displayname Write Logs for Rollup Actions
314 */
315   PROCEDURE WRITE_ERROR_LOG
316   (  p_bo_identifier    IN  varchar2
317    , p_message          IN  varchar2
318    );
319 
320 
321 
322 /************************************************************************
323 * Procedure: Perform_Rollup
324 * Purpose  : This method will perform rollup or propogation of attributes
325 *            The attribute value propogated or computed up the bom is based
326 *            on the value returned by the compute_function.
327 *      Compute function will be passed Attribute Map and the list of
328 *      child components.
329 * Parameters:p_item_id      IN
330 *      p_organization_id    IN
331 *      p_alternate_bom_code IN
332 *      p_action_map         IN
333 *      p_validate           IN
334 *      p_ignore_errors      IN
335 *      x_error_message    OUT
336 **************************************************************************/
337 /*#
338 * This method will perform rollup or propogation of attributes
339 * The attribute value propogated or computed up the bom is based
340 * on the value returned by the compute_function.
341 * Compute function will be passed Attribute Map and the list of
342 * child components.
343 * @param p_item_id Inventory Item Identifier
344 * @param p_organization_id Organization Identifier
345 * @param p_alternate_bom_code Alternate BOM Designator
346 * @param p_action_map Action Map of the Rollup Actions
347 * @param p_validate Flag specifying whether to validate (default 'Y')
348 * @param p_halt_on_error Flag specifying if errors should halt rollup (default 'N')
349 * @rep:paraminfo {@rep:innertype Bom_Rollup_Pub.Rollup_Action_Map}
350 * @param x_error_message OUT Error Message.
351 * @rep:scope public
352 * @rep:lifecycle active
353 * @rep:displayname Perform Attribute Rollup on a BOM/Product Structure
354 */
355   PROCEDURE Perform_Rollup
356   (  p_item_id            IN  NUMBER
357    , p_organization_id    IN  NUMBER
358    , p_alternate_bom_code IN  VARCHAR2
359    , p_action_map         IN  Bom_Rollup_Pub.Rollup_Action_Map DEFAULT G_EMPTY_ACTION_MAP
360    , p_validate           IN  VARCHAR2 DEFAULT 'Y'
361    , p_halt_on_error      IN  VARCHAR2 DEFAULT 'N'
362    , x_error_message      OUT NOCOPY VARCHAR2
363    );
364 
365 
366 /*#
367 * This method will perform rollup or propogation of attributes
368 * The attribute value propogated or computed up the bom is based
369 * on the value returned by the compute_function of the attribute.
370 * Compute function will be passed Attribute Map and the list of
371 * child components. If there is no compute function for the attribute
372 * the current value of the attribute will be rolled up.
373 * Given a Structure Type, only the "Preferred" structure within that
374 * structure type will be used for rolling up the attributes.
375 * @param p_item_id Inventory Item Identifier
376 * @param p_organization_id Organization Identifier
377 * @param p_parent_item_id Parent Inventory Item Identifier
378 * @param p_structure_type_id Structure Type Identifier
379 * @param p_action_map Action Map of the Rollup Actions
380 * @param p_validate Flag specifying whether to validate (default 'Y')
381 * @param p_halt_on_error Flag specifying if errors should halt rollup (default 'N')
382 * @rep:paraminfo {@rep:innertype Bom_Rollup_Pub.Rollup_Action_Map}
383 * @param x_error_message OUT Error Message.
384 * @rep:scope public
385 * @rep:lifecycle active
386 * @rep:displayname Perform Attribute Rollup on a BOM/Product Structure
387 */
388         PROCEDURE Perform_Rollup
389         (  p_item_id            IN  NUMBER
390          , p_organization_id    IN  NUMBER
391          , p_parent_item_id     IN  NUMBER DEFAULT NULL
392          , p_structure_type_id  IN  NUMBER
393          , p_action_map         IN  Bom_Rollup_Pub.Rollup_Action_Map DEFAULT G_EMPTY_ACTION_MAP
394          , p_validate           IN  VARCHAR2 DEFAULT 'Y'
395          , p_halt_on_error      IN  VARCHAR2 DEFAULT 'N'
396          , x_error_message      OUT NOCOPY VARCHAR2
397         );
398 
399 
400 /*#
401 * This method will perform rollup or propogation of attributes
402 * The attribute value propogated or computed up the bom is based
403 * on the value returned by the compute_function of the attribute.
404 * Compute function will be passed Attribute Map and the list of
405 * child components. If there is no compute function for the attribute
406 * the current value of the attribute will be rolled up.
407 * Given a Structure Type, only the "Preferred" structure within that
408 * structure type will be used for rolling up the attributes.
409 * @param p_item_id Inventory Item Identifier
410 * @param p_organization_id Organization Identifier
411 * @param p_parent_item_id Parent Inventory Item Identifier
412 * @param p_structure_type_name Structure Type internal name
413 * @param p_action_map Action Map of the Rollup Actions
414 * @param p_validate Flag specifying whether to validate (default 'Y')
415 * @param p_halt_on_error Flag specifying if errors should halt rollup (default 'N')
416 * @rep:paraminfo {@rep:innertype Bom_Rollup_Pub.Rollup_Action_Map}
417 * @param x_error_message OUT Error Message.
418 * @rep:scope public
419 * @rep:lifecycle active
423         (  p_item_id             IN  NUMBER
420 * @rep:displayname Perform Attribute Rollup on a BOM/Product Structure
421 */
422         PROCEDURE Perform_Rollup
424          , p_organization_id     IN  NUMBER
425          , p_parent_item_id      IN  NUMBER DEFAULT NULL
426          , p_structure_type_name IN  VARCHAR2
427          , p_action_map          IN  Bom_Rollup_Pub.Rollup_Action_Map DEFAULT G_EMPTY_ACTION_MAP
428          , p_validate            IN  VARCHAR2 DEFAULT 'Y'
429          , p_halt_on_error       IN  VARCHAR2 DEFAULT 'N'
430          , x_error_message       OUT NOCOPY VARCHAR2
431         );
432 
433 /************************************************************************
434 * Procedure: Perform_Rollup
435 * Purpose  : This method will perform rollup or propogation of attributes
436 *            for multi-row attributes.
437 *            The attribute value propogated or computed up the bom is based
438 *            on value returned by the compute_function.
439 * Parameters:
440 *      p_item_id      IN
441 *      p_organization_id    IN
442 *      p_structure_type_name IN
443 *      p_pk_column_name_value_pairs IN
444 *      p_class_code_name_value_pairs   IN
445 *      p_data_level_name_value_pairs   IN
446 *      p_attr_diffs                    IN
447 *      p_transaction_type              IN
448 *      p_attr_group_id                 IN
449 *      p_action_map   IN
450 *      x_error_message    OUT
451 **************************************************************************/
452 /*#
453 * This method will perform rollup or propogation of attributes
454 * for multi-row attributes, for which the attribute changes are passed
455 * The attribute value propogated or computed up the bom is based
456 * on value returned by the compute_function.
457 * Compute function will be passed Attribute Map and the list of
458 * child components.
459 * @param p_item_id Inventory Item Identifier
460 * @param p_organization_id Organization Identifier
461 * @param p_structure_type_name Structure Type Name
462 * @param p_pk_column_name_value_pairs PK Column Name value pair
463 * @param p_class_code_name_value_pairs Classification Code Name and Value
464 * @param p_data_level_name_value_pairs Data Level Name and Value
465 * @param p_attr_diffs  Encapsulates Attribute Changes
466 * @param p_transaction_type  Transaction Type (ADD, SYNC, DEL etc.)
467 * @param p_attr_group_id       Attribute Group Id
468 * @param p_action_map Action Map of the Rollup Actions
469 * @rep:paraminfo {@rep:innertype Bom_Rollup_Pub.Rollup_Action_Map}
470 * @param x_error_message OUT Error Message.
471 * @rep:scope public
472 * @rep:lifecycle active
473 * @rep:displayname Perform Attribute Rollup on a BOM/Product Structure
474 */
475 PROCEDURE Perform_Rollup
476         (  p_item_id            IN  NUMBER
477          , p_organization_id    IN  NUMBER
478          , p_structure_type_name  IN  VARCHAR2
479          , p_pk_column_name_value_pairs    IN EGO_COL_NAME_VALUE_PAIR_ARRAY
480          , p_class_code_name_value_pairs   IN EGO_COL_NAME_VALUE_PAIR_ARRAY
481          , p_data_level_name_value_pairs   IN EGO_COL_NAME_VALUE_PAIR_ARRAY
482          , p_attr_diffs                    IN EGO_USER_ATTR_DIFF_TABLE
483          , p_transaction_type              IN VARCHAR2
484          , p_attr_group_id                 IN NUMBER
485          , p_action_map         IN  Bom_Rollup_Pub.Rollup_Action_Map DEFAULT G_EMPTY_ACTION_MAP
486          , x_error_message      OUT NOCOPY VARCHAR2
487         );
488 
489   /*********************************************************************
490   * Function: Get_Rollup_Function
491   * Purpose : Given an Object and the Rollup Action to be performed, this
492   *           function will return the Roll function that will be executed.
493   *
494   ************************************************************************/
495   Function Get_Rollup_Function
496   ( p_object_name   IN  VARCHAR2
497   , p_rollup_action IN  VARCHAR2
498   ) RETURN VARCHAR2;
499 
500 /*********************************************************************
501 * Procedure : Add_Rollup_Action
502 * Purpose   : This procedure helps build the Action Map. Once the action
503 *             map is ready, calling application can call perfom_rollup
504 *       with the Rollup Action Map.
505 *       The object/action is checked against the supported set of
506 *       Actions, hence, an incorrect combination will throw a
507 *       'BOM_OBJECT_ACTION_INVALID' exception.
508 ************************************************************************/
509 /*#
510 * Used for building the Action Map. Once the action map is ready,
511 * calling application can call perfom_rollup with the Rollup Action Map.
512 * The object/action is checked against the supported set of
513 * Actions, hence, an incorrect combination will throw a
514 * 'BOM_OBJECT_ACTION_INVALID' exception. A function to handle DML
515 * operations is also needed along with a flag which specifies whether
516 * the function supports delayed writes, in which the DML operation
517 * is buffered until the end of that particular rollup stage, at which
518 * point all buffered DML operations are executed (enhances performance
519 * since each rollup actions would otherwise have to issue DML operations
520 * individually, rather than bulk updating
521 * @param p_object_name Object Of the Rollup Action
522 * @param p_rollup_action Rollup Action
523 * @param p_dml_function DML Function
527 * @rep:scope public
524 * @param p_dml_delayed_write Flag specifying whether DML Function supports Delayed Writes
525 * @param x_rollup_action_map Action Map of the Rollup Actions
526 * @rep:paraminfo {@rep:innertype Bom_Rollup_Pub.Rollup_Action_Map}
528 * @rep:lifecycle active
529 * @rep:displayname Build Rollup Action Map
530 */
531   Procedure Add_Rollup_Function
532   ( p_Object_Name       IN VARCHAR2
533   , p_Rollup_Action     IN VARCHAR2
534   , p_DML_Function      IN VARCHAR2
535   , p_DML_Delayed_Write IN VARCHAR2
536   , x_Rollup_Action_Map IN OUT NOCOPY Bom_Rollup_Pub.Rollup_Action_Map
537   );
538 
539 /*********************************************************************
540 * Procedure : Get_Item_Rollup_Map
541 * Purpose   : Returns the supported list of Actions for an Object
542 *
543 ************************************************************************/
544 FUNCTION Get_Item_Rollup_Map
545   ( p_Object_Name   IN  VARCHAR2 )
546         RETURN Bom_Rollup_Pub.Rollup_Action_Map;
547 
548 /*#
549 * It is used to create a map of the parent object's attributes in a
550 * reverse topology traversal.
551 *
552 * @param p_attribute_name Object Attribute Name
553 * @param p_attribute_value Attribute Value
554 * @rep:scope public
555 * @rep:lifecycle active
556 * @rep:displayname Set Parent attribute in a reverse topology traversal
557 */
558   PROCEDURE Set_Parent_Attribute
559   (  p_attribute_name IN  VARCHAR2
560    , p_attribute_value  IN  VARCHAR2
561   );
562 
563 /*#
564 * It is used to create a map of the top object's attributes in a
565 * tree.
566 *
567 * @param p_attribute_name Object Attribute Name
568 * @param p_attribute_value Attribute Value
569 * @rep:scope public
570 * @rep:lifecycle active
571 * @rep:displayname Set Top object's attribute
572 */
573   PROCEDURE Set_Top_Item_Attribute
574         (  p_attribute_name     IN  VARCHAR2
575          , p_attribute_value    IN  VARCHAR2
576         );
577 
578 /*#
579 * Returns the identifier of the Top Object
580 *
581 * @return Top Item Identifier
582 * @rep:scope public
583 * @rep:lifecycle active
584 * @rep:displayname Get Top Item identifier
585 */
586   FUNCTION Get_Top_Item_Id RETURN NUMBER;
587 
588 /*#
589 * Return Top object's organization.
590 *
591 * @return Top Item Organization Identifier
592 * @rep:scope private
593 * @rep:lifecycle active
594 * @rep:displayname Get Top Items Oranization identifier
595 */
596   FUNCTION Get_Top_Organization_Id RETURN NUMBER;
597 
598 /*#
599 * Returns current item object's identifier. In a reverse topology
600 * traversal, this is the parent item of the level in process.
601 * @return Current/Parent Item Identifier
602 * @rep:scope private
603 * @rep:lifecycle active
604 * @rep:displayname Get current item object's identifier
605 */
606   FUNCTION Get_Current_Item_Id RETURN NUMBER;
607 
608 /*#
609 * Returns current Item object's organization identifier. In a reverse topology
610 * traversal, this is the parent item of the level in process.
611 *
612 * @return Current/Parent Item's Organization Identifier
613 * @rep:scope private
614 * @rep:lifecycle active
615 * @rep:displayname Get current item object's organization identifier
616 */
617   FUNCTION Get_Current_Organization_Id RETURN NUMBER;
618 
619 
620 /*#
621 * Returns component's attribute's value. This function is to be used alongwith
622 * the calls to Rollup. When a rollup function is in-process, a computation function
623 * can request for a component's attribute using this call.
624 *
625 * @param p_attribute_name Object Attribute Name
626 * @param p_component_sequence_id Component Identifier
627 * @return Component's attribute value
628 * @rep:scope public
629 * @rep:lifecycle active
630 * @rep:displayname Get Attribute Value
631 */
632   FUNCTION Get_Attribute_Value
633         (  p_component_sequence_id      IN  NUMBER
634          , p_attribute_name             IN  VARCHAR2
635         ) RETURN VARCHAR2;
636 
637         /*#
638         * Returns component's attribute's value. This function is to be used alongwith
639         * the calls to Rollup. When a rollup function is in-process, a computation function
640         * can request for a component's attribute using this call.
641         *
642         * @param p_attribute_name Top Object's Attribute Name
643         * @return Component's attribute value
644         * @rep:scope public
645         * @rep:lifecycle active
646         * @rep:displayname Get Top Item Object's Attribute Value
647         */
648         FUNCTION Get_Top_Item_Attribute_Value
649         (  p_attribute_name             IN  VARCHAR2
650         ) RETURN VARCHAR2;
651 
652 /*#
653 * Returns 'Y' if and only if item is uccnet enabled
654 *
655 * @param p_inventory_item_id Inventory Item Identifier
656 * @param p_organization_id Organization Identifier
657 * @return Whether Item is UCCNet enabled
658 * @rep:scope public
659 * @rep:lifecycle active
660 * @rep:displayname Is UCCNet Enabled
661 */
662   FUNCTION Is_UCCNet_Enabled(p_inventory_item_id IN NUMBER
663                             ,p_organization_id   IN NUMBER
664                             ) RETURN VARCHAR2;
665 
666 /*#
667 * Returns Trade Item Unit Descriptor
668 *
669 * @param p_inventory_item_id Inventory Item Identifier
670 * @param p_organization_id Organization Identifier
671 * @return Trade Item Unit Descriptor
672 * @rep:scope public
673 * @rep:lifecycle active
674 * @rep:displayname Get Trade Item Unit Descriptor
675 */
676   FUNCTION Get_Trade_Item_Unit_Descriptor
677     ( p_inventory_item_id IN NUMBER
678     , p_organization_id   IN NUMBER
679     ) RETURN VARCHAR2;
680 
681 /*#
682 * Returns 'Y' if and only if item is pack item.
683 *
684 * @param p_inventory_item_id Inventory Item Identifier
685 * @param p_organization_id Organization Identifier
686 * @return Whether Item is pack item
687 * @rep:scope public
688 * @rep:lifecycle active
689 * @rep:displayname Is Pack Enabled
690 */
691   FUNCTION Is_Pack_Item
692     (p_inventory_item_id IN NUMBER
693     ,p_organization_id   IN NUMBER
694     ) RETURN VARCHAR2;
695 
696 END Bom_Rollup_Pub;