[Home] [Help]
PACKAGE BODY: APPS.OTA_BATCH_ACTION_API
Source
1 PACKAGE BODY ota_batch_action_api as
2 /* $Header: otabchact.pkb 120.0.12020000.2 2013/03/27 05:01:21 jaysridh noship $ */
3
4 procedure create_batch_ranges
5 (p_validate in boolean default false
6 ,p_range_id out nocopy number
7 ,p_batch_source_cd in varchar2 -- newly added
8 ,p_batch_action_id in number
9 ,p_range_status_cd in varchar2 default null
10 ,p_starting_person_action_id in number default null
11 ,p_ending_person_action_id in number default null
12 ,p_object_version_number out nocopy number) as
13
14 l_range_id OTA_BATCH_RANGES.RANGE_ID%type;
15 l_object_verion_number OTA_BATCH_RANGES.OBJECT_VERSION_NUMBER%Type := 1;
16
17 Cursor C_Sel1 is select OTA_BATCH_RANGES_S.nextval from sys.dual;
18
19 begin
20
21 Open C_Sel1;
22 Fetch C_Sel1 Into l_range_id;
23 Close C_Sel1;
24
25 insert into OTA_BATCH_RANGES
26 (RANGE_ID,
27 BATCH_SOURCE_CD, -- newly added
28 BATCH_ACTION_ID,
29 RANGE_STATUS_CD,
30 STARTING_PERSON_ACTION_ID,
31 ENDING_PERSON_ACTION_ID,
32 OBJECT_VERSION_NUMBER
33 )
34 values
35 (l_range_id,
36 p_batch_source_cd,
37 p_batch_action_id,
38 p_range_status_cd,
39 p_starting_person_action_id,
40 p_ending_person_action_id,
41 l_object_verion_number
42 );
43
44 p_range_id := l_range_id;
45 p_object_version_number := l_object_verion_number;
46
47 Exception
48 when others then
49 FND_FILE.PUT_LINE(FND_FILE.LOG,'Error while creating the batch range');
50 FND_FILE.PUT_LINE(FND_FILE.LOG,'Error:'||substr(SQLERRM,1,2000));
51 raise;
52 end create_batch_ranges;
53
54 procedure create_bulk_enr_request
55 (p_bulk_enr_request_id out nocopy number
56 ,p_requestor_id in number default null
57 ,p_object_type in VARCHAR2
58 ,p_object_id in number default -1
59 ,p_business_group_id in number default null
60 ,p_conc_program_request_id in number
61 )as
62
63 l_bulk_enr_request_id ota_bulk_enr_requests.BULK_ENR_REQUEST_ID%Type;
64
65 Cursor C_Sel1 is select OTA_BULK_ENR_REQUESTS_S.nextval from sys.dual;
66
67 begin
68
69 Open C_Sel1;
70 Fetch C_Sel1 Into l_bulk_enr_request_id;
71 Close C_Sel1;
72
73 insert into OTA_BULK_ENR_REQUESTS
74 (BULK_ENR_REQUEST_ID,
75 REQUESTOR_ID,
76 OBJECT_TYPE,
77 BUSINESS_GROUP_ID,
78 CONC_PROGRAM_REQUEST_ID,
79 OBJECT_ID)
80 values
81 (l_bulk_enr_request_id,
82 p_requestor_id,
83 p_object_type,
84 p_business_group_id,
85 p_conc_program_request_id,
86 p_object_id
87 );
88
89 p_bulk_enr_request_id := l_bulk_enr_request_id;
90
91 Exception
92 when others then
93 FND_FILE.PUT_LINE(FND_FILE.LOG,'Error while creating OTA_BULK_ENR_REQUESTS record');
94 FND_FILE.PUT_LINE(FND_FILE.LOG,'Error:'||substr(SQLERRM,1,2000));
95 raise;
96 end create_bulk_enr_request;
97
98 procedure create_bulk_enr_request_member
99 (p_person_action_id out nocopy number
100 ,p_person_id in number
101 ,p_assignment_id in number default -1
102 ,p_bulk_enr_request_id in number
103 ,p_action_status_cd in varchar2 default null
104 ,p_business_group_id in number default null
105 ,p_enrollment_status in varchar2 default null
106 ,p_error_message in varchar2 default null
107 ,p_booking_id in number default null) as
108
109 l_person_action_id ota_bulk_enr_req_members.PERSON_ACTION_ID%type;
110
111 Cursor C_Sel1 is select OTA_PERSON_ACTIONS_S.nextval from sys.dual;
112
113 begin
114
115 Open C_Sel1;
116 Fetch C_Sel1 Into l_person_action_id;
117 Close C_Sel1;
118
119 insert into ota_bulk_enr_req_members
120 (PERSON_ACTION_ID,
121 PERSON_ID,
122 BULK_ENR_REQUEST_ID,
123 ACTION_STATUS_CD,
124 ASSIGNMENT_ID,
125 ENROLLMENT_STATUS,
126 ERROR_MESSAGE,
127 BOOKING_ID,
128 MBR_BG_ID
129 )
130 values
131 (l_person_action_id,
132 p_person_id,
133 p_bulk_enr_request_id,
134 p_action_status_cd,
135 p_assignment_id,
136 p_enrollment_status,
137 p_error_message,
138 p_booking_id,
139 p_business_group_id
140 );
141
142 p_person_action_id := l_person_action_id;
143
144 Exception
145 when others then
146 FND_FILE.PUT_LINE(FND_FILE.LOG,'Error while creating ota_bulk_enr_req_members record');
147 FND_FILE.PUT_LINE(FND_FILE.LOG,'Error:'||substr(SQLERRM,1,2000));
148 raise;
149 end create_bulk_enr_request_member;
150
151 end ota_batch_action_api;
152