1 PACKAGE WMS_ATF_RUNTIME_PUB_APIS AS
2 /* $Header: WMSATFRS.pls 120.2.12000000.1 2007/01/16 06:51:01 appldev ship $*/
3
4 --
5 -- File : WMSATFRB.pls
6 -- Content : WMS_ATF_RUNTIME_PUB_APIS package specification
7 -- Description : WMS ATF Run-time APIs
8 -- Notes :
9 -- Modified : 7/24/2003 lezhang created
10
11
12
13 -- API name :
14 -- Type : Public
15 -- Function :
16 -- Pre-reqs :
17 --
18 --
19 -- Parameters :
20 -- Output:
21 --
22 -- Input:
23 --
24 --
25 -- Version
26 -- Currently version is 1.0
27 --
28
29 /**Constants defined for Inspection Flag in validate_operation
30 */
31 G_NO_INSPECTION CONSTANT NUMBER:=1;
32 G_PARTIAL_INSPECTION CONSTANT NUMBER:=2;
33 G_FULL_INSPECTION CONSTANT NUMBER:=3;
34
35 /**Constants defined for Load Flag in validate_operation
36 */
37 G_NO_LOAD CONSTANT NUMBER:=1;
38 G_PARTIAL_LOAD CONSTANT NUMBER:=2;
39 G_FULL_LOAD CONSTANT NUMBER:=3;
40
41
42 /**Constants defined for Drop Flag in validate_operation
43 */
44 G_NO_DROP CONSTANT NUMBER:=1;
45 G_PARTIAL_DROP CONSTANT NUMBER:=2;
46 G_FULL_DROP CONSTANT NUMBER:=3;
47
48 /**Constants defined for Crossdock Flag in validate_operation
49 */
50 G_NO_CROSSDOCK CONSTANT NUMBER:=1;
51 G_PARTIAL_CROSSDOCK CONSTANT NUMBER:=2;
52 G_FULL_CROSSDOCK CONSTANT NUMBER:=3;
53
54
55 TYPE task_id_table_type IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
56
57 /*Error Code Definitions for THE APIs*/
58
59 INVALID_DOC_ID CONSTANT NUMBER := -20001;
60
61 INVALID_PLAN_ID CONSTANT NUMBER := -20002;
62
63 PLAN_INSTANCE_EXISTS CONSTANT NUMBER := -20003;
64
65 PLAN_INSTANCE_NOT_EXITS CONSTANT NUMBER := -20004;
66
67 INVALID_PLAN_INSTANCE CONSTANT NUMBER := -20005;
68
69 OPERATION_INSTANCE_EXISTS CONSTANT NUMBER := -20006;
70
71 OPERATION_INSTANCE_NOT_EXISTS CONSTANT NUMBER := -20007;
72
73 INVALID_OPERATION_INSTANCE CONSTANT NUMBER := -20008;
74
75 INVALID_TASK CONSTANT NUMBER := -20009;
76
77 TASK_NOT_EXISTS CONSTANT NUMBER := -20010;
78
79 INVALID_INPUT CONSTANT NUMBER := -20011;
80
81 DERIVE_DEST_SUGGESTIONS_FAILED CONSTANT NUMBER := -20012;
82
83 DATA_INCONSISTENT CONSTANT NUMBER := -20013;
84
85 INVALID_STATUS_FOR_OPERATION CONSTANT NUMBER := -20014;
86
87 COMPLETE_PENDING_OP CONSTANT NUMBER := -20015;
88
89 /**
90 * Init_OP_Plan_Instance:
91 * <p>For a given document record,this API initialises the Operation Plan Instance as well as the
92 * Operation instance for the first plan detail.</p>
93 * @param x_return_status -Return Status
94 * @param x_msg_data -Returns Message Data
95 * @param x_msg_count -Returns the message count
96 * @param x_error_code -Returns Appropriate error code in case of any error.
97 * @param p_source_task_id -Identifier of the document record.
98 * @param p_activity_id -Identifier of the Activity Type.
99 *
100 **/
101 PROCEDURE INIT_OP_PLAN_INSTANCE(
102 x_return_status OUT NOCOPY VARCHAR2
103 , x_msg_data OUT NOCOPY fnd_new_messages.MESSAGE_TEXT%TYPE
104 , x_msg_count OUT NOCOPY NUMBER
105 , x_error_code OUT NOCOPY NUMBER
106 , p_source_task_id IN NUMBER
107 , p_activity_id IN NUMBER
108 );
109
110 /**
111 * Activate_operation_instance
112 * <p>For a given document record,this API activates the
113 * Operation Instance as well as the task
114 * associated with the current operation</p>
115 *
116 * @param x_return_status -Return Status
117 * @param x_msg_data -Returns the Error message Data
118 * @param x_msg_count -Returns the message count
119 * @param x_error_code -Returns appropriate error code in case of any error.
120 * @param p_source_task_id -Identifier of the document record.
121 * @param p_activity_id -Identifier of the Activity Type.
122 * @param p_task_execute_rec -Input of WMS_DISPATCHED_TASKS to be created for the task.
123 **/
124
125 PROCEDURE ACTIVATE_OPERATION_INSTANCE(
126 x_return_status OUT NOCOPY VARCHAR2
127 ,x_msg_data OUT NOCOPY FND_NEW_MESSAGES.MESSAGE_TEXT%TYPE
128 ,x_msg_count OUT NOCOPY NUMBER
129 ,x_error_code OUT NOCOPY NUMBER
130 ,x_drop_lpn_option OUT NOCOPY NUMBER
131 ,x_consolidation_method_id OUT NOCOPY NUMBER
132 ,p_source_task_id IN NUMBER
133 ,p_activity_id IN NUMBER
134 ,p_operation_type_id IN NUMBER
135 ,p_task_execute_rec IN WMS_DISPATCHED_TASKS%ROWTYPE );
136
137 /** Complete_Operation_instance
138 * <p>This procedure completes the current operation and creates the next operation instance.
139 * If the operation is the last operation the plan is marked as 'COMPLETED' and archived.</p>
140 *
141 * @param x_return_status -Return Status
142 * @param x_msg_data -Returns the Error message Data
143 * @param x_msg_count -Returns the message count
144 * @param x_error_code -Returns appropriate error code in case of any error.
145 * @param p_source_task_id -Identifier of the document record.
146 * @param p_activity_id -Lookup Code for the Activity Type
147 * @param p_operation_type_id -Input parameter containing the lookup code for the Operation
148 * Type. Should be passed for inspect operation.
149 **/
150 PROCEDURE Complete_Operation_Instance(
151 x_return_status OUT NOCOPY VARCHAR2
152 ,x_msg_data OUT NOCOPY FND_NEW_MESSAGES.MESSAGE_TEXT%TYPE
153 ,x_msg_count OUT NOCOPY NUMBER
154 ,x_error_code OUT NOCOPY NUMBER
155 ,p_source_task_id IN NUMBER
156 ,p_activity_id IN NUMBER
157 ,p_operation_type_id IN NUMBER );
158
159
160 /** Validate_Operation
161 * <p>For a given criteria (LPN, Item or task), this API returns certain information,
162 * operation type in particular, about the current pending operation.
163 * Based on the return value, it is caller procedure's responsibility to determine
164 * whether user should be allowed to continue his/her operation.
165 * @param x_return_status -Return Status
166 * @param x_msg_data -Returns the Error message Data
167 * @param x_msg_count -Returns the message count
168 * @param x_error_code -Returns appropriate error code in case of any error.
169 * @param x_inspection_flag -This parameter indicates the inspection requirement for the current pending
170 * operation instances for the given criteria. 1. No inspection is required;
171 * 2. Part of the given criteria requires inspection;
172 * 3. All operation instances for the given criteria require inspection
173 * @param x_drop_flag -This parameter indicates the drop operation for the current pending
174 * operation instances for the given criteria.
175 * 1. No drop is required; 2. Part of the given criteria requires drop;
176 * 3. All operation instances for the given criteria require drop
177 * @param x_load_flag -This parameter indicates the load operation for the current pending
178 * operation instances for the given criteria. 1. No load operation;
179 * 2. Part of the given criteria requires load;
180 * 3. All operation instances for the given criteria require load.
181
182 * @param x_crossdock_flag -This parameter indicates the crossdock operation for the current pending
183 * or active operation instances for the given criteria.
184 * 1. No crossdock operation;
185 * 2. Part of the given criteria requires crossdock;
186 * 3. All operation instances for the given criteria require crossdock. * IMPORTANT: For crossdock operation, we also set load/drop flag and quantity.
187 * This is because from crossdock itself we don not know if it is a load or
188 * drop, and we do need to know this.
189 *
190 * @param x_load_prim_quantity -If LPN/Item or move order line is passed, sum of the primary quantity from
191 * the document table for those document records whose pending operation is
192 * 'Load'.
193 * @param x_drop_prim_Quantity -If LPN/Item or move order line is passed, sum of the primary quantity from
194 * the document table for those document records whose pending operation is
195 * 'Drop'.
196 * @param x_inspect_prim_Quantity-If LPN/Item or move order line is passed, sum of the primary quantity from
197 * the document table for those document records whose pending operation is
198 * 'Inspect'. * @param x_crossdock_prim_quantity -If LPN/Item or move order line is passed, sum of the primary quantity from
199 * the document table for those document records whose pending operation is
200 * 'Load'.
201
202 * @param p_source_task_id -Identifier of the document record.
203 * @param p_move_order_line_id -Move Order line Id that has to be validated.
204 * @param p_inventory_item_id -Inventory Item Id that has to be validated.
205 * @param p_LPN_ID -LPN id of the LPN that has to be validated.
206 * @param p_activity_type_id -Lookup containing the Activity to be performed.
207 **/
208 PROCEDURE validate_operation
209 (
210 x_return_status OUT NOCOPY VARCHAR2 ,
211 x_msg_data OUT NOCOPY FND_NEW_MESSAGES.MESSAGE_TEXT%TYPE ,
212 x_msg_count OUT NOCOPY NUMBER,
213 x_error_code OUT NOCOPY NUMBER ,
214 x_inspection_flag OUT NOCOPY NUMBER ,
215 x_load_flag OUT NOCOPY NUMBER ,
216 x_drop_flag OUT NOCOPY NUMBER ,
217 x_crossdock_flag OUT NOCOPY NUMBER ,
218 x_load_prim_quantity OUT NOCOPY NUMBER ,
219 x_drop_prim_quantity OUT NOCOPY NUMBER ,
220 x_inspect_prim_quantity OUT NOCOPY NUMBER ,
221 x_crossdock_prim_quantity OUT NOCOPY NUMBER ,
222 p_source_task_id IN NUMBER ,
223 p_move_order_line_id IN NUMBER ,
224 p_inventory_item_id IN NUMBER ,
225 p_LPN_ID IN NUMBER ,
226 p_activity_type_id IN NUMBER ,
227 p_organization_id IN NUMBER ,
228 p_lot_number IN VARCHAR2 DEFAULT NULL ,
229 p_revision IN VARCHAR2 DEFAULT NULL);
230
231
232
233 /*
234 * Following is overloaded procedure of the above
235 * without x_crossdock_prim_quantity and x_crossdock_flag.
236 * This is for the convenience of existing RCV call.
237 */
238
239 PROCEDURE validate_operation
240 (
241 x_return_status OUT NOCOPY VARCHAR2 ,
242 x_msg_data OUT NOCOPY FND_NEW_MESSAGES.MESSAGE_TEXT%TYPE ,
243 x_msg_count OUT NOCOPY NUMBER,
244 x_error_code OUT NOCOPY NUMBER ,
245 x_inspection_flag OUT NOCOPY NUMBER ,
246 x_load_flag OUT NOCOPY NUMBER ,
247 x_drop_flag OUT NOCOPY NUMBER ,
248 x_load_prim_quantity OUT NOCOPY NUMBER ,
249 x_drop_prim_quantity OUT NOCOPY NUMBER ,
250 x_inspect_prim_quantity OUT NOCOPY NUMBER ,
251 p_source_task_id IN NUMBER ,
252 p_move_order_line_id IN NUMBER ,
253 p_inventory_item_id IN NUMBER ,
254 p_LPN_ID IN NUMBER ,
255 p_activity_type_id IN NUMBER ,
256 p_organization_id IN NUMBER ,
257 p_lot_number IN VARCHAR2 DEFAULT NULL ,
258 p_revision IN VARCHAR2 DEFAULT NULL
259 );
260
261
262
263 /**
264 * Split_Operation_instance
265 * <p>This procedure splits the operation plan,parent document
266 * record accordingly.</p>
267 *
268 * @param x_return_status -Return Status
269 * @param x_msg_data -Returns the Error message Data
270 * @param x_msg_count -Returns the message count
271 * @param x_error_code -Returns appropriate error code in case of an error .
272 * @param p_source_task_id -Identifier of the source document record
273 * @param p_activity_type_id - Lookup code of the Activity type Id
274 * @param p_new_Task_id_table -PL/SQL table of Numbers of the MMTT ids
275 **/
276 PROCEDURE Split_Operation_Instance(
277 x_return_status OUT NOCOPY VARCHAR2 ,
278 x_msg_data OUT NOCOPY FND_NEW_MESSAGES.MESSAGE_TEXT%TYPE ,
279 x_msg_count OUT NOCOPY NUMBER,
280 x_error_code OUT NOCOPY NUMBER ,
281 p_source_task_id IN NUMBER ,
282 p_activity_type_id IN NUMBER ,
283 p_new_task_id_table IN task_id_table_type);
284
285
286
287 /**
288 * Cleanup_operation_instance
289 * <p>This procedure reverts the status of current operation
290 * instance whenever any processing exception occurs i.e. ,
291 * when user presses F2 or transaction manager errors
292 * out.</p>
293 *
294 * @param x_return_status Return Status
295 * @param x_msg_data REturns the Message Data
296 * @param x_msg_count Returns the Error Message
297 * @param x_error_code Returns appropriate error code in case of an error .
298 * @param p_source_task_id Identifier of the source document record
299 * @param p_activity_type_id Lookup code of the Activity type Id
300 **/
301 PROCEDURE Cleanup_Operation_Instance(
302 x_return_status OUT NOCOPY VARCHAR2,
303 x_msg_data OUT NOCOPY FND_NEW_MESSAGES.MESSAGE_TEXT%TYPE,
304 x_msg_count OUT NOCOPY NUMBER,
305 x_error_code OUT NOCOPY NUMBER,
306 p_source_task_id IN NUMBER,
307 p_activity_type_id IN NUMBER );
308
309 /**
310 * Cancel_operation_Plan
311 * <p>This procedure cancels the operation plan(s). It is called from control board</p>
312 *
313 * @param x_return_status Return Status
314 * @param x_msg_data Returns the Message Data
315 * @param x_msg_count Returns the Error Message
316 * @param x_error_code Returns appropriate error code in case of an error .
317 * @param p_source_task_id Identifier of the source document record
318 * @param p_activity_type_id Lookup code of the Activity type Id
319 **/
320 PROCEDURE Cancel_Operation_Plan(
321 x_return_status OUT NOCOPY VARCHAR2,
322 x_msg_data OUT NOCOPY FND_NEW_MESSAGES.MESSAGE_TEXT%TYPE,
323 x_msg_count OUT NOCOPY NUMBER,
324 x_error_code OUT NOCOPY NUMBER,
325 p_source_task_id IN NUMBER,
326 p_activity_type_id IN NUMBER,
327 p_retain_mmtt IN VARCHAR2 DEFAULT 'N',
328 p_mmtt_error_code IN VARCHAR2 DEFAULT NULL,
329 p_mmtt_error_explanation IN VARCHAR2 DEFAULT NULL
330 );
331
332
333 /**
334 * Abort_operation_Plan
335 * <p>This procedure aborts the operation plan(s). </p>
336 *
337 * @param x_return_status Return Status
338 * @param x_msg_data Returns the Message Data
339 * @param x_msg_count Returns the Error Message
340 * @param x_error_code Returns appropriate error code in case of an error .
341 * @param p_source_task_id Identifier of the source document record
342 * @param p_activity_type_id Lookup code of the Activity type Id
343 **/
344 PROCEDURE Abort_Operation_Plan(
345 x_return_status OUT NOCOPY VARCHAR2,
346 x_msg_data OUT NOCOPY FND_NEW_MESSAGES.MESSAGE_TEXT%TYPE,
347 x_msg_count OUT NOCOPY NUMBER,
348 x_error_code OUT NOCOPY NUMBER,
349 p_source_task_id IN NUMBER,
350 p_activity_type_id IN NUMBER,
351 p_for_manual_drop IN BOOLEAN DEFAULT FALSE
352 );
353
354 /**
355 * Rollback_operation_Plan
356 * <p>This procedure rollsback the operation plan. </p>
357 *
358 * @param x_return_status Return Status
359 * @param x_msg_data Returns the Message Data
360 * @param x_msg_count Returns the Error Message
361 * @param x_error_code Returns appropriate error code in case of an error .
362 * @param p_source_task_id Identifier of the source document record
363 * @param p_activity_type_id Lookup code of the Activity type Id
364 **/
365 PROCEDURE Rollback_Operation_Plan(
366 x_return_status OUT NOCOPY VARCHAR2,
367 x_msg_data OUT NOCOPY FND_NEW_MESSAGES.MESSAGE_TEXT%TYPE,
368 x_msg_count OUT NOCOPY NUMBER,
369 x_error_code OUT NOCOPY NUMBER,
370 p_source_task_id IN NUMBER,
371 p_activity_type_id IN NUMBER );
372
373 /**
374 * Check_Plan_Status
375 * <p>This procedure returns the operation plan instance
376 * status for a given source task ID and activity.</p>
377 * @param x_return_status Return Status
378 * @param x_msg_data Returns the Message Data
379 * @param x_msg_count Returns the Error Message
380 * @param x_error_code Returns appropriate error code in case of an error .
381 * @param x_plan_status Returns the Status of the Plan
382 * @param p_source_task_id Identifier of the source document record
383 * @param p_activity_type_id Lookup code of the Activity type Id
384 **/
385 PROCEDURE Check_Plan_Status(
386 x_return_status OUT NOCOPY VARCHAR2,
387 x_msg_data OUT NOCOPY FND_NEW_MESSAGES.MESSAGE_TEXT%TYPE,
388 x_msg_count OUT NOCOPY NUMBER,
389 x_error_code OUT NOCOPY NUMBER,
390 x_plan_status OUT NOCOPY NUMBER,
391 p_source_task_id IN NUMBER,
392 p_activity_type_id IN NUMBER );
393
394 END WMS_ATF_RUNTIME_PUB_APIS;