DBA Data[Home] [Help]

PACKAGE: APPS.CN_SCA_WF_PKG

Source


1 PACKAGE CN_SCA_WF_PKG AUTHID CURRENT_USER AS
2 /* $Header: cnpscaws.pls 120.1 2005/09/15 14:42:34 rchenna noship $ */
3 /*#
4  * This package includes public APIs for Sales Credit Allocation standard Revenue
5  * Distribution and Transaction Transfer.
6  * @rep:scope public
7  * @rep:product CN
8  * @rep:displayname Workflow processes for Revenue Distribution and Transaction Transfer
9  * @rep:lifecycle active
10  * @rep:compatibility S
11  * @rep:category BUSINESS_ENTITY CN_COMP_PLANS
12  */
13 
14 G_PKG_NAME  CONSTANT VARCHAR2(30) := 'CN_SCA_WF_PKG';
15 
16 -- CONSTANTS
17 G_REVENUE       CONSTANT VARCHAR2(30) := 'REVENUE';     -- revenue_type
18 G_REV_NOT_100   CONSTANT VARCHAR2(30) := 'REV NOT 100'; -- process_status
19 G_ALLOCATED     CONSTANT VARCHAR2(30) := 'ALLOCATED';   -- process_status
20 G_PROFILE       CONSTANT VARCHAR2(30) := 'CN_SCA_REV_NOT_100';
21 
22 -- Start of comments
23 --    API name        : START_PROCESS
24 --    Description     : Starts the WF process, for ONLINE Revenue Distribution.
25 --    Type            : Public.
26 --    Function        :
27 --    Pre-reqs        : None.
28 --    Parameters      :
29 --    IN              : p_sca_batch_id        IN NUMBER       Required
30 --                      p_wf_process          IN VARCHAR2     Required
31 --                      p_wf_item_type        IN VARCHAR2     Required
32 --    OUT             :
33 --    Version         : Current version   1.0
34 --                      Previous version
35 --                      Initial version   1.0
36 --    Notes           : p_sca_batch_id - sca_batch_id processed by SCA Engine
37 --                      p_wf_process   - 'CN_SCA_REV_DIST_PR'
38 --                      p_wf_item_type - 'CNSCARPR'
39 -- End of comments
40 
41 /*#
42  * This procedure creates a workflow process with the given specifications that distributes
43  * revenue between transactions processed in Batch mode.
44  * It also lets the user to create a plan element assignment.
45  * @param p_sca_batch_id Sales Credit Allocation Batch identifier. Foreign key to CN_SCA_HEADERS_INTERFACE
46  * @param p_wf_process Sales Credit Allocation Workflow Revenue Distribution process identifier ('CN_SCA_REV_DIST_PR).
47  * @param p_wf_item_type Sales Credit Allocation Workflow item identifier ('CNSCARPR').
48  * @rep:scope public
49  * @rep:lifecycle active
50  * @rep:displayname Start workflow process for Revenue Distribution (Batch Mode transactions)
51  */
52 PROCEDURE START_PROCESS (
53     p_sca_batch_id      IN number,
54     p_wf_process        IN varchar2,
55     p_wf_item_type      IN varchar2);
56 
57 -- Start of comments
58 --    API name        : START_PROCESS
59 --    Description     : Starts the WF process, for BATCH Revenue Distribution.
60 --    Type            : Public.
61 --    Function        :
62 --    Pre-reqs        : None.
63 --    Parameters      :
64 --    IN              : p_start_header_id     IN NUMBER       Required
65 --                      p_end_header_id       IN NUMBER       Required
66 --                      p_trx_source          IN VARCHAR2     Required
67 --                      p_wf_process          IN VARCHAR2     Required
68 --                      p_wf_item_type        IN VARCHAR2     Required
69 --    OUT             :
70 --    Version         : Current version   1.0
71 --                      Previous version
72 --                      Initial version   1.0
73 --    Notes           : p_start_header_id - lowest sca_headers_interface_id
74 --                      p_end_header_id   - highest sca_header_interface_id
75 --                      p_trx_source      - lookup code of type SCA_TRX_SOURCES
76 --                      p_wf_process      - 'CN_SCA_REV_DIST_PR'
77 --                      p_wf_item_type    - 'CNSCARPR'
78 -- End of comments
79 /*#
80  * This procedure creates a workflow process with the given specifications that distributes
81  * revenue between transactions processed in Online mode.
82  * @param p_start_header_id Minimum identifier of transaction headers that are processed.
83  * Foreign key to CN_SCA_HEADERS_INTERFACE
84  * @param p_end_header_id Maximum identifier of transaction headers that are processed.
85  * Foreign key to CN_SCA_HEADERS_INTERFACE
86  * @param p_trx_source Transaction source of transaction headers that are processed.
87  * Foreign key to CN_SCA_HEADERS_INTERFACE
88  * @param p_wf_process Sales Credit Allocation Workflow Revenue Distribution process
89  * identifier ('CN_SCA_REV_DIST_PR)
90  * @param p_wf_item_type Sales Credit Allocation Workflow item identifier ('CNSCARPR')
91  * @rep:scope public
92  * @rep:lifecycle active
93  * @rep:displayname Start workflow process for Renenue Distribution (Online Mode)
94  */
95 
96 PROCEDURE START_PROCESS (
97     p_start_header_id   IN number,
98     p_end_header_id     IN number,
99     p_trx_source        IN varchar2,
100     p_wf_process        IN varchar2,
101     p_wf_item_type      IN varchar2);
102 
103 -- Start of comments
104 --    API name        : START_PROCESS
105 --    Description     : Starts the WF process, for BATCH Transaction Loading.
106 --    Type            : Public.
107 --    Function        :
108 --    Pre-reqs        : None.
109 --    Parameters      :
110 --    IN              : p_start_date          IN DATE         Required
111 --                      p_end_date            IN DATE         Required
112 --                      p_trx_source          IN VARCHAR2     Required
113 --                      p_wf_process          IN VARCHAR2     Required
114 --                      p_wf_item_type        IN VARCHAR2     Required
115 --    OUT             : x_wf_item_key         OUT VARCHAR2
116 --    Version         : Current version   1.0
117 --                      Previous version
118 --                      Initial version   1.0
119 --    Notes           : p_start_date   - lowest processed_date
120 --                      p_end_date     - highest processed_date
121 --                      p_trx_source   - lookup code of type SCA_TRX_SOURCES
122 --                      p_wf_process   - 'CN_SCA_TRX_LOAD_PR'
123 --                      p_wf_item_type - 'CNSCARPR'
124 --                      x_wf_item_key  - workflow item key
125 --                      Includes programmatic deferal of process to WF background
126 --                      process.
127 -- End of comments
128 /*#
129  * This procedure creates a deferred workflow process with the given specifications that
130  * transfers transactions from the Sales Credit Allocation batch interface tables to the
131  * Oracle Incentive Compensation Transaction Interface table, or to custom table(s).
132  * @param p_start_date Minimum date of transaction headers that are processed.
133  * Foreign key to CN_SCA_HEADERS_INTERFACE_GTT
134  * @param p_end_date Maximum date of transaction headers that are processed.
135  * Foreign key to CN_SCA_HEADERS_INTERFACE_GTT
136  * @param p_trx_source Transaction source of transaction headers that are processed.
137  * Foreign key to CN_SCA_HEADERS_INTERFACE_GTT
138  * @param p_wf_process Sales Credit Allocation Workflow Revenue Distribution process
139  * identifier ('CN_SCA_REV_DIST_PR)
140  * @param p_wf_item_type Sales Credit Allocation Workflow item identifier ('CNSCARPR')
141  * @param x_wf_item_key Workflow item key of the Transaction Transfer process
142  * @rep:scope public
143  * @rep:lifecycle active
144  * @rep:displayname Workflow process to load the transactions.
145  */
146 
147 PROCEDURE START_PROCESS (
148     p_start_date        IN date,
149     p_end_date          IN date,
150     p_trx_source        IN varchar2,
151     p_org_id		IN number,
152     p_wf_process        IN varchar2,
153     p_wf_item_type      IN varchar2,
154     x_wf_item_key       OUT NOCOPY varchar2);
155 
156 -- Start of comments
157 --    API name        : SELECTOR
158 --    Description     : Determines which WF process to run by default.
159 --    Type            : Private.
160 --    Function        :
161 --    Pre-reqs        : None.
162 --    Parameters      :
163 --    IN              : itemType              IN VARCHAR2     Required
164 --                      itemKey               IN VARCHAR2     Required
165 --                      actId                 IN NUMBER       Required
166 --                      funcMode              IN VARCHAR2     Required
167 --    OUT             : resoultOut            OUT VARCHAR2(30)
168 --    Version         : Current version   1.0
169 --                      Previous version
170 --                      Initial version   1.0
171 --    Notes           : itemType  - A valid item type from WF_ITEM_TYPES table.
172 --                      itemKey   - A string generated from application object's
173 --                                  PRIMARY key.
174 --                      actId     - The function activity (instance ID)
175 --                      funcMode  - Run/Cancel.
176 --                      resultOut - Name of default workflow process to run,
177 --                                  'CN_SCA_REV_DIST_PR' (Revenue Distribution)
178 -- End of comments
179 PROCEDURE SELECTOR (
180     itemType    IN  varchar2,
181     itemKey     IN  varchar2,
182     actId       IN  number,
183     funcMode    IN  varchar2,
184     resultOut   OUT NOCOPY VARCHAR2);
185 
186 -- Start of comments
187 --    API name        : TRX_LOAD_SELECT
188 --    Description     : Determines which Revenue Distribution function to run.
189 --    Type            : Private.
190 --    Function        :
191 --    Pre-reqs        : None.
192 --    Parameters      :
193 --    IN              : itemType              IN VARCHAR2     Required
194 --                      itemKey               IN VARCHAR2     Required
195 --                      actId                 IN NUMBER       Required
196 --                      funcMode              IN VARCHAR2     Required
197 --    OUT             : resoultOut            OUT VARCHAR2(30)
198 --    Version         : Current version   1.0
199 --                      Previous version
200 --                      Initial version   1.0
201 --    Notes           : itemType  - A valid item type from WF_ITEM_TYPES table
202 --                      itemKey   - A string generated from application object's
203 --                                  PRIMARY key
204 --                      actId     - The function activity (instance ID)
205 --                      funcMode  - Run/Cancel
206 --                      resultOut - CN_SCA_REV_FUNC lookup code:
207 --                                  'COMPLETE:EVEN'
208 --                                  'COMPLETE:WTD'
209 --                                  'COMPLETE:CUSTOM'
210 -- End of comments
211 PROCEDURE REV_DIST_SELECT (
212     itemType    IN  varchar2,
213     itemKey     IN  varchar2,
214     actId       IN  number,
215     funcMode    IN  varchar2,
216     resultOut   OUT NOCOPY varchar2);
217 
218 -- Start of comments
219 --    API name        : TRX_LOAD_SELECT
220 --    Description     : Determines which Transaction Load function to run.
221 --    Type            : Private.
222 --    Function        :
223 --    Pre-reqs        : None.
224 --    Parameters      :
225 --    IN              : itemType              IN VARCHAR2     Required
226 --                      itemKey               IN VARCHAR2     Required
227 --                      actId                 IN NUMBER       Required
228 --                      funcMode              IN VARCHAR2     Required
229 --    OUT             : resoultOut            OUT VARCHAR2(30)
230 --    Version         : Current version   1.0
231 --                      Previous version
232 --                      Initial version   1.0
233 --    Notes           : itemType  - A valid item type from WF_ITEM_TYPES table
234 --                      itemKey   - A string generated from application object's
235 --                                  PRIMARY key.
236 --                      actId     - The function activity (instance ID)
237 --                      funcMode  - Run/Cancel
238 --                      resultOut - CN_SCA_TRX_LOAD_FUNC lookup code:
239 --                                  'COMPLETE:CN'
240 --                                  'COMPLETE:CUSTOM'
241 -- End of comments
242 PROCEDURE TRX_LOAD_SELECT (
243     itemType    IN  varchar2,
244     itemKey     IN  varchar2,
245     actId       IN  number,
246     funcMode    IN  varchar2,
247     resultOut   OUT NOCOPY varchar2);
248 
249 -- Start of comments
250 --    API name        : EVEN_REV_DIST
251 --    Description     : Executes EVEN revenue distribution.
252 --    Type            : Private.
253 --    Function        :
254 --    Pre-reqs        : None.
255 --    Parameters      :
256 --    IN              : itemType              IN VARCHAR2     Required
257 --                      itemKey               IN VARCHAR2     Required
258 --                      actId                 IN NUMBER       Required
259 --                      funcMode              IN VARCHAR2     Required
260 --    OUT             : resoultOut            OUT VARCHAR2(30)
261 --    Version         : Current version   1.0
262 --                      Previous version
263 --                      Initial version   1.0
264 --    Notes           : itemType  - A valid item type from WF_ITEM_TYPES table
265 --                      itemKey   - A string generated from application object's
266 --                                  PRIMARY key
267 --                      actId     - The function activity (instance ID)
271 PROCEDURE EVEN_REV_DIST (
268 --                      funcMode  - Run/Cancel
269 --                      resultOut - 'COMPLETE:'
270 -- End of comments
272     itemType    IN  varchar2,
273     itemKey     IN  varchar2,
274     actId       IN  number,
275     funcMode    IN  varchar2,
276     resultOut   OUT NOCOPY varchar2);
277 
278 -- Start of comments
279 --    API name        : WTD_REV_DIST
280 --    Description     : Executes WEIGHTED AVERAGE revenue distribution.
281 --    Type            : Private.
282 --    Function        :
283 --    Pre-reqs        : None.
284 --    Parameters      :
285 --    IN              : itemType              IN VARCHAR2     Required
286 --                      itemKey               IN VARCHAR2     Required
287 --                      actId                 IN NUMBER       Required
288 --                      funcMode              IN VARCHAR2     Required
289 --    OUT             : resoultOut            OUT VARCHAR2(30)
290 --    Version         : Current version   1.0
291 --                      Previous version
292 --                      Initial version   1.0
293 --    Notes           : itemType  - A valid item type from WF_ITEM_TYPES table
294 --                      itemKey   - A string generated from application object's
295 --                                  PRIMARY key
296 --                      actId     - The function activity (instance ID)
297 --                      funcMode  - Run/Cancel
298 --                      resultOut - 'COMPLETE:'
299 -- End of comments
300 PROCEDURE WTD_REV_DIST (
304     funcMode    IN  varchar2,
301     itemType    IN  varchar2,
302     itemKey     IN  varchar2,
303     actId       IN  number,
305     resultOut   OUT NOCOPY varchar2);
306 
307 -- Start of comments
308 --    API name        : CN_TRX_LOAD
309 --    Description     : Executes Oracle Incentive Compensation Transaction Load.
310 --    Type            : Private.
311 --    Function        :
312 --    Pre-reqs        : None.
313 --    Parameters      :
314 --    IN              : itemType              IN VARCHAR2     Required
315 --                      itemKey               IN VARCHAR2     Required
316 --                      actId                 IN NUMBER       Required
317 --                      funcMode              IN VARCHAR2     Required
318 --    OUT             : resoultOut            OUT VARCHAR2(30)
322 --    Notes           : itemType  - A valid item type from WF_ITEM_TYPES table
319 --    Version         : Current version   1.0
320 --                      Previous version
321 --                      Initial version   1.0
323 --                      itemKey   - A string generated from application object's
324 --                      PRIMARY key
325 --                      actId     - The function activity (instance ID)
326 --                      funcMode  - Run/Cancel
327 --                      resultOut - 'COMPLETE:'
328 -- End of comments
329 PROCEDURE CN_TRX_LOAD (
330     itemType    IN  varchar2,
331     itemKey     IN  varchar2,
332     actId       IN  number,
333     funcMode    IN  varchar2,
334     resultOut   OUT NOCOPY varchar2);
335 
336 END CN_SCA_WF_PKG;