[Home] [Help]
PACKAGE BODY: APPS.PAY_AU_MODULE_PARAMETERS_API
Source
1 Package Body pay_au_module_parameters_api as
2 /* $Header: pyampapi.pkb 120.0 2005/05/29 02:55 appldev noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33);
7 --
8 -- ------------------------------------------------------------------------
9 -- |--------------------------< create_au_module_parameter >--------------|
10 -- ------------------------------------------------------------------------
11 --
12 procedure create_au_module_parameter
13 (p_validate in boolean default false,
14 p_module_id in number,
15 p_internal_name in varchar2,
16 p_data_type in varchar2,
17 p_input_flag in varchar2,
18 p_context_flag in varchar2,
19 p_output_flag in varchar2,
20 p_result_flag in varchar2,
21 p_error_message_flag in varchar2,
22 p_enabled_flag in varchar2,
23 p_function_return_flag in varchar2,
24 p_external_name in varchar2,
25 p_database_item_name in varchar2,
26 p_constant_value in varchar2,
27 p_module_parameter_id out nocopy number,
28 p_object_version_number out nocopy number) is
29 --
30 -- Declare cursors and local variables
31 --
32 --
33 -- Out variables
34 --
35 l_module_parameter_id pay_au_module_parameters.module_parameter_id%TYPE;
36 l_object_version_number pay_au_module_parameters.object_version_number%TYPE;
37 --
38 l_proc varchar2(72);
39 l_dummy_number number(1);
40 --
41 -- Declare a cursor that will check whether the passed
42 -- in module_id and external_name for a unique combination
43 --
44 cursor csr_valid_combo is
45 select pamp.module_parameter_id
46 from pay_au_module_parameters pamp
47 where pamp.module_id = p_module_id
48 and pamp.external_name = p_external_name;
49 --
50 begin
51 l_proc := g_package||'create_au_module_parameter';
52 --
53 hr_utility.set_location('Entering:'|| l_proc, 5);
54 --
55 -- Issue a savepoint if operating in validation only mode.
56 --
57 if p_validate then
58 savepoint create_au_module_parameter;
59 end if;
60 --
61 hr_utility.set_location(l_proc, 10);
62 --
63 --
64 -- Process Logic
65 --
66 --------------------------------------------------------
67 -- Check for unique module id and external name
68 --------------------------------------------------------
69 open csr_valid_combo;
70 fetch csr_valid_combo into l_module_parameter_id;
71
72 -- If the process parameter does not exist then create it.
73 -- Do not error if the process does exist, simply return.
74 --
75 if csr_valid_combo%notfound then
76 --
77 -- Insert the process parameter.
78 --
79 pay_amp_ins.ins
80 (
81 p_module_id => p_module_id,
82 p_internal_name => p_internal_name,
83 p_data_type => p_data_type,
84 p_input_flag => p_input_flag,
85 p_context_flag => p_context_flag,
86 p_output_flag => p_output_flag,
87 p_result_flag => p_result_flag,
88 p_error_message_flag => p_error_message_flag,
89 p_function_return_flag => p_function_return_flag,
90 p_enabled_flag => p_enabled_flag,
91 p_external_name => p_external_name,
92 p_database_item_name => p_database_item_name,
93 p_constant_value => p_constant_value,
94 p_module_parameter_id => l_module_parameter_id,
95 p_object_version_number => l_object_version_number
96 );
97 end if;
98 close csr_valid_combo;
99 --
100 hr_utility.set_location(l_proc, 20);
101 --
102 -- When in validation only mode raise the Validate_Enabled exception
103 --
104 if p_validate then
105 raise hr_api.validate_enabled;
106 end if;
107 --
108 -- Set all output arguments
109 --
110 p_module_parameter_id := l_module_parameter_id;
111 p_object_version_number := l_object_version_number;
112 --
113 hr_utility.set_location(' Leaving:'||l_proc, 100);
114 exception
115 when hr_api.validate_enabled then
116 --
117 -- Only set output warning arguments
118 -- (Any key or derived arguments must be set to null
119 -- when validation only mode is being used.)
120 --
121 p_module_parameter_id := null;
122 --
123 -- As the Validate_Enabled exception has been raised
124 -- we must rollback to the savepoint
125 --
126 ROLLBACK TO create_au_module_parameter;
127 --
128 end create_au_module_parameter;
129 --
130 -- ------------------------------------------------------------------------
131 -- |--------------------------< delete_au_module_parameter >--------------|
132 -- ------------------------------------------------------------------------
133 --
134 procedure delete_au_module_parameter
135 (p_validate in boolean default false,
136 p_module_parameter_id in number,
137 p_object_version_number in number) is
138 --
139 l_proc varchar2(72);
140 --
141 begin
142 l_proc := g_package||'delete_au_module_parameter';
143
144 hr_utility.set_location('Entering:'|| l_proc, 5);
145 --
146 -- Issue a savepoint if operating in validation only mode.
147 --
148 if p_validate then
149 savepoint delete_au_module_parameter;
150 end if;
151 --
152 hr_utility.set_location(l_proc, 10);
153 --
154 -- Validation in addition to Table Handlers
155 --
156 -- None required.
157 --
158 -- Process Logic
159 --
160 pay_amp_del.del
161 (p_module_parameter_id => p_module_parameter_id,
162 p_object_version_number => p_object_version_number);
163 --
164 hr_utility.set_location(l_proc, 20);
165 --
166 -- When in validation only mode raise the Validate_Enabled exception
167 --
168 if p_validate then
169 raise hr_api.validate_enabled;
170 end if;
171 --
172 hr_utility.set_location(' Leaving:'||l_proc, 100);
173 exception
174 when hr_api.validate_enabled then
175 --
176 -- As the Validate_Enabled exception has been raised
177 -- we must rollback to the savepoint
178 --
179 ROLLBACK TO delete_au_module_parameter;
180 end delete_au_module_parameter;
181 --
182 --
183 -- ------------------------------------------------------------------------
184 -- |--------------------------< update_au_module_parameter >--------------|
185 -- ------------------------------------------------------------------------
186 --
187 procedure update_au_module_parameter
188 (p_validate in boolean default false,
189 p_module_parameter_id in number,
190 p_module_id in number,
191 p_internal_name in varchar2,
192 p_data_type in varchar2,
193 p_input_flag in varchar2,
194 p_context_flag in varchar2,
195 p_output_flag in varchar2,
196 p_result_flag in varchar2,
197 p_error_message_flag in varchar2,
198 p_enabled_flag in varchar2,
199 p_function_return_flag in varchar2,
200 p_external_name in varchar2,
201 p_database_item_name in varchar2,
202 p_constant_value in varchar2,
203 p_object_version_number in out nocopy number
204 ) is
205 --
206 l_proc varchar2(72);
207 --
208 begin
209 l_proc := g_package||'update_au_module_parameter';
210 --
211 hr_utility.set_location('Entering:'|| l_proc, 5);
212 --
213 -- Issue a savepoint if operating in validation only mode.
214 --
215 if p_validate then
216 savepoint update_au_module_parameter;
217 end if;
218 --
219 hr_utility.set_location(l_proc, 10);
220 --
221 -- Validation in addition to Table Handlers
222 --
223 -- None required.
224 --
225 -- Process Logic
226 --
227 pay_amp_upd.upd
228 (p_module_parameter_id => p_module_parameter_id,
229 p_object_version_number => p_object_version_number,
230 p_module_id => p_module_id,
231 p_internal_name => p_internal_name,
232 p_data_type => p_data_type,
233 p_input_flag => p_input_flag,
234 p_context_flag => p_context_flag,
235 p_output_flag => p_output_flag,
236 p_result_flag => p_result_flag,
237 p_error_message_flag => p_error_message_flag,
238 p_function_return_flag => p_function_return_flag,
239 p_enabled_flag => p_enabled_flag,
240 p_external_name => p_external_name,
241 p_database_item_name => p_database_item_name,
242 p_constant_value => p_constant_value
243 );
244 --
245 hr_utility.set_location(l_proc, 20);
246 --
247 -- When in validation only mode raise the Validate_Enabled exception
248 --
249 if p_validate then
250 raise hr_api.validate_enabled;
251 end if;
252 --
253 hr_utility.set_location(' Leaving:'||l_proc, 100);
254 exception
255 when hr_api.validate_enabled then
256 --
257 -- As the Validate_Enabled exception has been raised
258 -- we must rollback to the savepoint
259 --
260 ROLLBACK TO update_au_module_parameter;
261 end update_au_module_parameter;
262 --
263 --
264 begin
265 g_package := ' pay_au_module_parameters_api.';
266 end pay_au_module_parameters_api;