1 PACKAGE BOM_Validate_Bom_Header AS
2 /* $Header: BOMLBOMS.pls 120.0 2005/05/25 05:04:49 appldev noship $ */
3 /*#
4 * This API performs Attribute and Entity level validation for the Bill of Materials header.
5 * This contains methods for
6 * Checking the existence of the header record in case of create,update or delete.
7 * Checking the acces rights of the user to the Assmbly Item's BOM Item Type.
8 * Checking the validity of all Header Attributes
9 * Checking the required fields in the BOM Header.
10 * Checking the Business Logic validation for the BOM Header Entity.
11 * Checking the Delete Constraints for BOM Header
12 * @rep:scope private
13 * @rep:product BOM
14 * @rep:lifecycle active
15 * @rep:displayname Validate Header
16 * @rep:compatibility S
17 */
18
19 /****************************************************************************
20 --
21 -- Copyright (c) 1996 Oracle Corporation, Redwood Shores, CA, USA
22 -- All rights reserved.
23 --
24 -- FILENAME
25 --
26 -- BOMLBOMS.pls
27 --
28 -- DESCRIPTION
29 --
30 -- Spec of package BOM_Validate_Bom_Header
31 --
32 -- NOTES
33 --
34 -- HISTORY
35 --
36 -- 01-JUL-99 Rahul Chitko Initial Creation
37 --
38 ****************************************************************************/
39
40 /*#
41 * This method checks for the existence of the record based on the transaction type.
42 * The record being updated or deleted in the database must already exist.
43 * But a record being created must not. Such an error in a record must cause all children
44 * to error out, since they are referencing an invalid parent.This raises a Severe Error III.
45 * It also queries up the database record into the corresponding Old Record.
46 * @param p_bom_header_rec IN BOM Header Exposed Column Record
47 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Rec_Type}
48 * @param p_bom_head_unexp_rec IN BOM Header Unexposed Column Record
49 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type
50 * @param x_old_bom_header_rec IN OUT NOCOPY queried BOM Header Old Record Exposed Column Record.
51 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Rec_Type}
52 * @param x_old_bom_head_unexp_rec IN OUT NOCOPY queried BOM Header Old Record Unexposed Column Record.
53 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_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 * @rep:scope private
58 * @rep:displayname Check Header Existence
59 * @rep:compatibility S
60 * @rep:lifecycle active
61 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
62 */
63 PROCEDURE Check_Existence
64 ( p_bom_header_rec IN Bom_Bo_Pub.Bom_Head_Rec_Type
65 , p_bom_head_unexp_rec IN Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type
66 , x_old_bom_header_rec IN OUT NOCOPY Bom_Bo_Pub.Bom_Head_Rec_Type
67 , x_old_bom_head_unexp_rec IN OUT NOCOPY Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type
68 , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
69 , x_return_status IN OUT NOCOPY VARCHAR2
70 );
71
72 /*#
73 * This method checks for the access rights of the user.An assembly item and any of its
74 * components cannot be operated upon if the user does not have access to the assembly item type.
75 * The user should have proper access to
76 * the Assembly Item's BOM Item Type.It Compare assembly item BOM_Item_Type against the
77 * assembly item access fields in the System_Information record.If the check fails either
78 * Fatal Error III or Fatal Error II is raised depending on the affected entity.
79 * @param p_assembly_item_id IN Assembly Item Id of the item.
80 * @param p_alternate_bom_code IN Alternate Bom Code if the bill is an alternate bill
81 * @param p_organization_id IN Organiation Id for the item.
82 * @param p_mesg_token_tbl IN Message Token Table
83 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
84 * @param x_mesg_token_tbl IN OUT NOCOPY output Message Token Table
85 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
86 * @param x_return_status IN OUT NOCOPY Return Status
87 * @rep:scope private
88 * @rep:displayname Check Header Access
89 * @rep:compatibility S
90 * @rep:lifecycle active
91 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
92 */
93 PROCEDURE Check_Access
94 ( p_assembly_item_id IN NUMBER
95 , p_alternate_bom_code IN VARCHAR2
96 , p_organization_id IN NUMBER
97 , p_mesg_token_tbl IN Error_Handler.Mesg_Token_Tbl_Type
98 := Error_Handler.G_MISS_MESG_TOKEN_TBL
99 , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
100 , x_return_status IN OUT NOCOPY VARCHAR2
101 );
102
103 /*#
104 * This method checks for Each of the attributes/fields individually for validity
105 * Examples of these checks are: range checks, checks against lookups etc.It checks
106 * whether user-entered attributes are valid and it checks each attribute independently of the others
107 * @param x_return_status IN OUT NOCOPY Return Status
108 * @param x_Mesg_Token_Tbl IN OUT NOCOPY output Message Token Table with proper error or warning messages
109 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
110 * @param p_bom_header_Rec IN BOM Header Exposed Column Record
111 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Rec_Type}
112 * @param p_bom_head_unexp_rec IN BOM Header Unexposed Column Record
113 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type
114 * @param p_old_bom_header_rec IN BOM Header Old Record Exposed Column Record
115 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Rec_Type}
116 * @param p_old_bom_head_unexp_rec IN BOM Header Old Record Unexposed Column Record
117 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type}
118 * @rep:scope private
119 * @rep:displayname Check Header Attributes
120 * @rep:compatibility S
121 * @rep:lifecycle active
122 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
123 */
124
125 PROCEDURE Check_Attributes
126 ( x_return_status IN OUT NOCOPY VARCHAR2
127 , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
128 , p_bom_header_Rec IN Bom_Bo_Pub.Bom_Head_Rec_Type
129 , p_bom_head_unexp_rec IN Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type
130 , p_old_bom_header_rec IN Bom_Bo_Pub.Bom_Head_Rec_Type
131 , p_old_bom_head_unexp_rec IN Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type
132 );
133
134 /*#
135 * This method does the required fields checking for the BOM Header Record.
136 * Some fields are required for an operation to be performed. Without them,
137 * the operation cannot go through. The user must enter values for these fields.
138 * This procedure checks whether the required field columns are not NULL.It raises
139 * 1 Severe Error IV for create transaction type
140 * 2 Standard Error for other transaction types.
141 * @param x_return_status IN OUT NOCOPY Return Status
142 * @param x_Mesg_Token_Tbl IN OUT NOCOPY output Message Token Table with proper error or warning messages
143 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
144 * @param p_bom_header_Rec IN BOM Header Exposed Column Record
145 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Rec_Type}
146 * @rep:scope private
147 * @rep:displayname Check Header Required Fields
148 * @rep:compatibility S
149 * @rep:lifecycle active
150 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
151 */
152 PROCEDURE Check_Required
153 ( x_return_status IN OUT NOCOPY VARCHAR2
154 , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
155 , p_bom_header_Rec IN Bom_Bo_Pub.Bom_Head_Rec_Type
156 );
157 /*#
158 * This is where the whole record is checked. The following are checked
159 * Non-updateable columns (UPDATEs): Certain columns must not be changed by the user when updating the record
160 * Cross-attribute checking: The validity of attributes may be checked, based on factors external to it
161 * Business logic: The record must comply with business logic rules.
162 * It raises
163 * 1 Severe Error IV for Create transaction type.
164 * 2 Standard Error for Update transaction type.
165 * @param p_bom_header_Rec IN BOM Header Exposed Column Record
166 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Rec_Type}
167 * @param p_bom_head_unexp_rec IN BOM Header Unexposed Column Record
168 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type}
169 * @param p_old_bom_head_rec IN BOM Header Old Record Exposed Column Record
170 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Rec_Type}
171 * @param p_old_bom_head_unexp_rec IN BOM Header Old Record Unexposed Column Record
172 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type}
173 * @param x_mesg_token_tbl IN OUT NOCOPY output Message Token Table with proper error or warning messages
174 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
175 * @param x_return_status IN OUT NOCOPY Return Status
176 * @rep:scope private
177 * @rep:displayname Check Header Entity
178 * @rep:compatibility S
179 * @rep:lifecycle active
180 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
181 */
182 PROCEDURE Check_Entity
183 ( p_bom_header_rec IN Bom_Bo_Pub.Bom_Head_Rec_Type
184 , p_bom_head_unexp_rec IN Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type
185 , p_old_bom_head_rec IN Bom_Bo_Pub.Bom_Head_Rec_Type
186 , p_old_bom_head_unexp_rec IN Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type
187 , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
188 , x_return_status IN OUT NOCOPY VARCHAR2
189 );
190
191 /*#
192 * This method checks for the validity of the delete group entity in the BOM Header Record
193 * This checks whether the delete group is valid,whether it is a duplicate delete group and also
194 * whether the delete group is a newly created one.This procedure will be called before submitting
195 * entities in a delete group for deletion.
196 * @param x_return_status IN OUT NOCOPY Return Status
197 * @param x_Mesg_Token_Tbl IN OUT NOCOPY output Message Token Table with proper error or warning messages
198 * @paraminfo {@rep:innertype Error_Handler.Mesg_Token_Tbl_Type}
199 * @param p_bom_header_Rec IN BOM Header Exposed Column Record
200 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Rec_Type}
201 * @param p_bom_head_unexp_rec IN BOM Header Unexposed Column Record
202 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type}
203 * @param x_bom_head_unexp_rec IN OUT NOCOPY processed BOM Header Unexposed Column Record
204 * @paraminfo {@rep:innertype Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type}
205 * @rep:scope private
206 * @rep:displayname Check Header Delete Entity
207 * @rep:compatibility S
208 * @rep:lifecycle active
209 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
210 */
211 PROCEDURE Check_Entity_Delete
212 ( x_return_status IN OUT NOCOPY VARCHAR2
213 , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
214 , p_bom_header_rec IN Bom_Bo_Pub.Bom_Head_Rec_Type
215 , p_bom_head_Unexp_Rec IN Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type
216 , x_bom_head_unexp_rec IN OUT NOCOPY Bom_Bo_Pub.Bom_Head_Unexposed_Rec_Type
217 );
218
219 END Bom_Validate_Bom_Header;