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