DBA Data[Home] [Help]

PACKAGE: APPS.CTO_WORKFLOW_API_PK

Source


1 package CTO_WORKFLOW_API_PK AUTHID CURRENT_USER as
2 /* $Header: CTOWFAPS.pls 120.3 2005/06/30 09:26:45 rekannan noship $ */
3 /*============================================================================+
4 |  Copyright (c) 1993 Oracle Corporation    Belmont, California, USA          |
5 |                        All rights reserved.                                 |
6 |                        Oracle Manufacturing                                 |
7 +=============================================================================+
8 |                                                                             |
9 | FILE NAME   : CTOWFAPS.pls
10 |                                                                             |
11 | DESCRIPTION:                                                                |
12 |               Contain all CTO and WF related APIs.
13 |               One API is used to check if a configured item (model)         |
14 |               is created. This API is applied by the Processing Constraints |
15 |               Framework provided by OE                                      |
16 |                                                                             |
17 |                                                                             |
18 | HISTORY     :                                                               |
19 |               Aug 16, 99   James Chiu   Initial version                     |
20 |               Sep 20, 01   Ravi         Added one new procedure for         |
21 |                                         Autocreate Req                      |
22 |
23 |
24 |		June 16,2005 Kiran Konada
25 |				modified cur_var_type record to include
26 |				secondary reservation  qty
27 |               June 27, 2005 Renga Kannan
28 |                             Modified by Renga Kannan for Cross Docking project
29 |
30 =============================================================================*/
31 
32 G_ITEM_TYPE_NAME              CONSTANT VARCHAR2(30):='OEOL';
33 
34 
35 /**************************************************************************
36 
37    Procedure:   query_wf_activity_status
38    Parameters:  p_itemtype                -
39                 p_itemkey                 -
40                 p_activity_label          -           "
41                 p_activity_name           -           "
42                 p_activity_status         -
43    Description: this procedure is used to query a Workflow activity status
44 
45 *****************************************************************************/
46 
47 PROCEDURE query_wf_activity_status(
48         p_itemtype        IN      VARCHAR2,
49         p_itemkey         IN      VARCHAR2,
50         p_activity_label  IN      VARCHAR2,
51         p_activity_name   IN      VARCHAR2,
52         p_activity_status OUT NOCOPY    VARCHAR2
53         );
54 
55 /**************************************************************************
56 
57    Procedure:   get_activity_status
58    Parameters:  itemtype                -
59                 itemkey                 -
60                 linetype                -           "
61                 activity_name           -           "
62    Description: this procedure is used by Match and Reserve to check if an
63                 instance of WF process resides at a desired block activity.
64 
65 *****************************************************************************/
66 
67 PROCEDURE get_activity_status(
68         itemtype        IN      VARCHAR2,
69         itemkey         IN      VARCHAR2,
70         linetype        IN      VARCHAR2,
71         activity_name   OUT NOCOPY    VARCHAR2
72         );
73 
74 /**************************************************************************
75 
76    Function:   complete_activity
77    Parameters:  p_itemtype                -
78                 p_itemkey                 -
79                 p_activity_name           -           "
80                 p_result_code             -           "
81    Description: this function is used to complete an WF activity
82 
83 *****************************************************************************/
84 
85 FUNCTION complete_activity(
86         p_itemtype        IN      VARCHAR2,
87         p_itemkey         IN      VARCHAR2,
88         p_activity_name   IN      VARCHAR2,
89         p_result_code     IN      VARCHAR2
90         )
91 return BOOLEAN;
92 
93 /**************************************************************************
94 	Function:    display_wf_status
95 	Parameters:  p_order_line_id
96 	Description: this function is used to display a proper wf status from
97 				 OM form. The status can be production open, production
98      			 partial, and production complete.
99 
100 ***************************************************************************/
101 
102 FUNCTION display_wf_status(
103 		 p_order_line_id  IN      NUMBER
104     	 )
105 return INTEGER;
106 
107 
108 /**************************************************************************
109 
110    Procedure:   configuration_item_created
111    Parameters:	p_application_id              (standard signature format)
112 		p_entity_short_name
113 		p_validation_entity_short_name
114 		p_validation_tmplt_short_name
115 		p_record_set_short_name
116 		p_scope
117 		x_result
118    Description: This API with standard signature format is used to check is
119                 a configured item is created. This condition is applied to
120                 an option line.
121 
122 *****************************************************************************/
123 
124 PROCEDURE configuration_item_created(
125 	p_application_id	IN	NUMBER,
126 	p_entity_short_name	IN	VARCHAR2,
127 	p_validation_entity_short_name	IN	VARCHAR2,
128 	p_validation_tmplt_short_name	IN	VARCHAR2,
129 	p_record_set_short_name	IN VARCHAR2,
130 	p_scope			IN VARCHAR2,
131 	x_result		OUT NOCOPY NUMBER
132 	);
133 
134 PROCEDURE configuration_created (
135         p_application_id        IN      NUMBER,
136         p_entity_short_name     IN      VARCHAR2,
137         p_validation_entity_short_name  IN      VARCHAR2,
138         p_validation_tmplt_short_name   IN      VARCHAR2,
139         p_record_set_short_name IN VARCHAR2,
140         p_scope                 IN VARCHAR2,
141         x_result                OUT NOCOPY NUMBER
142         );
143 
144 /*************************************************************************
145    Procedure:   inventory_reservation_check
146    Parameters:  p_order_line_id
147                 x_return_status         - standard API output parameter
148                 x_msg_count             -           "
149                 x_msg_data              -           "
150 
151    Description: Check if an order line status is either
152                 "CREATE_CONFIG_BOM_ELIGIBLE" or
153                 "CREATE_SUPPLY_ORDER_ELIGIBLE"
154 *****************************************************************************/
155 PROCEDURE inventory_reservation_check(
156         p_order_line_id   IN      NUMBER,
157         x_return_status OUT  NOCOPY   VARCHAR2,
158         x_msg_count     OUT  NOCOPY   NUMBER,
159         x_msg_data      OUT  NOCOPY   VARCHAR2
160         );
161 
162 /*************************************************************************
163    Procedure:   workflow_update_after_invent_reserv
164    Parameters:  p_order_line_id
165                 x_return_status         - standard API output parameter
166                 x_msg_count             -           "
167                 x_msg_data              -           "
168 
169    Description: update an order line status after inventory reservation
170 *****************************************************************************/
171 PROCEDURE wf_update_after_inv_reserv(
172         p_order_line_id   IN      NUMBER,
173         x_return_status OUT NOCOPY    VARCHAR2,
174         x_msg_count     OUT NOCOPY    NUMBER,
175         x_msg_data      OUT NOCOPY    VARCHAR2
176         );
177 
178 /*************************************************************************
179    - bugfix 2001824:  Added new parameter : p_rsv_quantity (unreserv qty)
180 
181    Procedure:   inventory_unreservation_check
182    Parameters:  p_order_line_id
183 	        p_rsv_quantity          - Unreservation Quantity
184 	        x_return_status         - standard API output parameter
185 		x_msg_count             -           "
186 		x_msg_data              -           "
187 
188    Description: Check if an order line status is
189     			 "SHIP_LINE"
190 *****************************************************************************/
191 PROCEDURE inventory_unreservation_check(
192 		p_order_line_id   IN      NUMBER,
193 		p_rsv_quantity    IN      NUMBER  default NULL,		--bugfix 2001824
194 		x_return_status   OUT NOCOPY    VARCHAR2,
195 		x_msg_count       OUT NOCOPY    NUMBER,
196 		x_msg_data        OUT NOCOPY    VARCHAR2
197 		);
198 
199 /*************************************************************************
200    Procedure:   wf_update_after_inv_unreserv
201    Parameters:  p_order_line_id
202 				x_return_status         - standard API output parameter
203 				x_msg_count             -           "
204 				x_msg_data              -           "
205 
206    Description: update an order line status after inventory unreservation
207 *****************************************************************************/
208 PROCEDURE wf_update_after_inv_unreserv(
209 		p_order_line_id   IN      NUMBER,
210 		x_return_status OUT NOCOPY    VARCHAR2,
211 		x_msg_count     OUT NOCOPY    NUMBER,
212 		x_msg_data      OUT NOCOPY    VARCHAR2
213 		);
214 
215 /*************************************************************************
216    Procedure:   start_model_workflow
217    Parameters:  p_model_line_id - top model line id from oe_order_lines_all
218    Returns:     TRUE - if the ATO model workflow was started successfully;
219                 FALSE - if ATO model workflow was not started
220    Description: update an order line status after inventory unreservation
221 *****************************************************************************/
222 function start_model_workflow(
223                 p_model_line_id IN NUMBER
224                 )
225 return boolean;
226 
227 PROCEDURE Update_Config_Line(
228 	p_application_id	IN	NUMBER,
229 	p_entity_short_name	IN	VARCHAR2,
230 	p_validation_entity_short_name	IN	VARCHAR2,
231 	p_validation_tmplt_short_name	IN	VARCHAR2,
232 	p_record_set_short_name	IN VARCHAR2,
233 	p_scope			IN VARCHAR2,
234 	x_result		OUT NOCOPY NUMBER );
235 
236 PROCEDURE Configuration_Created_For_Pto (
237 	p_application_id	IN	NUMBER,
238 	p_entity_short_name	IN	VARCHAR2,
239 	p_validation_entity_short_name	IN	VARCHAR2,
240 	p_validation_tmplt_short_name	IN	VARCHAR2,
241 	p_record_set_short_name	IN VARCHAR2,
242 	p_scope			IN VARCHAR2,
243 	x_result		OUT NOCOPY NUMBER );
244 
245 PROCEDURE Top_Ato_Model(
246 	p_application_id	IN	NUMBER,
247 	p_entity_short_name	IN	VARCHAR2,
248 	p_validation_entity_short_name	IN	VARCHAR2,
249 	p_validation_tmplt_short_name	IN	VARCHAR2,
250 	p_record_set_short_name	IN VARCHAR2,
251 	p_scope			IN VARCHAR2,
252 	x_result		OUT NOCOPY NUMBER );
253 
254 PROCEDURE Config_Line(
255 	p_application_id	IN	NUMBER,
256 	p_entity_short_name	IN	VARCHAR2,
257 	p_validation_entity_short_name	IN	VARCHAR2,
258 	p_validation_tmplt_short_name	IN	VARCHAR2,
259 	p_record_set_short_name	IN VARCHAR2,
260 	p_scope			IN VARCHAR2,
261 	x_result		OUT NOCOPY NUMBER );
262 
263 PROCEDURE change_status_batch (
264     p_header_id             NUMBER,
265     p_line_id               NUMBER,
266     p_change_status         VARCHAR2,
267     p_oe_org_id             NUMBER,
268 	x_return_status OUT NOCOPY    VARCHAR2);
269 
270 /**************************************************************************
271    Procedure:   auto_create_pur_req
272    Parameters:  p_itemtype                -
273                 p_itemkey                 -
274                 p_activity_label          -           "
275                 p_activity_name           -           "
276                 p_activity_status         -
277    Description: This procedure is called from the AutoCreate Purchase Req program.
278                 This procedure will insert record into the req-imoprt table for the given sales order line.
279 *****************************************************************************/
280 PROCEDURE auto_create_pur_req(
281             p_itemtype        IN      VARCHAR2, /* internal name for item type */
282             p_itemkey         IN      VARCHAR2, /* sales order line id  */
283             p_actid           IN      NUMBER,   /* ID number of WF activity  */
284             p_funcmode        IN      VARCHAR2, /* execution mode of WF act  */
285             x_result          OUT  NOCOPY   VARCHAR2   /* result of activity */
286             );
287 
288 
289 /**************************************************************************
290 
291    Procedure:   chk_Buy_Ato_Item  -- change the desc later
292    Parameters:  p_application_id              (standard signature format)
293                 p_entity_short_name
294                 p_validation_entity_short_name
295                 p_validation_tmplt_short_name
296                 p_record_set_short_name
297                 p_scope
298                 x_result
299    Description: This API with standard signature format is called from
300                 the security constraints to validate whether a change is
301                 allowed on an order line.
302                 This API gets called for every item type.
303 
304 *****************************************************************************/
305 PROCEDURE chk_Buy_Ato_Item(
306         p_application_id        IN      NUMBER,
307         p_entity_short_name     IN      VARCHAR2,
308         p_validation_entity_short_name  IN      VARCHAR2,
309         p_validation_tmplt_short_name   IN      VARCHAR2,
310         p_record_set_short_name IN VARCHAR2,
311         p_scope                 IN VARCHAR2,
312         x_result                OUT NOCOPY NUMBER );
313 
314 
315 
316 PROCEDURE Reservation_Exists(
317         p_application_id        IN      NUMBER,
318         p_entity_short_name     IN      VARCHAR2,
319         p_validation_entity_short_name  IN      VARCHAR2,
320         p_validation_tmplt_short_name   IN      VARCHAR2,
321         p_record_set_short_name IN VARCHAR2,
322         p_scope                 IN VARCHAR2,
323         x_result                OUT NOCOPY NUMBER
324         );
325 
326 END CTO_WORKFLOW_API_PK;