1 PACKAGE wms_cache AUTHID CURRENT_USER AS
2 /* $Header: WMSCACHS.pls 120.2.12020000.2 2012/07/04 07:02:58 anviswan ship $*/
3
4 -- File : WMSCACHS.pls
5 -- Content : wms_cahce package specification
6 -- Description : WMS Cache public API's
7
8 g_hash_base NUMBER := 1;
9 g_hash_size NUMBER := POWER(2, 25);
10 g_bulk_fetch_limit CONSTANT NUMBER := 1000;
11
12 TYPE tbl_num IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
13 TYPE tbl_varchar3 IS TABLE OF VARCHAR2(3) INDEX BY BINARY_INTEGER;
14
15 g_from_uom_code_tbl tbl_varchar3;
16 g_to_uom_code_tbl tbl_varchar3;
17 g_from_to_uom_ratio_tbl tbl_num;
18 g_item_tbl tbl_num;
19
20
21
22 TYPE tbl_plsint IS TABLE OF PLS_INTEGER INDEX BY PLS_INTEGER;
23 TYPE Strategy_rec_type IS RECORD (
24 over_allocation_mode wms_strategies_b.over_allocation_mode%TYPE,
25 tolerance_value wms_strategies_b.tolerance_value%TYPE,
26 rule_id_tbl tbl_num,
27 partial_succ_flag_tbl tbl_plsint
28 );
29
30 TYPE strategy_tbl_type IS TABLE OF Strategy_rec_type INDEX BY BINARY_INTEGER;
31 strategy_tbl strategy_tbl_type;
32
33 Function UOM_CONVERT (
34 item_id number,
35 precision number,
36 from_quantity number,
37 from_unit varchar2,
38 to_unit varchar2,
39 lot_number VARCHAR2 DEFAULT NULL, -- Added for Bug 9056696
40 organization_id NUMBER DEFAULT NULL) -- Added for Bug 9056696
41 RETURN NUMBER;
42
43
44 /*************************************/
45 -- This function will be used to cache strategy, its properties like over allocation mode and tolerance, list of rule_ids associated and value of partial success flag associated.
46 -- This function will be called from wms_stategy_pvt when a new strategy comes in.
47 -- This fucntion will intern call the API Wms_re_common_pvt.InitRule() to store all the rules in the PL/SQL table on which the rules engine works currenlty.
48 -- Inputs-
49 -- p_strategy_id - Strategy id of the strategy that's is being applied by WMS Rules engine
50 -- Outputs-
51 -- x_over_alloc_mode - Over allocation mode
52 -- x_toelrance - Over allocation tolerance.
53 -- Return value -
54 -- The function will return number of rules associated with the strategy.
55 /*************************************/
56
57 Function get_Strategy_from_cache (
58 p_strategy_id IN NUMBER ,
59 x_return_status OUT NOCOPY VARCHAR2,
60 x_msg_count OUT NOCOPY NUMBER,
61 x_msg_data OUT NOCOPY VARCHAR2,
62 x_over_alloc_mode OUT NOCOPY NUMBER,
63 x_tolerance OUT NOCOPY NUMBER
64 ) RETURN NUMBER;
65
66 /*************************************/
67 --This procedure is to remove all the rules cached
68 /*************************************/
69 PROCEDURE cleanup_rules_cache;
70
71 END wms_cache;