The following lines contain the word 'select', 'insert', 'update' or 'delete':
-- If effectivity/op seq num of the parent operation has changed, update the child resource record
IF BOM_RTG_Globals.G_Init_Eff_Date_Op_Num_Flag
AND BOM_RTG_Globals.Get_Temp_Op_Rec1
( l_op_resource_rec.operation_sequence_number
, p_effectivity_date -- this cannot be null as this check is done only when the op has children
, l_temp_op_rec) THEN
l_op_resource_rec.operation_sequence_number := l_temp_op_rec.new_op_seq_num;
(BOM_Rtg_Globals.G_OPR_CREATE, BOM_Rtg_Globals.G_OPR_UPDATE)
THEN
Bom_Validate_Op_Res.Check_Attributes
( p_op_resource_rec => l_op_resource_rec
, p_op_res_unexp_rec => l_op_res_unexp_rec
, x_return_status => l_return_status
, x_mesg_token_tbl => l_mesg_token_tbl
) ;
(BOM_Rtg_Globals.G_OPR_UPDATE, BOM_Rtg_Globals.G_OPR_DELETE)
THEN
--
-- Process flow step 12: Populate NULL columns for Update and Delete
-- Call Bom_Default_Op_Res.Populate_Null_Columns
--
IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Populate NULL columns') ;
, BOM_Rtg_Globals.G_OPR_UPDATE )
THEN
Bom_Validate_Op_Seq.Check_Conditionally_Required
( p_op_resource_rec => l_op_resource_rec
, p_op_res_unexp_rec => l_op_res_unexp_rec
, x_return_status => l_return_status
, x_mesg_token_tbl => l_mesg_token_tbl
) ;
, BOM_Rtg_Globals.G_OPR_UPDATE )
THEN
Bom_Default_Op_Res.Entity_Defaulting
( p_op_resource_rec => l_op_resource_rec
, p_op_res_unexp_rec => l_op_res_unexp_rec
, x_op_resource_rec => l_op_resource_rec
, x_op_res_unexp_rec => l_op_res_unexp_rec
, x_mesg_token_tbl => l_mesg_token_tbl
, x_return_status => l_return_status
) ;
(BOM_Rtg_Globals.G_OPR_CREATE, BOM_Rtg_Globals.G_OPR_UPDATE)
THEN
Bom_Validate_Sub_Op_Res.Check_Attributes
( p_sub_resource_rec => l_sub_resource_rec
, p_sub_res_unexp_rec => l_sub_res_unexp_rec
, x_return_status => l_return_status
, x_mesg_token_tbl => l_mesg_token_tbl
) ;
(BOM_Rtg_Globals.G_OPR_UPDATE, BOM_Rtg_Globals.G_OPR_DELETE)
THEN
--
-- Process flow step 12: Populate NULL columns for Update and Delete
-- Call Bom_Default_Op_Res.Populate_Null_Columns
--
IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Populate NULL columns') ;
, BOM_Rtg_Globals.G_OPR_UPDATE )
THEN
Bom_Validate_Sub_Op_Seq.Check_Conditionally_Required
( p_sub_resource_rec => l_sub_resource_rec
, p_sub_res_unexp_rec => l_sub_res_unexp_rec
, x_return_status => l_return_status
, x_mesg_token_tbl => l_mesg_token_tbl
) ;
, BOM_Rtg_Globals.G_OPR_UPDATE )
THEN
Bom_Default_Sub_Op_Res.Entity_Defaulting
( p_sub_resource_rec => l_sub_resource_rec
, p_sub_res_unexp_rec => l_sub_res_unexp_rec
, x_sub_resource_rec => l_sub_resource_rec
, x_sub_res_unexp_rec => l_sub_res_unexp_rec
, x_mesg_token_tbl => l_mesg_token_tbl
, x_return_status => l_return_status
) ;
* 1. If its update of OSFM Network, then we store the start operation id *
* at the start. Then at the end of the network transactions, we check *
* that this start operation is the same as the one at the end of update. *
* If its not(user changed start) we should error out! *
* 2. Same for the End operation. *
* 3. We are also adding logic to default the subinventory and locator. *
* Since the original logic as in OSFM forms trigger, depends on the end *
* operation sub inv and locator, we have put the logic here. So that we *
* can get the end operation at the end of saving all the network links. *
* 4. Also, we cannot ask user to decide for following 2 cases as forms *
* does , so we are going to give user instruction to do so by going to *
* the form.But we will not assume any thing and let the data be as it is!*
* Cases in question : *
* a. When the end operation has sub inv and loc; also it matches with the*
(BOM_Rtg_Globals.G_OPR_UPDATE, BOM_Rtg_Globals.G_OPR_CREATE)
THEN
Bom_Validate_Op_Network.Check_Access
( p_op_network_rec => l_op_network_rec
, p_op_network_unexp_rec => l_op_network_unexp_rec
, x_return_status => l_return_status
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
);
(BOM_Rtg_Globals.G_OPR_UPDATE, BOM_Rtg_Globals.G_OPR_CREATE)
THEN
Bom_Validate_Op_Network.Check_Attributes
( x_return_status => l_return_status
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_op_network_rec => l_op_network_rec
, p_op_network_unexp_rec => l_op_network_unexp_rec
, p_old_op_network_rec => l_Old_op_network_rec
, p_old_op_network_unexp_rec => l_Old_op_network_unexp_rec
);
(BOM_Rtg_Globals.G_OPR_UPDATE, BOM_Rtg_Globals.G_OPR_DELETE)
THEN
-- Process flow - Populate NULL columns for Update and
-- Delete.
Bom_Default_Op_Network.Populate_NULL_Columns
( p_op_network_rec => l_op_network_rec
, p_op_network_unexp_rec => l_op_network_unexp_rec
, p_old_op_network_rec => l_old_op_network_rec
, p_old_op_network_unexp_rec => l_old_op_network_unexp_rec
, x_op_network_rec => l_op_network_rec
, x_op_network_unexp_rec => l_op_network_unexp_rec
);
p_update_events => 0,
x_token_tbl => l_token_tbl,
x_err_msg => l_other_message,
x_return_status => l_dummy);
p_update_events => 0,
x_token_tbl => l_token_tbl,
x_err_msg => l_other_message,
x_return_status => l_dummy);
l_temp_op_rec_tbl.DELETE;
(BOM_Rtg_Globals.G_OPR_CREATE, BOM_Rtg_Globals.G_OPR_UPDATE)
THEN
Bom_Validate_Op_Seq.Check_Attributes
( p_operation_rec => l_operation_rec
, p_op_unexp_rec => l_op_unexp_rec
, x_return_status => l_return_status
, x_mesg_token_tbl => l_mesg_token_tbl
) ;
(BOM_Rtg_Globals.G_OPR_UPDATE, BOM_Rtg_Globals.G_OPR_DELETE)
THEN
--
-- Process flow step 12: Populate NULL columns for Update and Delete
-- Call Bom_Default_Op_Seq.Populate_Null_Columns
--
IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Populate NULL columns') ;
, BOM_Rtg_Globals.G_OPR_UPDATE )
THEN
Bom_Validate_Op_Seq.Check_Conditionally_Required
( p_operation_rec => l_operation_rec
, p_op_unexp_rec => l_op_unexp_rec
, x_return_status => l_return_status
, x_mesg_token_tbl => l_mesg_token_tbl
) ;
, BOM_Rtg_Globals.G_OPR_UPDATE )
THEN
Bom_Default_Op_Seq.Entity_Defaulting
( p_operation_rec => l_operation_rec
, p_op_unexp_rec => l_op_unexp_rec
, x_operation_rec => l_operation_rec
, x_op_unexp_rec => l_op_unexp_rec
, x_mesg_token_tbl => l_mesg_token_tbl
, x_return_status => l_return_status
) ;
SELECT CFM_ROUTING_FLAG
INTO l_cfm_routing_flag
FROM BOM_OPERATIONAL_ROUTINGS
WHERE ROUTING_SEQUENCE_ID = l_routing_sequence_id;
(BOM_Rtg_Globals.G_OPR_UPDATE, BOM_Rtg_Globals.G_OPR_CREATE)
THEN
IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN
Error_Handler.Write_Debug('Rtg Revision : Check Attributes . . .');
(BOM_Rtg_Globals.G_OPR_UPDATE, BOM_Rtg_Globals.G_OPR_DELETE)
THEN
-- Process flow - Populate NULL columns for Update and
-- Delete.
Bom_Default_Rtg_Revision.Populate_NULL_Columns
( p_rtg_revision_rec => l_rtg_revision_rec
, p_rtg_rev_unexp_rec => l_rtg_rev_unexp_rec
, p_old_rtg_revision_rec => l_old_rtg_revision_rec
, p_old_rtg_rev_unexp_rec => l_old_rtg_rev_unexp_rec
, x_rtg_revision_rec => l_rtg_revision_rec
, x_rtg_rev_unexp_rec => l_rtg_rev_unexp_rec
);
(BOM_Rtg_Globals.G_OPR_UPDATE, BOM_Rtg_Globals.G_OPR_CREATE)
THEN
Bom_Validate_Rtg_Header.Check_Attributes
( x_return_status => l_return_status
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_rtg_header_rec => l_rtg_header_rec
, p_rtg_header_unexp_rec => l_rtg_header_unexp_rec
, p_old_rtg_header_rec => l_old_rtg_header_rec
, p_old_rtg_header_unexp_rec => l_old_rtg_header_unexp_rec
);
(BOM_Rtg_Globals.G_OPR_UPDATE, BOM_Rtg_Globals.G_OPR_DELETE)
THEN
--
-- Process flow step 12 - Populate NULL columns for Update and
-- Delete.
--
BOM_Default_Rtg_Header.Populate_NULL_Columns
( p_rtg_header_rec => l_rtg_header_rec
, p_rtg_header_unexp_rec => l_rtg_header_unexp_rec
, p_Old_rtg_header_rec => l_old_rtg_header_rec
, p_Old_rtg_header_unexp_rec => l_old_rtg_header_unexp_rec
, x_rtg_header_rec => l_rtg_header_rec
, x_rtg_header_unexp_rec => l_rtg_header_unexp_rec
);
BOM_Rtg_Globals.G_OPR_CREATE, BOM_Rtg_Globals.G_OPR_UPDATE)
THEN
BOM_Default_Rtg_Header.Entity_Attribute_Defaulting
( p_rtg_header_rec => l_rtg_header_rec
, p_rtg_header_unexp_rec => l_rtg_header_unexp_rec
, x_rtg_header_rec => l_rtg_header_rec
, x_rtg_header_unexp_rec => l_rtg_header_unexp_rec
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_return_status => l_return_status
);
IF l_rtg_header_rec.transaction_type <> 'DELETE'
THEN
Bom_Validate_Rtg_Header.Check_Entity
( x_return_status => l_return_status
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_rtg_header_rec => l_rtg_header_rec
, p_rtg_header_unexp_rec => l_rtg_header_unexp_rec
, p_old_rtg_header_rec => l_rtg_header_rec
, p_old_rtg_header_unexp_rec => l_old_rtg_header_unexp_rec
);
Bom_Validate_Rtg_Header.Check_Entity_Delete
( x_return_status => l_return_status
, x_Mesg_Token_Tbl => l_mesg_token_tbl
, p_rtg_header_rec => l_rtg_header_rec
, p_rtg_header_Unexp_Rec => l_rtg_header_unexp_rec
, x_rtg_header_unexp_rec => l_rtg_header_unexp_rec
);