1 PACKAGE BOM_Validate_Rtg_Header AS
2 /* $Header: BOMLRTGS.pls 120.2 2006/05/23 04:55:13 bbpatel noship $*/
3 /*#
4 * This API performs Attribute and Entity level validations for Routing Header.
5 * Entity level validations include existence and accessibility check for Routing
6 * Header record. Attribute level validations include check for required attributes and
7 * business logic validations.
8 *
9 * @rep:scope private
10 * @rep:product BOM
11 * @rep:lifecycle active
12 * @rep:displayname Validate Routing Header
13 * @rep:compatibility S
14 * @rep:category BUSINESS_ENTITY BOM_MFG_ROUTING
15 */
16
17 /****************************************************************************
18 --
19 -- Copyright (c) 1996 Oracle Corporation, Redwood Shores, CA, USA
20 -- All rights reserved.
21 --
22 -- FILENAME
23 --
24 -- BOMLRTGS.pls
25 --
26 -- DESCRIPTION
27 --
28 -- Spec of package BOM_Validate_RTG_Header
29 --
30 -- NOTES
31 --
32 -- HISTORY
33 --
34 -- 07-AUG-00 Biao Zhang Initial Creation
35 --
36 ****************************************************************************/
37
38 /*#
39 * Procedure will query the routing header record and return it in old record variable.
40 * If the Transaction Type is Create and the record already exists the return status
41 * would be error. If the Transaction Type is Update or Delete and the record does not
42 * exist then the return status would be an error as well. Such an error in a record will
43 * cause all children to error out, since they are referencing an invalid parent.
44 * Mesg_Token_Table will carry the error messsage and the tokens associated with the message.
45 *
46 * @param p_rtg_header_rec IN Routing Header Exposed Record
47 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Rec_Type }
48 * @param p_rtg_header_unexp_rec IN Routing Header Unexposed Record
49 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Unexposed_Rec_Type}
50 * @param x_old_rtg_header_rec IN OUT NOCOPY Routing Header Exposed Record if already exists
51 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Rec_Type }
52 * @param x_old_rtg_header_unexp_rec IN OUT NOCOPY Routing Header Unexposed Record if already exists
53 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Unexposed_Rec_Type}
54 * @param x_mesg_token_tbl IN OUT NOCOPY Message Token Table
55 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
56 * @param x_return_status IN OUT NOCOPY Return Status
57 *
58 * @rep:scope private
59 * @rep:lifecycle active
60 * @rep:displayname Check Existence for Routing Header record
61 * @rep:compatibility S
62 * @rep:category BUSINESS_ENTITY BOM_MFG_ROUTING
63 */
64 PROCEDURE Check_Existence
65 ( p_rtg_header_rec IN Bom_Rtg_Pub.Rtg_header_Rec_Type
66 , p_rtg_header_unexp_rec IN Bom_Rtg_Pub.Rtg_header_Unexposed_Rec_Type
67 , x_old_rtg_header_rec IN OUT NOCOPY Bom_Rtg_Pub.Rtg_header_Rec_Type
68 , x_old_rtg_header_unexp_rec IN OUT NOCOPY Bom_Rtg_Pub.Rtg_header_Unexposed_Rec_Type
69 , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
70 , x_return_status IN OUT NOCOPY VARCHAR2
71 );
72
73 /*#
74 * This procedure checks for the access rights of the user on the item for which an operation is performed
75 * on routing. An assembly item and any of its child entities can not be operated upon if the user
76 * does not have access to the assembly item type. This procedure compares assembly item's
77 * BOM_Item_Type against the assembly item access fields in the profile system values.
78 *
79 * @param p_assembly_item_name IN Assembly Item Name
80 * @param p_assembly_item_id IN Assembly Item Id
81 * @param p_alternate_rtg_code IN Alternate Routing Code
82 * @param p_organization_id IN Organization Id in which item is defined
83 * @param p_mesg_token_tbl IN Message Token Table
84 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
85 * @param x_mesg_token_tbl IN OUT NOCOPY Message Token Table
86 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
87 * @param x_return_status IN OUT NOCOPY Return Status
88 *
89 * @rep:scope private
90 * @rep:lifecycle active
91 * @rep:displayname Check Access for Assembly Item
92 * @rep:compatibility S
93 * @rep:category BUSINESS_ENTITY BOM_MFG_ROUTING
94 */
95 PROCEDURE Check_Access
96 ( p_assembly_item_name IN VARCHAR2
97 , p_assembly_item_id IN NUMBER
98 , p_alternate_rtg_code IN VARCHAR2
99 , p_organization_id IN NUMBER
100 , p_mesg_token_tbl IN Error_Handler.Mesg_Token_Tbl_Type
101 , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
102 , x_return_status IN OUT NOCOPY VARCHAR2
103 );
104
105
106 /*#
107 * This procedure checks the flow routing operability depending on CFM_Routing_Flag value.
108 * Valid CFM_Routing_Flag values are null, 1, 2, 3. For value 1, Flow Manufacturing should be
109 * installed. For value 3, organization should be WSM enabled. For EAM Item Type=2, CFM_Routing_Flag value
110 * should be equal to 2. For Lot based routing, check if organization is EAM enabled.
111 * Finally set CFM Routing Flag to System Info Record.
112 *
113 * @param p_assembly_item_name IN Assembly Item Name
114 * @param p_cfm_routing_flag IN CFM Routing Flag
115 * @param p_organization_code IN Organization Code in which item is defined
116 * @param p_organization_id IN Organization Id in which item is defined
117 * @param x_mesg_token_tbl IN OUT NOCOPY Message Token Table
118 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
119 * @param x_return_status IN OUT NOCOPY Return Status
120 *
121 * @rep:scope private
122 * @rep:lifecycle active
123 * @rep:displayname Check validity of Flow Routing Operability
124 * @rep:compatibility S
125 * @rep:category BUSINESS_ENTITY BOM_MFG_ROUTING
126 */
127 PROCEDURE Check_flow_routing_operability
128 ( p_assembly_item_name IN VARCHAR2
129 , p_cfm_routing_flag IN NUMBER
130 , p_organization_code IN VARCHAR2
131 , p_organization_id IN NUMBER
132 , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
133 , x_return_status IN OUT NOCOPY VARCHAR2
134 );
135
136
137 /*#
138 * This procedure checks the attributes validity. Validations include check for
139 * Eng_Rtg, Mixed_Model_Map, CTP and CFM_Routing Flag.
140 *
141 * @param x_return_status IN OUT NOCOPY Return Status
142 * @param x_mesg_token_tbl IN OUT NOCOPY Message Token Table
143 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
144 * @param p_rtg_header_rec IN Routing Header Exposed Record
145 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Rec_Type }
146 * @param p_rtg_header_unexp_rec IN Routing Header Unexposed Record
147 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Unexposed_Rec_Type}
148 * @param p_old_rtg_header_rec IN Existing Routing Header Exposed Record
149 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Rec_Type }
150 * @param p_old_rtg_header_unexp_rec IN Existing Routing Header Unexposed Record
151 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Unexposed_Rec_Type}
152 *
153 * @rep:scope private
154 * @rep:lifecycle active
155 * @rep:displayname Check Routing Header attributes
156 * @rep:compatibility S
157 * @rep:category BUSINESS_ENTITY BOM_MFG_ROUTING
158 */
159 PROCEDURE Check_Attributes
160 ( x_return_status IN OUT NOCOPY VARCHAR2
161 , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
162 , p_rtg_header_Rec IN Bom_Rtg_Pub.Rtg_header_Rec_Type
163 , p_rtg_header_unexp_rec IN Bom_Rtg_Pub.Rtg_header_Unexposed_Rec_Type
164 , p_old_rtg_header_rec IN Bom_Rtg_Pub.Rtg_header_Rec_Type
165 , p_old_rtg_header_unexp_rec IN Bom_Rtg_Pub.Rtg_header_Unexposed_Rec_Type
166 );
167
168 /*#
169 * Procedure to check the required attributes for the Routing Header record.
170 * Some fields are required for an operation to be performed. The user must enter values
171 * for these fields.
172 * This procedure checks whether the required field columns are not NULL. It raises
173 * 1 Severe Error IV for if the Transaction Type is Create
174 * 2 Standard Error for other Transaction Types.
175 *
176 * @param x_return_status IN OUT NOCOPY Return Status
177 * @param x_mesg_token_tbl IN OUT NOCOPY Message Token Table
178 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
179 * @param p_rtg_header_rec IN Routing Header Exposed Record
180 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Rec_Type }
181 * @param p_rtg_header_unexp_rec IN Routing Header Unexposed Record
182 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Unexposed_Rec_Type}
183 *
184 * @rep:scope private
185 * @rep:lifecycle active
186 * @rep:displayname Check Routing Header required attributes
187 * @rep:compatibility S
188 * @rep:category BUSINESS_ENTITY BOM_MFG_ROUTING
189 */
190 PROCEDURE Check_Required
191 ( x_return_status IN OUT NOCOPY VARCHAR2
192 , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
193 , p_rtg_header_Rec IN Bom_Rtg_Pub.Rtg_header_Rec_Type
194 , p_rtg_header_unexp_rec IN Bom_Rtg_Pub.rtg_header_Unexposed_Rec_Type
195 );
196 /*
197 PROCEDURE Check_Entity
198 ( p_rtg_header_rec IN Bom_Rtg_Pub.Rtg_header_Rec_Type
199 , p_rtg_header_unexp_rec IN Bom_Rtg_Pub.Rtg_header_Unexposed_Rec_Type
200 , p_old_rtg_header_rec IN Bom_Rtg_Pub.Rtg_header_Rec_Type
201 , p_old_rtg_header_unexp_rec IN Bom_Rtg_Pub.Rtg_header_Unexposed_Rec_Type
202 , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
203 , x_return_status IN OUT NOCOPY VARCHAR2
204 );
205 */
206 /*#
207 * Procedure to validate the Routing Header entity record.
208 * The following are checked.
209 * Non-updateable columns (UPDATEs): Certain columns must not be changed by the user when updating the record
210 * Cross-attribute checking: The validity of attributes may be checked, based on factors external to it
211 * Business logic: The record must comply with business logic rules.
212 *
213 * @param p_rtg_header_rec IN Routing Header Exposed Record
214 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Rec_Type }
215 * @param p_rtg_header_unexp_rec IN Routing Header Unexposed Record
216 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Unexposed_Rec_Type}
217 * @param p_old_rtg_header_rec IN Existing Routing Header Exposed Record
218 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Rec_Type }
219 * @param p_old_rtg_header_unexp_rec IN Existing Routing Header Unexposed Record
220 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Unexposed_Rec_Type}
221 * @param x_mesg_token_tbl IN OUT NOCOPY output Message Token Table with proper error or warning messages
222 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
223 * @param x_return_status IN OUT NOCOPY Return Status
224 *
225 * @rep:scope private
226 * @rep:lifecycle active
227 * @rep:displayname Check Routing Header entity
228 * @rep:compatibility S
229 * @rep:category BUSINESS_ENTITY BOM_MFG_ROUTING
230 */
231 PROCEDURE Check_Entity
232 ( p_rtg_header_rec IN OUT NOCOPY Bom_Rtg_Pub.rtg_header_Rec_Type
233 , p_rtg_header_unexp_rec IN OUT NOCOPY Bom_Rtg_Pub.rtg_header_Unexposed_Rec_Type
234 , p_old_rtg_header_rec IN Bom_Rtg_Pub.rtg_header_Rec_Type
235 , p_old_rtg_header_unexp_rec IN Bom_Rtg_Pub.rtg_header_Unexposed_Rec_Type
236 , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
237 , x_return_status IN OUT NOCOPY VARCHAR2
238 );
239
240
241 /*#
242 * This procedure checks the validity of the delete group for the Routing Header Record in case of
243 * Transaction Type as Delete. Check for delete group include valid delete group, new or duplicate
244 * delete group. This procedure will be called before adding a Routing Header entity to a delete group.
245 *
246 * @param x_return_status IN OUT NOCOPY Return Status
247 * @param x_mesg_token_tbl IN OUT NOCOPY output Message Token Table with proper error or warning messages
248 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
249 * @param p_rtg_header_rec IN Routing Header Exposed Record
250 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Rec_Type }
251 * @param p_rtg_header_unexp_rec IN Routing Header Unexposed Record
252 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Unexposed_Rec_Type}
253 * @param x_rtg_header_unexp_rec IN OUT NOCOPY Unexposed Routing Header record after updating delete groups
254 * related attributes
255 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_header_Unexposed_Rec_Type }
256 *
257 * @rep:scope private
258 * @rep:lifecycle active
259 * @rep:displayname Check Routing Header Delete entity
260 * @rep:compatibility S
261 * @rep:category BUSINESS_ENTITY BOM_MFG_ROUTING
262 */
263 PROCEDURE Check_Entity_Delete
264 ( x_return_status IN OUT NOCOPY VARCHAR2
265 , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
266 , p_rtg_header_rec IN Bom_Rtg_Pub.Rtg_header_Rec_Type
267 , p_rtg_header_Unexp_Rec IN Bom_Rtg_Pub.Rtg_header_Unexposed_Rec_Type
268 , x_rtg_header_unexp_rec IN OUT NOCOPY Bom_Rtg_Pub.Rtg_header_Unexposed_Rec_Type
269 );
270
271
272 /*#
273 * This procedure will take the organization, sub-inventory, item level control
274 * values and the number specifying if the Locator is controlled at the
275 * org, sub-inventory or item level. It will also decide
276 * if the locator is pre-specified or dynamic.
277 *
278 * @param org_control IN Organization Level Control
279 * @param sub_control IN Sub-inventory Level Control
280 * @param item_control IN Item Level Control
281 *
282 * @return Locator Control
283 * @rep:scope private
284 * @rep:lifecycle active
285 * @rep:displayname Get the Locator Control
286 * @rep:compatibility S
287 * @rep:category BUSINESS_ENTITY BOM_MFG_ROUTING
288 */
289 FUNCTION CONTROL(org_control IN number,
290 sub_control IN number,
291 item_control IN number default NULL)
292 RETURN NUMBER ;
293
294 /*#
295 * Procedure to check Serialization Starting Operation Sequence(SSOS) Number.
296 *
297 * @param p_rtg_header_rec IN Routing Header Exposed Record
298 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Rec_Type }
299 * @param p_rtg_header_unexp_rec IN Routing Header Unexposed Record
300 * @paraminfo {@rep:innertype Bom_Rtg_Pub.Rtg_Header_Unexposed_Rec_Type}
301 * @param x_mesg_token_tbl IN OUT NOCOPY output Message Token Table with proper error or warning messages
302 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
303 * @param x_return_status IN OUT NOCOPY Return Status
304 *
305 * @rep:scope private
306 * @rep:lifecycle active
307 * @rep:displayname Check SSOS
308 * @rep:compatibility S
309 * @rep:category BUSINESS_ENTITY BOM_MFG_ROUTING
310 */
311 PROCEDURE Check_SSOS -- Added for SSOS (bug 2689249)
312 ( p_rtg_header_rec IN Bom_Rtg_Pub.rtg_header_Rec_Type
313 , p_rtg_header_unexp_rec IN Bom_Rtg_Pub.rtg_header_Unexposed_Rec_Type
314 , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
315 , x_return_status IN OUT NOCOPY VARCHAR2
316 );
317
318 /*#
319 * Procedure to check that OSFM routings should not get created for non-lot controlled item.
320 *
321 * @param p_assembly_item_id IN Assembly Item Id
322 * @param p_organization_id IN Organization Id in which item is defined
323 * @param x_mesg_token_tbl IN OUT NOCOPY Message Token Table
324 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
325 * @param x_return_status IN OUT NOCOPY Return Status
326 *
327 * @rep:scope private
328 * @rep:lifecycle active
329 * @rep:displayname Check for OSFM Routing for Non-lot controlled item
330 * @rep:compatibility S
331 * @rep:category BUSINESS_ENTITY BOM_MFG_ROUTING
332 */
333 PROCEDURE Check_lot_controlled_item
334 ( p_assembly_item_id IN NUMBER
335 , p_organization_id IN NUMBER
336 , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
337 , x_return_status IN OUT NOCOPY VARCHAR2
338 );
339
340 /*#
341 * Procedure to validate that Serialization Start Operation Sequence number is
342 * entered for serial controlled item and it is present on the primary path.
343 *
344 * @param p_routing_sequence_id Routing Sequence Id
345 * @param p_ser_start_op_seq Serialization Start Operation Sequence Number
346 * @param p_validate_from_table Validate Serialization Start Operation Sequence Number
347 * from table or input parameter
348 * @param x_mesg_token_tbl Message Token Table
349 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
350 * @param x_return_status Return Status
351 *
352 * @rep:scope private
353 * @rep:lifecycle active
354 * @rep:displayname Validate Serialization Start Operation Sequence number
355 * @rep:compatibility S
356 * @rep:category BUSINESS_ENTITY BOM_MFG_ROUTING
357 */
358 PROCEDURE Validate_SSOS
359 ( p_routing_sequence_id IN NUMBER
360 , p_ser_start_op_seq IN NUMBER
361 , p_validate_from_table IN BOOLEAN
362 , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
363 , x_return_status IN OUT NOCOPY VARCHAR2
364 );
365
366 END Bom_Validate_Rtg_Header;