DBA Data[Home] [Help]

PACKAGE: APPS.ASG_APPLY

Source


1 PACKAGE asg_apply AUTHID DEFINER AS
2 /*$Header: asgaplys.pls 120.2 2008/05/16 09:52:59 saradhak ship $*/
3 
4 -- DESCRIPTION
5 --  This package processes upload data. It also contains ltos of helper
6 --  routines meant to apply the changes efficiently.
7 --
8 -- HISTORY
9 --   15-sep-2004 ssabesan   Changes for delivery notification
10 --   28-nov-2002 ssabesan   Added NOCOPY in function definition
11 --   14-aug-2002 rsripada   Added globals to store conc program's user-id etc
12 --   29-may-2002 rsripada   Streamlined some of the procedures
13 --   24-may-2002 rsripada   Added sequence processing support
14 --   25-apr-2002 rsripada   Added deferred transaction support etc
15 --   22-feb-2002 rsripada   Finalized api specifications
16 --   19-feb-2002 rsripada   Created
17 
18   -- Table to store the list of usernames or publication-items
19   TYPE vc2_tbl_type IS TABLE OF VARCHAR2(30) INDEX BY BINARY_INTEGER;
20   -- Table to store the list of tranids
21   TYPE num_tbl_type IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
22 
23   g_empty_vc2_tbl vc2_tbl_type; -- Should always be empty!
24   g_empty_num_tbl num_tbl_type; -- Should always be empty!
25 
26   g_current_tranid      NUMBER;
27   g_user_name           VARCHAR2(30);
28   g_only_deferred_trans VARCHAR2(1);
29 
30   g_conc_userid        NUMBER := 5;
31   g_conc_respid        NUMBER := 20420;
32   g_conc_appid         NUMBER := 1;
33 
34   -- Logging procedure
35   PROCEDURE log(debug_msg IN VARCHAR2,
36                 log_level IN NUMBER := FND_LOG.LEVEL_STATEMENT);
37 
38   -- Sort the publication item list by weight stored in
39   -- asg_pub_item table
40   PROCEDURE sort_by_weight(p_pub_name IN VARCHAR2,
41                            x_pub_items_tbl IN OUT NOCOPY vc2_tbl_type);
42 
43   -- Returns the list of all clients with the specified inq record types
44   -- dirty for unprocessed new records
45   -- deferred for processed but deferred records.
46   -- x_return_status should be checked for FND_API.G_RET_STS_SUCCESS
47   -- before the clients list processed.
48   PROCEDURE get_all_clients(p_dirty IN VARCHAR2 := 'Y',
49                             p_deferred IN VARCHAR2 := 'N',
50                             x_clients_tbl OUT NOCOPY vc2_tbl_type,
51                             x_return_status OUT NOCOPY VARCHAR2);
52 
53   PROCEDURE get_all_tranids(p_user_name IN VARCHAR2,
54                             x_tranids_tbl OUT NOCOPY num_tbl_type,
55                             x_return_status OUT NOCOPY VARCHAR2);
56 
57   -- get the names of all publication items that have
58   -- records for the specified tran_id and pubname
59   PROCEDURE get_all_pub_items(p_user_name IN VARCHAR2,
60                               p_tranid   IN NUMBER,
61                               p_pubname IN VARCHAR2,
62                               x_pubitems_tbl OUT NOCOPY vc2_tbl_type,
63                               x_return_status OUT NOCOPY VARCHAR2);
64 
65   -- get the names of all publication items that have
66   -- records for the specified tran_id
67   PROCEDURE get_all_pub_items(p_user_name IN VARCHAR2,
68                               p_tranid   IN NUMBER,
69                               x_pubitems_tbl OUT NOCOPY vc2_tbl_type,
70                               x_return_status OUT NOCOPY VARCHAR2);
71 
72   -- get the names of all publication items that have only dirty
73   -- records for the specified tran_id
74   PROCEDURE get_all_dirty_pub_items(p_user_name IN VARCHAR2,
75                                     p_tranid   IN NUMBER,
76                                     p_pubname IN VARCHAR2,
77                                     x_pubitems_tbl OUT NOCOPY vc2_tbl_type,
78                                     x_return_status OUT NOCOPY VARCHAR2);
79 
80   -- Will set x_return_status to FND_API.G_RET_STS_ERROR if no tranid exists
81   -- Returns both dirty and deferred tranids
82   PROCEDURE get_first_tranid(p_user_name IN VARCHAR2,
83                              x_tranid OUT NOCOPY NUMBER,
84                              x_return_status OUT NOCOPY VARCHAR2);
85 
86   -- Will set x_return_status to FND_API.G_RET_STS_ERROR if no tranid exists
87   -- Returns both dirty and deferred tranids
88   PROCEDURE get_next_tranid(p_user_name IN VARCHAR2,
89                             p_curr_tranid IN NUMBER,
90                             x_tranid OUT NOCOPY NUMBER,
91                             x_return_status OUT NOCOPY VARCHAR2);
92 
93   -- Procedure to delete a row
94   PROCEDURE delete_row(p_user_name IN VARCHAR2,
95                        p_tranid IN NUMBER,
96                        p_pubitem IN VARCHAR2,
97                        p_sequence IN NUMBER,
98                        x_return_status OUT NOCOPY VARCHAR2);
99 
100   -- Procedure to purge all the dirty INQ records for
101   -- the specified user/transid/publication-item(s)
102   PROCEDURE purge_pubitems(p_user_name IN VARCHAR2,
103                            p_tranid   IN NUMBER,
104                            p_pubitems_tbl  IN vc2_tbl_type,
105                            x_return_status OUT NOCOPY VARCHAR2);
106 
107   -- Procedure to purge all the dirty INQ records for
108   -- the specified user/transid
109   PROCEDURE purge_pubitems(p_user_name IN VARCHAR2,
110                            p_tranid  IN NUMBER,
111                            x_return_status OUT NOCOPY VARCHAR2);
112 
113   -- Procedure to purge all the dirty INQ records for
114   -- the specified user
115   PROCEDURE purge_pubitems(p_user_name IN VARCHAR2,
116                            x_return_status OUT NOCOPY VARCHAR2);
117 
118   -- Signal the beginning of inq processing for an user
119   -- returns FND_API.G_FALSE is no inq processing is necessary for this user
120   PROCEDURE begin_client_apply(p_user_name IN VARCHAR2,
121                                x_begin_client_apply OUT NOCOPY VARCHAR2,
122                                x_return_status OUT NOCOPY VARCHAR2);
123 
124   -- Signal the end of inq processing for an user
125   -- All dirty records processed in this session that are not removed from
126   -- inq will be marked as deferred.
127   PROCEDURE end_client_apply(p_user_name IN VARCHAR2,
128                              x_return_status OUT NOCOPY VARCHAR2);
129 
130   -- Should be called before any user's transactions are processed
131   -- returns FND_API.G_FALSE if no user has dirty/deferred data in inq.
132   PROCEDURE begin_apply(x_begin_apply OUT NOCOPY VARCHAR2,
133                         x_return_status OUT NOCOPY VARCHAR2);
134 
135   -- Should be called at the end of the apply for all clients in that
136   -- session. Always returns FND_API.G_RET_STS_SUCCESS.
137   PROCEDURE end_apply(x_return_status OUT NOCOPY VARCHAR2);
138 
139   -- Procedure to update the upload information
140   PROCEDURE setup_inq_info(p_user_name IN VARCHAR2,
141                            p_tranid IN NUMBER,
142                            x_return_status OUT NOCOPY VARCHAR2);
143 
144   -- Procedure to process sequence updates from client
145   PROCEDURE process_sequences(p_user_name IN VARCHAR2,
146                               p_tranid IN NUMBER,
147                               x_return_status OUT NOCOPY VARCHAR2);
148 
149   -- Main procedure to process all upload transactions
150   -- Will be used by the concurrent program to process all users.
151   PROCEDURE process_upload(errbuf OUT NOCOPY VARCHAR2,
152                            retcode OUT NOCOPY VARCHAR2);
153 
154   function is_conc_program_running
155   return varchar2;
156 
157 --12.1
158   PROCEDURE get_compacted_tranid(p_user_name IN VARCHAR2,
159                                  p_tranid IN NUMBER,
160                                  x_compacted_tranid OUT NOCOPY NUMBER,
161                                  x_return_status OUT NOCOPY VARCHAR2);
162 
163 --12.1
164   PROCEDURE process_auto_sync(p_user_name IN VARCHAR2,
165                               p_tranid IN NUMBER,
166                               x_compacted_tranid OUT NOCOPY NUMBER,
167                               x_return_status OUT NOCOPY VARCHAR2);
168 
169 END asg_apply;