DBA Data[Home] [Help]

PACKAGE BODY: APPS.AK_FLOW_GRP

Source


1 package body AK_FLOW_GRP as
2 /* $Header: akdgflob.pls 120.2 2005/09/15 22:26:33 tshort ship $ */
3 
4 --=======================================================
5 --  Procedure   CREATE_FLOW
6 --
7 --  Usage       Group API for creating a flow
8 --
9 --  Desc        Calls the private API to create a flow
10 --              using the given info
11 --
12 --  Results     The API returns the standard p_return_status parameter
13 --              indicating one of the standard return statuses :
14 --                  * Unexpected error
15 --                  * Error
16 --                  * Success
17 --  Parameters  Flow columns except primary_page_appl_id and
18 --              primary_page_code since there are no
19 --              flow pages for this flow at this time.
20 --
21 --  Version     Initial version number  =   1.0
22 --  History     Current version number  =   1.0
23 --=======================================================
24 procedure CREATE_FLOW (
25 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
26 p_api_version_number       IN      NUMBER,
27 p_init_msg_tbl             IN      BOOLEAN := FALSE,
28 p_msg_count                OUT NOCOPY     NUMBER,
29 p_msg_data                 OUT NOCOPY     VARCHAR2,
30 p_return_status            OUT NOCOPY     VARCHAR2,
31 p_flow_application_id      IN      NUMBER,
32 p_flow_code                IN      VARCHAR2,
33 p_name                     IN      VARCHAR2,
34 p_description              IN      VARCHAR2 := FND_API.G_MISS_CHAR,
35 p_created_by               IN     NUMBER := FND_API.G_MISS_NUM,
36 p_creation_date            IN      DATE := FND_API.G_MISS_DATE,
37 p_last_updated_by          IN     NUMBER := FND_API.G_MISS_NUM,
38 p_last_update_date         IN      DATE := FND_API.G_MISS_DATE,
39 p_last_update_login        IN     NUMBER := FND_API.G_MISS_NUM
40 ) is
41 l_api_version_number CONSTANT number := 1.0;
42 l_api_name           CONSTANT varchar2(30) := 'Create_Flow';
43 l_return_status      VARCHAR2(1);
44 l_pass               NUMBER := 2;
45 l_copy_redo_flag     BOOLEAN := FALSE;
46 begin
47 -- Check API version number
48 IF NOT FND_API.Compatible_API_Call (
49 l_api_version_number, p_api_version_number, l_api_name,
50 G_PKG_NAME) then
51 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
52 return;
53 END IF;
54 
55 -- Initialize the message table if requested.
56 
57 if p_init_msg_tbl then
58 FND_MSG_PUB.initialize;
59 end if;
60 
61 savepoint start_create_flow;
62 
63 -- Call private procedure to create a flow
64 AK_FLOW_PVT.CREATE_FLOW (
65 p_validation_level => p_validation_level,
66 p_api_version_number => 1.0,
67 p_msg_count => p_msg_count,
68 p_msg_data => p_msg_data,
69 p_return_status => l_return_status,
70 p_flow_application_id => p_flow_application_id,
71 p_flow_code => p_flow_code,
72 p_name => p_name,
73 p_description => p_description,
74 p_created_by => p_created_by,
75 p_creation_date => p_creation_date,
76 p_last_updated_by => p_last_updated_by,
77 p_last_update_date => p_last_update_date,
78 p_last_update_login => p_lasT_update_login,
79 p_pass => l_pass,
80 p_copy_redo_flag => l_copy_redo_flag
81 );
82 
83 -- If API call returns with an error status...
84 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
85 (l_return_status = FND_API.G_RET_STS_ERROR) then
86 RAISE FND_API.G_EXC_ERROR;
87 end if;
88 
89 p_return_status := FND_API.G_RET_STS_SUCCESS;
90 
91 EXCEPTION
92 WHEN FND_API.G_EXC_ERROR THEN
93 p_return_status := FND_API.G_RET_STS_ERROR;
94 rollback to start_create_flow;
95 WHEN OTHERS THEN
96 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
97 rollback to start_create_flow;
98 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
99 SUBSTR (SQLERRM, 1, 240) );
100 FND_MSG_PUB.Add;
101 end CREATE_FLOW;
102 
103 --=======================================================
104 --  Procedure   CREATE_PAGE
105 --
106 --  Usage       Group API for creating a flow page
107 --
108 --  Desc        Calls the private API to create a flow page
109 --              using the given info
110 --
111 --  Results     The API returns the standard p_return_status parameter
112 --              indicating one of the standard return statuses :
113 --                  * Unexpected error
114 --                  * Error
115 --                  * Success
116 --  Parameters  Flow Page columns except primary_region_appl_id and
117 --              primary_region_code since there are no
118 --              flow page regions for this flow page at this time.
119 --              p_set_primary_page : IN optional
120 --                  Set the current page as the primary page of
121 --                  the flow if this flag is 'Y'.
122 --
123 --  Version     Initial version number  =   1.0
124 --  History     Current version number  =   1.0
125 --=======================================================
126 procedure CREATE_PAGE (
127 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
128 p_api_version_number       IN      NUMBER,
129 p_init_msg_tbl             IN      BOOLEAN := FALSE,
130 p_msg_count                OUT NOCOPY     NUMBER,
131 p_msg_data                 OUT NOCOPY     VARCHAR2,
132 p_return_status            OUT NOCOPY     VARCHAR2,
133 p_flow_application_id      IN      NUMBER,
134 p_flow_code                IN      VARCHAR2,
135 p_page_application_id      IN      NUMBER,
136 p_page_code                IN      VARCHAR2,
137 p_name                     IN      VARCHAR2,
138 p_description              IN      VARCHAR2 := FND_API.G_MISS_CHAR,
139 p_set_primary_page         IN      VARCHAR2 := FND_API.G_MISS_CHAR,
140 p_created_by               IN     NUMBER := FND_API.G_MISS_NUM,
141 p_creation_date            IN      DATE := FND_API.G_MISS_DATE,
142 p_last_updated_by          IN     NUMBER := FND_API.G_MISS_NUM,
143 p_last_update_date         IN      DATE := FND_API.G_MISS_DATE,
144 p_last_update_login        IN     NUMBER := FND_API.G_MISS_NUM
145 ) is
146 l_api_version_number CONSTANT number := 1.0;
147 l_api_name           CONSTANT varchar2(30) := 'Create_Page';
148 l_return_status      VARCHAR2(1);
149 l_pass               NUMBER := 2;
150 l_copy_redo_flag     BOOLEAN := FALSE;
151 begin
152 -- Check API version number
153 IF NOT FND_API.Compatible_API_Call (
154 l_api_version_number, p_api_version_number, l_api_name,
155 G_PKG_NAME) then
156 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
157 return;
158 END IF;
159 
160 -- Initialize the message table if requested.
161 
162 if p_init_msg_tbl then
163 FND_MSG_PUB.initialize;
164 end if;
165 
166 savepoint start_create_page;
167 
168 -- Call private procedure to create a page
169 AK_FLOW_PVT.CREATE_PAGE (
170 p_validation_level => p_validation_level,
171 p_api_version_number => 1.0,
172 p_msg_count => p_msg_count,
173 p_msg_data => p_msg_data,
174 p_return_status => l_return_status,
175 p_flow_application_id => p_flow_application_id,
176 p_flow_code => p_flow_code,
177 p_page_application_id => p_page_application_id,
178 p_page_code => p_page_code,
179 p_name => p_name,
180 p_description => p_description,
181 p_set_primary_page => p_set_primary_page,
182 p_created_by => p_created_by,
183 p_creation_date => p_creation_date,
184 p_last_updated_by => p_last_updated_by,
185 p_last_update_date => p_last_update_date,
186 p_last_update_login => p_lasT_update_login,
187 p_pass => l_pass,
188 p_copy_redo_flag => l_copy_redo_flag
189 );
190 
191 -- If API call returns with an error status...
192 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
193 (l_return_status = FND_API.G_RET_STS_ERROR) then
194 RAISE FND_API.G_EXC_ERROR;
195 end if;
196 
197 p_return_status := FND_API.G_RET_STS_SUCCESS;
198 
199 EXCEPTION
200 WHEN FND_API.G_EXC_ERROR THEN
201 p_return_status := FND_API.G_RET_STS_ERROR;
202 rollback to start_create_page;
203 WHEN OTHERS THEN
204 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
205 rollback to start_create_page;
206 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
207 SUBSTR (SQLERRM, 1, 240) );
208 FND_MSG_PUB.Add;
209 end CREATE_PAGE;
210 
211 --=======================================================
212 --  Procedure   CREATE_PAGE_REGION
213 --
214 --  Usage       Group API for creating a flow page region
215 --
216 --  Desc        Calls the private API to create a flow page region
217 --              using the given info
218 --
219 --  Results     The API returns the standard p_return_status parameter
220 --              indicating one of the standard return statuses :
221 --                  * Unexpected error
222 --                  * Error
223 --                  * Success
224 --  Parameters  Flow Page Region columns
225 --              p_foreign_key_name : IN optional
226 --                  If a foreign key name is passed, and that this page
227 --                  region has a parent region, then this API will
228 --                  create an intrapage flow region relation connecting
229 --                  this page region with the parent region using the
230 --                  foreign key name. If there is already an intrapage
231 --                  flow region relation exists connecting these two
232 --                  page regions, it will be replaced by a new one using
233 --                  this foreign key.
234 --              p_set_primary_region : IN optional
235 --                  Set the current page region as the primary region of
236 --                  the flow page if this flag is 'Y'.
237 --
238 --  Version     Initial version number  =   1.0
239 --  History     Current version number  =   1.0
240 --=======================================================
241 procedure CREATE_PAGE_REGION (
242 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
243 p_api_version_number       IN      NUMBER,
244 p_init_msg_tbl             IN      BOOLEAN := FALSE,
245 p_msg_count                OUT NOCOPY     NUMBER,
246 p_msg_data                 OUT NOCOPY     VARCHAR2,
247 p_return_status            OUT NOCOPY     VARCHAR2,
248 p_flow_application_id      IN      NUMBER,
249 p_flow_code                IN      VARCHAR2,
250 p_page_application_id      IN      NUMBER,
251 p_page_code                IN      VARCHAR2,
252 p_region_application_id    IN      NUMBER,
253 p_region_code              IN      VARCHAR2,
254 p_display_sequence         IN      NUMBER := FND_API.G_MISS_NUM,
255 p_region_style             IN      VARCHAR2,
256 p_num_columns              IN      NUMBER := FND_API.G_MISS_NUM,
257 p_icx_custom_call          IN      VARCHAR2 := FND_API.G_MISS_CHAR,
258 p_parent_region_application_id IN  NUMBER := FND_API.G_MISS_NUM,
259 p_parent_region_code       IN      VARCHAR2 := FND_API.G_MISS_CHAR,
260 p_foreign_key_name         IN      VARCHAR2 := FND_API.G_MISS_CHAR,
261 p_set_primary_region       IN      VARCHAR2 := FND_API.G_MISS_CHAR,
262 p_created_by               IN     NUMBER := FND_API.G_MISS_NUM,
263 p_creation_date            IN      DATE := FND_API.G_MISS_DATE,
264 p_last_updated_by          IN     NUMBER := FND_API.G_MISS_NUM,
265 p_last_update_date         IN      DATE := FND_API.G_MISS_DATE,
266 p_last_update_login        IN     NUMBER := FND_API.G_MISS_NUM
267 ) is
268 l_api_version_number CONSTANT number := 1.0;
269 l_api_name           CONSTANT varchar2(30) := 'Create_Page_Region';
270 l_return_status      VARCHAR2(1);
271 l_pass               NUMBER := 2;
272 l_copy_redo_flag     BOOLEAN := FALSE;
273 begin
274 -- Check API version number
275 IF NOT FND_API.Compatible_API_Call (
276 l_api_version_number, p_api_version_number, l_api_name,
277 G_PKG_NAME) then
278 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
279 return;
280 END IF;
281 
282 -- Initialize the message table if requested.
283 
284 if p_init_msg_tbl then
285 FND_MSG_PUB.initialize;
286 end if;
287 
288 savepoint start_create_page_region;
289 
290 -- Call private procedure to create a page region
291 AK_FLOW_PVT.CREATE_PAGE_REGION (
292 p_validation_level => p_validation_level,
293 p_api_version_number => 1.0,
294 p_msg_count => p_msg_count,
295 p_msg_data => p_msg_data,
296 p_return_status => l_return_status,
297 p_flow_application_id => p_flow_application_id,
298 p_flow_code => p_flow_code,
299 p_page_application_id => p_page_application_id,
300 p_page_code => p_page_code,
301 p_region_application_id => p_region_application_id,
302 p_region_code => p_region_code,
303 p_display_sequence => p_display_sequence,
304 p_region_style => p_region_style,
305 p_num_columns => p_num_columns,
306 p_icx_custom_call => p_icx_custom_call,
307 p_parent_region_application_id => p_parent_region_application_id,
308 p_parent_region_code => p_parent_region_code,
309 p_foreign_key_name => p_foreign_key_name,
310 p_set_primary_region => p_set_primary_region,
311 p_created_by => p_created_by,
312 p_creation_date => p_creation_date,
313 p_last_updated_by => p_last_updated_by,
314 p_last_update_date => p_last_update_date,
315 p_last_update_login => p_lasT_update_login,
316 p_pass => l_pass,
317 p_copy_redo_flag => l_copy_redo_flag
318 );
319 
320 -- If API call returns with an error status...
321 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
322 (l_return_status = FND_API.G_RET_STS_ERROR) then
323 RAISE FND_API.G_EXC_ERROR;
324 end if;
325 
326 p_return_status := FND_API.G_RET_STS_SUCCESS;
327 
328 EXCEPTION
329 WHEN FND_API.G_EXC_ERROR THEN
330 p_return_status := FND_API.G_RET_STS_ERROR;
331 rollback to start_create_page_region;
332 WHEN OTHERS THEN
333 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
334 rollback to start_create_page_region;
335 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
336 SUBSTR (SQLERRM, 1, 240) );
337 FND_MSG_PUB.Add;
338 end CREATE_PAGE_REGION;
339 
340 --=======================================================
341 --  Procedure   CREATE_PAGE_REGION_ITEM
342 --
343 --  Usage       Group API for creating a page region item
344 --
345 --  Desc        Calls the private API to create a page region
346 --              item using the given info
347 --
348 --  Results     The API returns the standard p_return_status parameter
349 --              indicating one of the standard return statuses :
350 --                  * Unexpected error
351 --                  * Error
352 --                  * Success
353 --  Parameters  Page Region Item columns
354 --
355 --  Version     Initial version number  =   1.0
356 --  History     Current version number  =   1.0
357 --=======================================================
358 procedure CREATE_PAGE_REGION_ITEM (
359 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
360 p_api_version_number       IN      NUMBER,
364 p_return_status            OUT NOCOPY     VARCHAR2,
361 p_init_msg_tbl             IN      BOOLEAN := FALSE,
362 p_msg_count                OUT NOCOPY     NUMBER,
363 p_msg_data                 OUT NOCOPY     VARCHAR2,
365 p_flow_application_id      IN      NUMBER,
366 p_flow_code                IN      VARCHAR2,
367 p_page_application_id      IN      NUMBER,
368 p_page_code                IN      VARCHAR2,
369 p_region_application_id    IN      NUMBER,
370 p_region_code              IN      VARCHAR2,
371 p_attribute_application_id IN      NUMBER,
372 p_attribute_code           IN      VARCHAR2,
373 p_to_page_appl_id          IN      NUMBER := FND_API.G_MISS_NUM,
374 p_to_page_code             IN      VARCHAR2 := FND_API.G_MISS_CHAR,
375 p_to_url_attribute_appl_id IN      NUMBER := FND_API.G_MISS_NUM,
376 p_to_url_attribute_code    IN      VARCHAR2 := FND_API.G_MISS_CHAR,
377 p_created_by               IN     NUMBER := FND_API.G_MISS_NUM,
378 p_creation_date            IN      DATE := FND_API.G_MISS_DATE,
379 p_last_updated_by          IN     NUMBER := FND_API.G_MISS_NUM,
380 p_last_update_date         IN      DATE := FND_API.G_MISS_DATE,
381 p_last_update_login        IN     NUMBER := FND_API.G_MISS_NUM
382 ) is
383 l_api_version_number CONSTANT number := 1.0;
384 l_api_name           CONSTANT varchar2(30) := 'Create_Page_Region_Item';
385 l_return_status      VARCHAR2(1);
386 l_pass               NUMBER := 2;
387 l_copy_redo_flag     BOOLEAN := FALSE;
388 begin
389 -- Check API version number
390 IF NOT FND_API.Compatible_API_Call (
391 l_api_version_number, p_api_version_number, l_api_name,
392 G_PKG_NAME) then
393 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
394 return;
395 END IF;
396 
397 -- Initialize the message table if requested.
398 
399 if p_init_msg_tbl then
400 FND_MSG_PUB.initialize;
401 end if;
402 
403 savepoint start_create_item;
404 
405 -- Call private procedure to create a page region item
406 AK_FLOW_PVT.CREATE_PAGE_REGION_ITEM (
407 p_validation_level => p_validation_level,
408 p_api_version_number => 1.0,
409 p_msg_count => p_msg_count,
410 p_msg_data => p_msg_data,
411 p_return_status => l_return_status,
412 p_flow_application_id => p_flow_application_id,
413 p_flow_code => p_flow_code,
414 p_page_application_id => p_page_application_id,
415 p_page_code => p_page_code,
416 p_region_application_id => p_region_application_id,
417 p_region_code => p_region_code,
418 p_attribute_application_id => p_attribute_application_id,
419 p_attribute_code => p_attribute_code,
420 p_to_page_appl_id => p_to_page_appl_id,
421 p_to_page_code => p_to_page_code,
422 p_to_url_attribute_appl_id => p_to_url_attribute_appl_id,
423 p_to_url_attribute_code => p_to_url_attribute_code,
424 p_created_by => p_created_by,
425 p_creation_date => p_creation_date,
426 p_last_updated_by => p_last_updated_by,
427 p_last_update_date => p_last_update_date,
428 p_last_update_login => p_lasT_update_login,
429 p_pass => l_pass,
430 p_copy_redo_flag => l_copy_redo_flag
431 );
432 
433 -- If API call returns with an error status...
434 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
435 (l_return_status = FND_API.G_RET_STS_ERROR) then
436 RAISE FND_API.G_EXC_ERROR;
437 end if;
438 
439 p_return_status := FND_API.G_RET_STS_SUCCESS;
440 
441 EXCEPTION
442 WHEN FND_API.G_EXC_ERROR THEN
443 p_return_status := FND_API.G_RET_STS_ERROR;
444 rollback to start_create_item;
445 WHEN OTHERS THEN
446 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
447 rollback to start_create_item;
448 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
449 SUBSTR (SQLERRM, 1, 240) );
450 FND_MSG_PUB.Add;
451 end CREATE_PAGE_REGION_ITEM;
452 
453 --=======================================================
454 --  Procedure   CREATE_REGION_RELATION
455 --
456 --  Usage       Group API for creating a flow region relation
457 --
458 --  Desc        Calls the private API to create a flow region
459 --              relation using the given info
460 --
461 --  Results     The API returns the standard p_return_status parameter
462 --              indicating one of the standard return statuses :
463 --                  * Unexpected error
464 --                  * Error
465 --                  * Success
466 --  Parameters  Flow Region Relation columns
467 --
468 --  Version     Initial version number  =   1.0
469 --  History     Current version number  =   1.0
470 --=======================================================
471 procedure CREATE_REGION_RELATION (
472 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
473 p_api_version_number       IN      NUMBER,
474 p_init_msg_tbl             IN      BOOLEAN := FALSE,
475 p_msg_count                OUT NOCOPY     NUMBER,
476 p_msg_data                 OUT NOCOPY     VARCHAR2,
477 p_return_status            OUT NOCOPY     VARCHAR2,
478 p_flow_application_id      IN      NUMBER,
479 p_flow_code                IN      VARCHAR2,
480 p_foreign_key_name         IN      VARCHAR2,
481 p_from_page_appl_id        IN      NUMBER,
482 p_from_page_code           IN      VARCHAR2,
483 p_from_region_appl_id      IN      NUMBER,
484 p_from_region_code         IN      VARCHAR2,
485 p_to_page_appl_id          IN      NUMBER,
486 p_to_page_code             IN      VARCHAR2,
487 p_to_region_appl_id        IN      NUMBER,
491 p_creation_date            IN      DATE := FND_API.G_MISS_DATE,
488 p_to_region_code           IN      VARCHAR2,
489 p_application_id           IN      NUMBER,
490 p_created_by               IN     NUMBER := FND_API.G_MISS_NUM,
492 p_last_updated_by          IN     NUMBER := FND_API.G_MISS_NUM,
493 p_last_update_date         IN      DATE := FND_API.G_MISS_DATE,
494 p_last_update_login        IN     NUMBER := FND_API.G_MISS_NUM
495 ) is
496 l_api_version_number CONSTANT number := 1.0;
497 l_api_name           CONSTANT varchar2(30) := 'Create_Region_Relation';
498 l_return_status      VARCHAR2(1);
499 l_pass               NUMBER := 2;
500 l_copy_redo_flag     BOOLEAN := FALSE;
501 begin
502 -- Check API version number
503 IF NOT FND_API.Compatible_API_Call (
504 l_api_version_number, p_api_version_number, l_api_name,
505 G_PKG_NAME) then
506 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
507 return;
508 END IF;
509 
510 -- Initialize the message table if requested.
511 
512 if p_init_msg_tbl then
513 FND_MSG_PUB.initialize;
514 end if;
515 
516 savepoint start_create_relation;
517 
518 -- Call private procedure to create a flow region relation
519 AK_FLOW_PVT.CREATE_REGION_RELATION (
520 p_validation_level => p_validation_level,
521 p_api_version_number => 1.0,
522 p_msg_count => p_msg_count,
523 p_msg_data => p_msg_data,
524 p_return_status => l_return_status,
525 p_flow_application_id => p_flow_application_id,
526 p_flow_code => p_flow_code,
527 p_foreign_key_name => p_foreign_key_name,
528 p_from_page_appl_id => p_from_page_appl_id,
529 p_from_page_code => p_from_page_code,
530 p_from_region_appl_id => p_from_region_appl_id,
531 p_from_region_code => p_from_region_code,
532 p_to_page_appl_id => p_to_page_appl_id,
533 p_to_page_code => p_to_page_code,
534 p_to_region_appl_id => p_to_region_appl_id,
535 p_to_region_code => p_to_region_code,
536 p_application_id => p_application_id,
537 p_created_by => p_created_by,
538 p_creation_date => p_creation_date,
539 p_last_updated_by => p_last_updated_by,
540 p_last_update_date => p_last_update_date,
541 p_last_update_login => p_lasT_update_login,
542 p_pass => l_pass,
543 p_copy_redo_flag => l_copy_redo_flag
544 );
545 
546 -- If API call returns with an error status...
547 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
548 (l_return_status = FND_API.G_RET_STS_ERROR) then
549 RAISE FND_API.G_EXC_ERROR;
550 end if;
551 
552 p_return_status := FND_API.G_RET_STS_SUCCESS;
553 
554 EXCEPTION
555 WHEN FND_API.G_EXC_ERROR THEN
556 p_return_status := FND_API.G_RET_STS_ERROR;
557 rollback to start_create_relation;
558 WHEN OTHERS THEN
559 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
560 rollback to start_create_relation;
561 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
562 SUBSTR (SQLERRM, 1, 240) );
563 FND_MSG_PUB.Add;
564 end CREATE_REGION_RELATION;
565 
566 --=======================================================
567 --  Procedure   DELETE_FLOW
568 --
569 --  Usage       Group API for deleting a flow
570 --
571 --  Desc        Calls the private API to delete a flow
572 --              with the given key value.
573 --
574 --  Results     The API returns the standard p_return_status parameter
575 --              indicating one of the standard return statuses :
576 --                  * Unexpected error
577 --                  * Error
578 --                  * Success
579 --  Parameters  p_flow_application_id : IN required
580 --              p_flow_code : IN required
581 --                  Key value of the flow to be deleted.
582 --              p_delete_cascade : IN required
583 --                  If p_delete_cascade flag is 'Y', also delete all
584 --                  rows in other tables that references this record.
585 --                  Otherwise, this record will not be deleted if there
586 --                  are any other rows referencing it.
587 --
588 --  Version     Initial version number  =   1.0
589 --  History     Current version number  =   1.0
590 --=======================================================
591 procedure DELETE_FLOW (
592 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
593 p_api_version_number       IN      NUMBER,
594 p_init_msg_tbl             IN      BOOLEAN := FALSE,
595 p_msg_count                OUT NOCOPY     NUMBER,
596 p_msg_data                 OUT NOCOPY     VARCHAR2,
597 p_return_status            OUT NOCOPY     VARCHAR2,
598 p_flow_application_id      IN      NUMBER,
599 p_flow_code                IN      VARCHAR2,
600 p_delete_cascade           IN      VARCHAR2 := 'N'
601 ) is
602 l_api_version_number CONSTANT number := 1.0;
603 l_api_name           CONSTANT varchar2(30) := 'Delete_Flow';
604 l_return_status      VARCHAR2(1);
605 begin
606 -- Check API version number
607 IF NOT FND_API.Compatible_API_Call (
608 l_api_version_number, p_api_version_number, l_api_name,
609 G_PKG_NAME) then
610 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
611 return;
612 END IF;
613 
614 -- Initialize the message table if requested.
615 
616 if p_init_msg_tbl then
617 FND_MSG_PUB.initialize;
618 end if;
619 
620 savepoint start_delete_flow;
621 
622 -- Call private procedure to delete a flow
626 p_msg_count => p_msg_count,
623 AK_FLOW_PVT.DELETE_FLOW (
624 p_validation_level => p_validation_level,
625 p_api_version_number => 1.0,
627 p_msg_data => p_msg_data,
628 p_return_status => l_return_status,
629 p_flow_application_id => p_flow_application_id,
630 p_flow_code => p_flow_code,
631 p_delete_cascade => p_delete_cascade
632 );
633 
634 -- If API call returns with an error status...
635 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
636 (l_return_status = FND_API.G_RET_STS_ERROR) then
637 RAISE FND_API.G_EXC_ERROR;
638 end if;
639 
640 p_return_status := FND_API.G_RET_STS_SUCCESS;
641 
642 EXCEPTION
643 WHEN FND_API.G_EXC_ERROR THEN
644 p_return_status := FND_API.G_RET_STS_ERROR;
645 rollback to start_delete_flow;
646 WHEN OTHERS THEN
647 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
648 rollback to start_delete_flow;
649 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
650 SUBSTR (SQLERRM, 1, 240) );
651 FND_MSG_PUB.Add;
652 end DELETE_FLOW;
653 
654 --=======================================================
655 --  Procedure   DELETE_PAGE
656 --
657 --  Usage       Group API for deleting a flow page
658 --
659 --  Desc        Calls the private API to delete a flow page
660 --              with the given key value.
661 --
662 --  Results     The API returns the standard p_return_status parameter
663 --              indicating one of the standard return statuses :
664 --                  * Unexpected error
665 --                  * Error
666 --                  * Success
667 --  Parameters  p_flow_application_id : IN required
668 --              p_flow_code : IN required
669 --              p_page_application_id : IN required
670 --              p_page_code : IN required
671 --                  Key value of the flow page to be deleted.
672 --              p_delete_cascade : IN required
673 --                  If p_delete_cascade flag is 'Y', also delete all
674 --                  rows in other tables that references this record.
675 --                  Otherwise, this record will not be deleted if there
676 --                  are any other rows referencing it.
677 --
678 --  Version     Initial version number  =   1.0
679 --  History     Current version number  =   1.0
680 --=======================================================
681 procedure DELETE_PAGE (
682 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
683 p_api_version_number       IN      NUMBER,
684 p_init_msg_tbl             IN      BOOLEAN := FALSE,
685 p_msg_count                OUT NOCOPY     NUMBER,
686 p_msg_data                 OUT NOCOPY     VARCHAR2,
687 p_return_status            OUT NOCOPY     VARCHAR2,
688 p_flow_application_id      IN      NUMBER,
689 p_flow_code                IN      VARCHAR2,
690 p_page_application_id      IN      NUMBER,
691 p_page_code                IN      VARCHAR2,
692 p_delete_cascade           IN      VARCHAR2 := 'N'
693 ) is
694 l_api_version_number CONSTANT number := 1.0;
695 l_api_name           CONSTANT varchar2(30) := 'Delete_Page';
696 l_return_status      VARCHAR2(1);
697 begin
698 -- Check API version number
699 IF NOT FND_API.Compatible_API_Call (
700 l_api_version_number, p_api_version_number, l_api_name,
701 G_PKG_NAME) then
702 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
703 return;
704 END IF;
705 
706 -- Initialize the message table if requested.
707 
708 if p_init_msg_tbl then
709 FND_MSG_PUB.initialize;
710 end if;
711 
712 savepoint start_delete_page;
713 
714 -- Call private procedure to delete a page
715 AK_FLOW_PVT.DELETE_PAGE (
716 p_validation_level => p_validation_level,
717 p_api_version_number => 1.0,
718 p_msg_count => p_msg_count,
719 p_msg_data => p_msg_data,
720 p_return_status => l_return_status,
721 p_flow_application_id => p_flow_application_id,
722 p_flow_code => p_flow_code,
723 p_page_application_id => p_page_application_id,
724 p_page_code => p_page_code,
725 p_delete_cascade => p_delete_cascade
726 );
727 
728 -- If API call returns with an error status...
729 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
730 (l_return_status = FND_API.G_RET_STS_ERROR) then
731 RAISE FND_API.G_EXC_ERROR;
732 end if;
733 
734 p_return_status := FND_API.G_RET_STS_SUCCESS;
735 
736 EXCEPTION
737 WHEN FND_API.G_EXC_ERROR THEN
738 p_return_status := FND_API.G_RET_STS_ERROR;
739 rollback to start_delete_page;
740 WHEN OTHERS THEN
741 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
742 rollback to start_delete_page;
743 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
744 SUBSTR (SQLERRM, 1, 240) );
745 FND_MSG_PUB.Add;
746 end DELETE_PAGE;
747 
748 --=======================================================
749 --  Procedure   DELETE_PAGE_REGION
750 --
751 --  Usage       Group API for deleting a flow page region
752 --
753 --  Desc        Calls the private API to delete a flow page
754 --              region with the given key value.
755 --
756 --  Results     The API returns the standard p_return_status parameter
757 --              indicating one of the standard return statuses :
758 --                  * Unexpected error
759 --                  * Error
760 --                  * Success
761 --  Parameters  p_flow_application_id : IN required
765 --              p_region_application_id : IN required
762 --              p_flow_code : IN required
763 --              p_page_application_id : IN required
764 --              p_page_code : IN required
766 --              p_region_code : IN required
767 --                  Key value of the flow page region to be deleted.
768 --              p_delete_cascade : IN required
769 --                  If p_delete_cascade flag is 'Y', also delete all
770 --                  rows in other tables that references this record.
771 --                  Otherwise, this record will not be deleted if there
772 --                  are any other rows referencing it.
773 --
774 --  Version     Initial version number  =   1.0
775 --  History     Current version number  =   1.0
776 --=======================================================
777 procedure DELETE_PAGE_REGION (
778 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
779 p_api_version_number       IN      NUMBER,
780 p_init_msg_tbl             IN      BOOLEAN := FALSE,
781 p_msg_count                OUT NOCOPY     NUMBER,
782 p_msg_data                 OUT NOCOPY     VARCHAR2,
783 p_return_status            OUT NOCOPY     VARCHAR2,
784 p_flow_application_id      IN      NUMBER,
785 p_flow_code                IN      VARCHAR2,
786 p_page_application_id      IN      NUMBER,
787 p_page_code                IN      VARCHAR2,
788 p_region_application_id    IN      NUMBER,
789 p_region_code              IN      VARCHAR2,
790 p_delete_cascade           IN      VARCHAR2 := 'N'
791 ) is
792 l_api_version_number CONSTANT number := 1.0;
793 l_api_name           CONSTANT varchar2(30) := 'Delete_Page_Region';
794 l_return_status      VARCHAR2(1);
795 begin
796 -- Check API version number
797 IF NOT FND_API.Compatible_API_Call (
798 l_api_version_number, p_api_version_number, l_api_name,
799 G_PKG_NAME) then
800 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
801 return;
802 END IF;
803 
804 -- Initialize the message table if requested.
805 
806 if p_init_msg_tbl then
807 FND_MSG_PUB.initialize;
808 end if;
809 
810 savepoint start_delete_page_region;
811 
812 -- Call private procedure to create a page region
813 AK_FLOW_PVT.DELETE_PAGE_REGION (
814 p_validation_level => p_validation_level,
815 p_api_version_number => 1.0,
816 p_msg_count => p_msg_count,
817 p_msg_data => p_msg_data,
818 p_return_status => l_return_status,
819 p_flow_application_id => p_flow_application_id,
820 p_flow_code => p_flow_code,
821 p_page_application_id => p_page_application_id,
822 p_page_code => p_page_code,
823 p_region_application_id => p_region_application_id,
824 p_region_code => p_region_code,
825 p_delete_cascade => p_delete_cascade
826 );
827 
828 -- If API call returns with an error status...
829 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
830 (l_return_status = FND_API.G_RET_STS_ERROR) then
831 RAISE FND_API.G_EXC_ERROR;
832 end if;
833 
834 p_return_status := FND_API.G_RET_STS_SUCCESS;
835 
836 EXCEPTION
837 WHEN FND_API.G_EXC_ERROR THEN
838 p_return_status := FND_API.G_RET_STS_ERROR;
839 rollback to start_delete_page_region;
840 WHEN OTHERS THEN
841 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
842 rollback to start_delete_page_region;
843 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
844 SUBSTR (SQLERRM, 1, 240) );
845 FND_MSG_PUB.Add;
846 end DELETE_PAGE_REGION;
847 
848 --=======================================================
849 --  Procedure   DELETE_PAGE_REGION_ITEM
850 --
851 --  Usage       Group API for deleting a flow page region item
852 --
853 --  Desc        Calls the private API to delete a flow page
854 --              region item with the given key value.
855 --
856 --  Results     The API returns the standard p_return_status parameter
857 --              indicating one of the standard return statuses :
858 --                  * Unexpected error
859 --                  * Error
860 --                  * Success
861 --  Parameters  p_flow_application_id : IN required
862 --              p_flow_code : IN required
863 --              p_page_application_id : IN required
864 --              p_page_code : IN required
865 --              p_region_application_id : IN required
866 --              p_region_code : IN required
867 --              p_attribute_application_id : IN required
868 --              p_attribute_code : IN required
869 --                  Key value of the flow page region item to be deleted.
870 --              p_delete_cascade : IN required
871 --                  If p_delete_cascade flag is 'Y', also delete all
872 --                  rows in other tables that references this record.
873 --                  Otherwise, this record will not be deleted if there
874 --                  are any other rows referencing it.
875 --
876 --  Version     Initial version number  =   1.0
877 --  History     Current version number  =   1.0
878 --=======================================================
879 procedure DELETE_PAGE_REGION_ITEM (
880 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
881 p_api_version_number       IN      NUMBER,
882 p_init_msg_tbl             IN      BOOLEAN := FALSE,
883 p_msg_count                OUT NOCOPY     NUMBER,
884 p_msg_data                 OUT NOCOPY     VARCHAR2,
885 p_return_status            OUT NOCOPY     VARCHAR2,
889 p_page_code                IN      VARCHAR2,
886 p_flow_application_id      IN      NUMBER,
887 p_flow_code                IN      VARCHAR2,
888 p_page_application_id      IN      NUMBER,
890 p_region_application_id    IN      NUMBER,
891 p_region_code              IN      VARCHAR2,
892 p_attribute_application_id IN      NUMBER,
893 p_attribute_code           IN      VARCHAR2,
894 p_delete_cascade           IN      VARCHAR2 := 'N'
895 ) is
896 l_api_version_number CONSTANT number := 1.0;
897 l_api_name           CONSTANT varchar2(30) := 'Delete_Page_Region_Item';
898 l_return_status      VARCHAR2(1);
899 begin
900 -- Check API version number
901 IF NOT FND_API.Compatible_API_Call (
902 l_api_version_number, p_api_version_number, l_api_name,
903 G_PKG_NAME) then
904 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
905 return;
906 END IF;
907 
908 -- Initialize the message table if requested.
909 
910 if p_init_msg_tbl then
911 FND_MSG_PUB.initialize;
912 end if;
913 
914 savepoint start_delete_item;
915 
916 -- Call private procedure to delete a page region item
917 AK_FLOW_PVT.DELETE_PAGE_REGION_ITEM (
918 p_validation_level => p_validation_level,
919 p_api_version_number => 1.0,
920 p_msg_count => p_msg_count,
921 p_msg_data => p_msg_data,
922 p_return_status => l_return_status,
923 p_flow_application_id => p_flow_application_id,
924 p_flow_code => p_flow_code,
925 p_page_application_id => p_page_application_id,
926 p_page_code => p_page_code,
927 p_region_application_id => p_region_application_id,
928 p_region_code => p_region_code,
929 p_attribute_application_id => p_attribute_application_id,
930 p_attribute_code => p_attribute_code,
931 p_delete_cascade => p_delete_cascade
932 );
933 
934 -- If API call returns with an error status...
935 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
936 (l_return_status = FND_API.G_RET_STS_ERROR) then
937 RAISE FND_API.G_EXC_ERROR;
938 end if;
939 
940 p_return_status := FND_API.G_RET_STS_SUCCESS;
941 
942 EXCEPTION
943 WHEN FND_API.G_EXC_ERROR THEN
944 p_return_status := FND_API.G_RET_STS_ERROR;
945 rollback to start_delete_item;
946 WHEN OTHERS THEN
947 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
948 rollback to start_delete_item;
949 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
950 SUBSTR (SQLERRM, 1, 240) );
951 FND_MSG_PUB.Add;
952 end DELETE_PAGE_REGION_ITEM;
953 
954 --=======================================================
955 --  Procedure   DELETE_REGION_RELATION
956 --
957 --  Usage       Group API for deleting a flow region relation
958 --
959 --  Desc        Calls the private API to delete a flow region
960 --              relation with the given key value.
961 --
962 --  Results     The API returns the standard p_return_status parameter
963 --              indicating one of the standard return statuses :
964 --                  * Unexpected error
965 --                  * Error
966 --                  * Success
967 --  Parameters  p_flow_application_id : IN required
968 --              p_flow_code : IN required
969 --              p_foreign_key_name : IN required
970 --              p_from_page_appl_id : IN required
971 --              p_from_page_code : IN required
972 --              p_from_region_appl_id : IN required
973 --              p_from_region_code : IN required
974 --              p_to_page_appl_id : IN required
975 --              p_to_page_code : IN required
976 --              p_to_region_appl_id : IN required
977 --              p_to_region_code : IN required
978 --                  Key value of the flow page region item to be deleted.
979 --              p_delete_cascade : IN required
980 --                  If p_delete_cascade flag is 'Y', also delete all
981 --                  rows in other tables that references this record.
982 --                  Otherwise, this record will not be deleted if there
983 --                  are any other rows referencing it.
984 --
985 --  Version     Initial version number  =   1.0
986 --  History     Current version number  =   1.0
987 --=======================================================
988 procedure DELETE_REGION_RELATION (
989 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
990 p_api_version_number       IN      NUMBER,
991 p_init_msg_tbl             IN      BOOLEAN := FALSE,
992 p_msg_count                OUT NOCOPY     NUMBER,
993 p_msg_data                 OUT NOCOPY     VARCHAR2,
994 p_return_status            OUT NOCOPY     VARCHAR2,
995 p_flow_application_id      IN      NUMBER,
996 p_flow_code                IN      VARCHAR2,
997 p_foreign_key_name         IN      VARCHAR2,
998 p_from_page_appl_id        IN      NUMBER,
999 p_from_page_code           IN      VARCHAR2,
1000 p_from_region_appl_id      IN      NUMBER,
1001 p_from_region_code         IN      VARCHAR2,
1002 p_to_page_appl_id          IN      NUMBER,
1003 p_to_page_code             IN      VARCHAR2,
1004 p_to_region_appl_id        IN      NUMBER,
1005 p_to_region_code           IN      VARCHAR2,
1006 p_delete_cascade           IN      VARCHAR2 := 'N'
1007 ) is
1008 l_api_version_number CONSTANT number := 1.0;
1009 l_api_name           CONSTANT varchar2(30) := 'Delete_Region_Relation';
1010 l_return_status      VARCHAR2(1);
1011 begin
1012 -- Check API version number
1013 IF NOT FND_API.Compatible_API_Call (
1017 return;
1014 l_api_version_number, p_api_version_number, l_api_name,
1015 G_PKG_NAME) then
1016 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1018 END IF;
1019 
1020 -- Initialize the message table if requested.
1021 
1022 if p_init_msg_tbl then
1023 FND_MSG_PUB.initialize;
1024 end if;
1025 
1026 savepoint start_delete_relation;
1027 
1028 -- Call private procedure to delete a flow region relation
1029 AK_FLOW_PVT.DELETE_REGION_RELATION (
1030 p_validation_level => p_validation_level,
1031 p_api_version_number => 1.0,
1032 p_msg_count => p_msg_count,
1033 p_msg_data => p_msg_data,
1034 p_return_status => l_return_status,
1035 p_flow_application_id => p_flow_application_id,
1036 p_flow_code => p_flow_code,
1037 p_foreign_key_name => p_foreign_key_name,
1038 p_from_page_appl_id => p_from_page_appl_id,
1039 p_from_page_code => p_from_page_code,
1040 p_from_region_appl_id => p_from_region_appl_id,
1041 p_from_region_code => p_from_region_code,
1042 p_to_page_appl_id => p_to_page_appl_id,
1043 p_to_page_code => p_to_page_code,
1044 p_to_region_appl_id => p_to_region_appl_id,
1045 p_to_region_code => p_to_region_code,
1046 p_delete_cascade => p_delete_cascade
1047 );
1048 
1049 -- If API call returns with an error status...
1050 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
1051 (l_return_status = FND_API.G_RET_STS_ERROR) then
1052 RAISE FND_API.G_EXC_ERROR;
1053 end if;
1054 
1055 p_return_status := FND_API.G_RET_STS_SUCCESS;
1056 
1057 EXCEPTION
1058 WHEN FND_API.G_EXC_ERROR THEN
1059 p_return_status := FND_API.G_RET_STS_ERROR;
1060 rollback to start_delete_relation;
1061 WHEN OTHERS THEN
1062 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1063 rollback to start_delete_relation;
1064 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
1065 SUBSTR (SQLERRM, 1, 240) );
1066 FND_MSG_PUB.Add;
1067 end DELETE_REGION_RELATION;
1068 
1069 --===========================================================
1070 --  Procedure   DOWNLOAD_FLOW
1071 --
1072 --  Usage       Group API for downloading flows
1073 --
1074 --  Desc        This API first write out standard loader
1075 --              file header for flows to a flat file.
1076 --              Then it calls the private API to extract the
1077 --              flows selected by application ID or by
1078 --              key values from the database to the output file.
1079 --              If a flow is selected for writing to the loader
1080 --              file, all its children records (including flow
1081 --              pages, flow page regions, flow page region items,
1082 --              and flow region relations) will also be written.
1083 --
1084 --  Results     The API returns the standard p_return_status parameter
1085 --              indicating one of the standard return statuses :
1086 --                  * Unexpected error
1087 --                  * Error
1088 --                  * Success
1089 --  Parameters  p_directory : IN optional
1090 --                  Specifies to which directory the output file should
1091 --                  be written to. Defaults to value of profile
1092 --                  UTL_FILE_OUT if none is specified
1093 --              p_filename : IN required
1094 --                  The file name of the output file to be written.
1095 --                  Existing file with same name will be overwritten.
1096 --              p_nls_language : IN optional
1097 --                  NLS language for database. If none if given,
1098 --                  the current NLS language will be used.
1099 --
1100 --              One of the following parameters must be provided:
1101 --
1102 --              p_application_id : IN optional
1103 --                  If given, all attributes for this application ID
1104 --                  will be written to the output file.
1105 --              p_application_short_name : IN optional
1106 --                  If given, all attributes for this application short
1107 --                  name will be written to the output file.
1108 --                  Application short name will be ignored if an
1109 --                  application ID is given.
1110 --              p_flow_pk_tbl : IN optional
1111 --                  If given, only flows whose key values are
1112 --                  included in this table will be written to the
1113 --                  output file.
1114 --
1115 --
1116 --  Version     Initial version number  =   1.0
1117 --  History     Current version number  =   1.0
1118 --===========================================================
1119 procedure DOWNLOAD_FLOW (
1120 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
1121 p_api_version_number       IN      NUMBER,
1122 p_init_msg_tbl             IN      BOOLEAN := FALSE,
1123 p_msg_count                OUT NOCOPY     NUMBER,
1124 p_msg_data                 OUT NOCOPY     VARCHAR2,
1125 p_return_status            OUT NOCOPY     VARCHAR2,
1126 p_nls_language             IN      VARCHAR2 := FND_API.G_MISS_CHAR,
1127 p_application_id           IN      NUMBER := FND_API.G_MISS_NUM,
1128 p_application_short_name   IN      VARCHAR2 := FND_API.G_MISS_CHAR,
1129 p_flow_pk_tbl              IN      AK_FLOW_PUB.Flow_PK_Tbl_Type
1130 := AK_FLOW_PUB.G_MISS_FLOW_PK_TBL
1131 ) is
1132 l_api_version_number CONSTANT number := 1.0;
1133 l_api_name           CONSTANT varchar2(30) := 'Download_Flow';
1134 l_application_id     number;
1135 l_buffer_tbl         AK_ON_OBJECTS_PUB.Buffer_Tbl_Type;
1136 l_index              NUMBER;
1140 begin
1137 l_index_out          NUMBER;
1138 l_nls_language       VARCHAR2(30);
1139 l_return_status      varchar2(1);
1141 
1142 -- Check verion number
1143 IF NOT FND_API.Compatible_API_Call (
1144 l_api_version_number, p_api_version_number, l_api_name,
1145 G_PKG_NAME) then
1146 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1147 return;
1148 END IF;
1149 
1150 -- Initialize the message table if requested.
1151 
1152 if p_init_msg_tbl then
1153 FND_MSG_PUB.initialize;
1154 end if;
1155 
1156 savepoint Start_download;
1157 
1158 if (AK_DOWNLOAD_GRP.G_WRITE_HEADER) then
1159 
1160 -- Call private download procedure to verify parameters,
1161 -- load application ID, and write header information such
1162 -- as nls_language and codeset to data file.
1163 AK_ON_OBJECTS_PVT.download_header(
1164 p_validation_level => p_validation_level,
1165 p_api_version_number => 1.0,
1166 p_return_status => l_return_status,
1167 p_nls_language => p_nls_language,
1168 p_application_id => p_application_id,
1169 p_application_short_name => p_application_short_name,
1170 p_table_size => p_flow_pk_tbl.count,
1171 p_download_by_object => AK_ON_OBJECTS_PVT.G_FLOW,
1172 p_nls_language_out => l_nls_language,
1173 p_application_id_out => l_application_id
1174 );
1175 else
1176 l_application_id := p_application_id;
1177 select userenv('LANG') into l_nls_language
1178 from dual;
1179 end if;
1180 
1181 -- If API call returns with an error status...
1182 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
1183 (l_return_status = FND_API.G_RET_STS_ERROR) then
1184 --dbms_output.put_line(G_PKG_NAME || ' download_header failed');
1185 RAISE FND_API.G_EXC_ERROR;
1186 end if;
1187 
1188 -- - call the download procedure for flows to retrieve the
1189 --   selected flows from the database into a table of type
1190 --   AK_ON_OBJECTS_PUB.Buffer_Tbl_Type.
1191 AK_FLOW2_PVT.DOWNLOAD_FLOW (
1192 p_validation_level => p_validation_level,
1193 p_api_version_number => 1.0,
1194 p_return_status => l_return_status,
1195 p_application_id => l_application_id,
1196 p_flow_pk_tbl => p_flow_pk_tbl,
1197 p_nls_language => l_nls_language
1198 );
1199 
1200 -- If download call returns with an error status or
1201 -- download failed to retrieve any information from the database..
1202 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
1203 (l_return_status = FND_API.G_RET_STS_ERROR) then
1204 -- dbms_output.put_line(G_PKG_NAME || 'download flow returned error:' ||
1205 --                     l_return_status);
1206 RAISE FND_API.G_EXC_ERROR;
1207 end if;
1208 
1209 p_return_status := FND_API.G_RET_STS_SUCCESS;
1210 
1211 FND_MSG_PUB.Count_And_Get (
1212 p_count => p_msg_count,
1213 p_data => p_msg_data);
1214 
1215 EXCEPTION
1216 WHEN FND_API.G_EXC_ERROR THEN
1217 rollback to Start_download;
1218 p_return_status := FND_API.G_RET_STS_ERROR;
1219 FND_MSG_PUB.Count_And_Get (
1220 p_count => p_msg_count,
1221 p_data => p_msg_data);
1222 WHEN OTHERS THEN
1223 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1224 rollback to Start_download;
1225 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
1226 SUBSTR (SQLERRM, 1, 240) );
1227 FND_MSG_PUB.Add;
1228 FND_MSG_PUB.Count_And_Get (
1229 p_count => p_msg_count,
1230 p_data => p_msg_data);
1231 
1232 end DOWNLOAD_FLOW;
1233 
1234 --=======================================================
1235 --  Procedure   UPDATE_FLOW
1236 --
1237 --  Usage       Group API for updating a flow
1238 --
1239 --  Desc        This API calls the private API to update
1240 --              a flow using the given info
1241 --
1242 --  Results     The API returns the standard p_return_status parameter
1243 --              indicating one of the standard return statuses :
1244 --                  * Unexpected error
1245 --                  * Error
1246 --                  * Success
1247 --  Parameters  Flow columns
1248 --
1249 --  Version     Initial version number  =   1.0
1250 --  History     Current version number  =   1.0
1251 --=======================================================
1252 procedure UPDATE_FLOW (
1253 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
1254 p_api_version_number       IN      NUMBER,
1255 p_init_msg_tbl             IN      BOOLEAN := FALSE,
1256 p_msg_count                OUT NOCOPY     NUMBER,
1257 p_msg_data                 OUT NOCOPY     VARCHAR2,
1258 p_return_status            OUT NOCOPY     VARCHAR2,
1259 p_flow_application_id      IN      NUMBER,
1260 p_flow_code                IN      VARCHAR2,
1261 p_primary_page_appl_id     IN      NUMBER := FND_API.G_MISS_NUM,
1262 p_primary_page_code        IN      VARCHAR2 := FND_API.G_MISS_CHAR,
1263 p_name                     IN      VARCHAR2 := FND_API.G_MISS_CHAR,
1264 p_description              IN      VARCHAR2 := FND_API.G_MISS_CHAR,
1265 p_created_by               IN     NUMBER := FND_API.G_MISS_NUM,
1266 p_creation_date            IN      DATE := FND_API.G_MISS_DATE,
1267 p_last_updated_by          IN     NUMBER := FND_API.G_MISS_NUM,
1268 p_last_update_date         IN      DATE := FND_API.G_MISS_DATE,
1269 p_last_update_login        IN     NUMBER := FND_API.G_MISS_NUM
1270 ) is
1271 l_api_version_number CONSTANT number := 1.0;
1272 l_api_name           CONSTANT varchar2(30) := 'Update_Flow';
1273 l_return_status      VARCHAR2(1);
1277 -- Check API version number
1274 l_pass               NUMBER := 2;
1275 l_copy_redo_flag     BOOLEAN := FALSE;
1276 begin
1278 IF NOT FND_API.Compatible_API_Call (
1279 l_api_version_number, p_api_version_number, l_api_name,
1280 G_PKG_NAME) then
1281 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1282 return;
1283 END IF;
1284 
1285 -- Initialize the message table if requested.
1286 
1287 if p_init_msg_tbl then
1288 FND_MSG_PUB.initialize;
1289 end if;
1290 
1291 savepoint start_update_flow;
1292 
1293 -- Call private procedure to update a flow
1294 AK_FLOW_PVT.UPDATE_FLOW (
1295 p_validation_level => p_validation_level,
1296 p_api_version_number => 1.0,
1297 p_msg_count => p_msg_count,
1298 p_msg_data => p_msg_data,
1299 p_return_status => l_return_status,
1300 p_flow_application_id => p_flow_application_id,
1301 p_flow_code => p_flow_code,
1302 p_primary_page_appl_id => p_primary_page_appl_id,
1303 p_primary_page_code => p_primary_page_code,
1304 p_name => p_name,
1305 p_description => p_description,
1306 p_created_by => p_created_by,
1307 p_creation_date => p_creation_date,
1308 p_last_updated_by => p_last_updated_by,
1309 p_last_update_date => p_last_update_date,
1310 p_last_update_login => p_lasT_update_login,
1311 p_pass => l_pass,
1312 p_copy_redo_flag => l_copy_redo_flag
1313 );
1314 
1315 -- If API call returns with an error status...
1316 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
1317 (l_return_status = FND_API.G_RET_STS_ERROR) then
1318 RAISE FND_API.G_EXC_ERROR;
1319 end if;
1320 
1321 p_return_status := FND_API.G_RET_STS_SUCCESS;
1322 
1323 EXCEPTION
1324 WHEN FND_API.G_EXC_ERROR THEN
1325 p_return_status := FND_API.G_RET_STS_ERROR;
1326 rollback to start_update_flow;
1327 WHEN OTHERS THEN
1328 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1329 rollback to start_update_flow;
1330 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
1331 SUBSTR (SQLERRM, 1, 240) );
1332 FND_MSG_PUB.Add;
1333 end UPDATE_FLOW;
1334 
1335 --=======================================================
1336 --  Procedure   UPDATE_PAGE
1337 --
1338 --  Usage       Group API for updating a flow page
1339 --
1340 --  Desc        This API calls the private API to update
1341 --              a flow page using the given info
1342 --
1343 --  Results     The API returns the standard p_return_status parameter
1344 --              indicating one of the standard return statuses :
1345 --                  * Unexpected error
1346 --                  * Error
1347 --                  * Success
1348 --  Parameters  Flow Page columns
1349 --              p_set_primary_page : IN optional
1350 --                  Set the current page as the primary page of
1351 --                  the flow if this flag is 'Y'.
1352 --
1353 --  Version     Initial version number  =   1.0
1354 --  History     Current version number  =   1.0
1355 --=======================================================
1356 procedure UPDATE_PAGE (
1357 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
1358 p_api_version_number       IN      NUMBER,
1359 p_init_msg_tbl             IN      BOOLEAN := FALSE,
1360 p_msg_count                OUT NOCOPY     NUMBER,
1361 p_msg_data                 OUT NOCOPY     VARCHAR2,
1362 p_return_status            OUT NOCOPY     VARCHAR2,
1363 p_flow_application_id      IN      NUMBER,
1364 p_flow_code                IN      VARCHAR2,
1365 p_page_application_id      IN      NUMBER,
1366 p_page_code                IN      VARCHAR2,
1367 p_primary_region_appl_id   IN      NUMBER := FND_API.G_MISS_NUM,
1368 p_primary_region_code      IN      VARCHAR2 := FND_API.G_MISS_CHAR,
1369 p_name                     IN      VARCHAR2,
1370 p_description              IN      VARCHAR2 := FND_API.G_MISS_CHAR,
1371 p_set_primary_page         IN      VARCHAR2 := FND_API.G_MISS_CHAR,
1372 p_created_by               IN     NUMBER := FND_API.G_MISS_NUM,
1373 p_creation_date            IN      DATE := FND_API.G_MISS_DATE,
1374 p_last_updated_by          IN     NUMBER := FND_API.G_MISS_NUM,
1375 p_last_update_date         IN      DATE := FND_API.G_MISS_DATE,
1376 p_last_update_login        IN     NUMBER := FND_API.G_MISS_NUM
1377 ) is
1378 l_api_version_number CONSTANT number := 1.0;
1379 l_api_name           CONSTANT varchar2(30) := 'Update_Page';
1380 l_return_status      VARCHAR2(1);
1381 l_pass               NUMBER := 2;
1382 l_copy_redo_flag     BOOLEAN := FALSE;
1383 begin
1384 -- Check API version number
1385 IF NOT FND_API.Compatible_API_Call (
1386 l_api_version_number, p_api_version_number, l_api_name,
1387 G_PKG_NAME) then
1388 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1389 return;
1390 END IF;
1391 
1392 -- Initialize the message table if requested.
1393 
1394 if p_init_msg_tbl then
1395 FND_MSG_PUB.initialize;
1396 end if;
1397 
1398 savepoint start_update_page;
1399 
1400 -- Call private procedure to update a page
1401 AK_FLOW_PVT.UPDATE_PAGE (
1402 p_validation_level => p_validation_level,
1403 p_api_version_number => 1.0,
1404 p_msg_count => p_msg_count,
1405 p_msg_data => p_msg_data,
1406 p_return_status => l_return_status,
1407 p_flow_application_id => p_flow_application_id,
1408 p_flow_code => p_flow_code,
1409 p_page_application_id => p_page_application_id,
1410 p_page_code => p_page_code,
1411 p_primary_region_appl_id => p_primary_region_appl_id,
1415 p_set_primary_page => p_set_primary_page,
1412 p_primary_region_code => p_primary_region_code,
1413 p_name => p_name,
1414 p_description => p_description,
1416 p_created_by => p_created_by,
1417 p_creation_date => p_creation_date,
1418 p_last_updated_by => p_last_updated_by,
1419 p_last_update_date => p_last_update_date,
1420 p_last_update_login => p_lasT_update_login,
1421 p_pass => l_pass,
1422 p_copy_redo_flag => l_copy_redo_flag
1423 );
1424 
1425 -- If API call returns with an error status...
1426 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
1427 (l_return_status = FND_API.G_RET_STS_ERROR) then
1428 RAISE FND_API.G_EXC_ERROR;
1429 end if;
1430 
1431 p_return_status := FND_API.G_RET_STS_SUCCESS;
1432 
1433 EXCEPTION
1434 WHEN FND_API.G_EXC_ERROR THEN
1435 p_return_status := FND_API.G_RET_STS_ERROR;
1436 rollback to start_update_page;
1437 WHEN OTHERS THEN
1438 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1439 rollback to start_update_page;
1440 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
1441 SUBSTR (SQLERRM, 1, 240) );
1442 FND_MSG_PUB.Add;
1443 end UPDATE_PAGE;
1444 
1445 --=======================================================
1446 --  Procedure   UPDATE_PAGE_REGION
1447 --
1448 --  Usage       Group API for updating a flow page region
1449 --
1450 --  Desc        This API calls the private API to update
1451 --              a flow page region using the given info
1452 --
1453 --  Results     The API returns the standard p_return_status parameter
1454 --              indicating one of the standard return statuses :
1455 --                  * Unexpected error
1456 --                  * Error
1457 --                  * Success
1458 --  Parameters  Flow Page Region columns
1459 --              p_foreign_key_name : IN optional
1460 --                  If a foreign key name is passed, and that this page
1461 --                  region has a parent region, then this API will
1462 --                  create an intrapage flow region relation connecting
1463 --                  this page region with the parent region using the
1464 --                  foreign key name. If there is already an intrapage
1465 --                  flow region relation exists connecting these two
1466 --                  page regions, it will be replaced by a new one using
1467 --                  this foreign key.
1468 --              p_set_primary_region : IN optional
1469 --                  Set the current page region as the primary region of
1470 --                  the flow page if this flag is 'Y'.
1471 --
1472 --  Version     Initial version number  =   1.0
1473 --  History     Current version number  =   1.0
1474 --=======================================================
1475 procedure UPDATE_PAGE_REGION (
1476 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
1477 p_api_version_number       IN      NUMBER,
1478 p_init_msg_tbl             IN      BOOLEAN := FALSE,
1479 p_msg_count                OUT NOCOPY     NUMBER,
1480 p_msg_data                 OUT NOCOPY     VARCHAR2,
1481 p_return_status            OUT NOCOPY     VARCHAR2,
1482 p_flow_application_id      IN      NUMBER,
1483 p_flow_code                IN      VARCHAR2,
1484 p_page_application_id      IN      NUMBER,
1485 p_page_code                IN      VARCHAR2,
1486 p_region_application_id    IN      NUMBER,
1487 p_region_code              IN      VARCHAR2,
1488 p_display_sequence         IN      NUMBER := FND_API.G_MISS_NUM,
1489 p_region_style             IN      VARCHAR2,
1490 p_num_columns              IN      NUMBER := FND_API.G_MISS_NUM,
1491 p_icx_custom_call          IN      VARCHAR2 := FND_API.G_MISS_CHAR,
1492 p_parent_region_application_id IN  NUMBER := FND_API.G_MISS_NUM,
1493 p_parent_region_code       IN      VARCHAR2 := FND_API.G_MISS_CHAR,
1494 p_foreign_key_name         IN      VARCHAR2 := FND_API.G_MISS_CHAR,
1495 p_set_primary_region       IN      VARCHAR2 := FND_API.G_MISS_CHAR,
1496 p_created_by               IN     NUMBER := FND_API.G_MISS_NUM,
1497 p_creation_date            IN      DATE := FND_API.G_MISS_DATE,
1498 p_last_updated_by          IN     NUMBER := FND_API.G_MISS_NUM,
1499 p_last_update_date         IN      DATE := FND_API.G_MISS_DATE,
1500 p_last_update_login        IN     NUMBER := FND_API.G_MISS_NUM
1501 ) is
1502 l_api_version_number CONSTANT number := 1.0;
1503 l_api_name           CONSTANT varchar2(30) := 'Update_Page_Region';
1504 l_return_status      VARCHAR2(1);
1505 l_pass               NUMBER := 2;
1506 l_copy_redo_flag     BOOLEAN := FALSE;
1507 begin
1508 -- Check API version number
1509 IF NOT FND_API.Compatible_API_Call (
1510 l_api_version_number, p_api_version_number, l_api_name,
1511 G_PKG_NAME) then
1512 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1513 return;
1514 END IF;
1515 
1516 -- Initialize the message table if requested.
1517 
1518 if p_init_msg_tbl then
1519 FND_MSG_PUB.initialize;
1520 end if;
1521 
1522 savepoint start_update_page_region;
1523 
1524 -- Call private procedure to update a page region
1525 AK_FLOW_PVT.UPDATE_PAGE_REGION (
1526 p_validation_level => p_validation_level,
1527 p_api_version_number => 1.0,
1528 p_msg_count => p_msg_count,
1529 p_msg_data => p_msg_data,
1530 p_return_status => l_return_status,
1531 p_flow_application_id => p_flow_application_id,
1532 p_flow_code => p_flow_code,
1533 p_page_application_id => p_page_application_id,
1534 p_page_code => p_page_code,
1535 p_region_application_id => p_region_application_id,
1539 p_num_columns => p_num_columns,
1536 p_region_code => p_region_code,
1537 p_display_sequence => p_display_sequence,
1538 p_region_style => p_region_style,
1540 p_icx_custom_call => p_icx_custom_call,
1541 p_parent_region_application_id => p_parent_region_application_id,
1542 p_parent_region_code => p_parent_region_code,
1543 p_foreign_key_name => p_foreign_key_name,
1544 p_set_primary_region => p_set_primary_region,
1545 p_created_by => p_created_by,
1546 p_creation_date => p_creation_date,
1547 p_last_updated_by => p_last_updated_by,
1548 p_last_update_date => p_last_update_date,
1549 p_last_update_login => p_lasT_update_login,
1550 p_pass => l_pass,
1551 p_copy_redo_flag => l_copy_redo_flag
1552 );
1553 
1554 -- If API call returns with an error status...
1555 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
1556 (l_return_status = FND_API.G_RET_STS_ERROR) then
1557 RAISE FND_API.G_EXC_ERROR;
1558 end if;
1559 
1560 p_return_status := FND_API.G_RET_STS_SUCCESS;
1561 
1562 EXCEPTION
1563 WHEN FND_API.G_EXC_ERROR THEN
1564 p_return_status := FND_API.G_RET_STS_ERROR;
1565 rollback to start_update_page_region;
1566 WHEN OTHERS THEN
1567 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1568 rollback to start_update_page_region;
1569 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
1570 SUBSTR (SQLERRM, 1, 240) );
1571 FND_MSG_PUB.Add;
1572 end UPDATE_PAGE_REGION;
1573 
1574 --=======================================================
1575 --  Procedure   UPDATE_PAGE_REGION_ITEM
1576 --
1577 --  Usage       Group API for updating a flow page region item
1578 --
1579 --  Desc        This API calls the private API to update
1580 --              a flow page region item using the given info
1581 --
1582 --  Results     The API returns the standard p_return_status parameter
1583 --              indicating one of the standard return statuses :
1584 --                  * Unexpected error
1585 --                  * Error
1586 --                  * Success
1587 --  Parameters  Flow Page Region Item columns
1588 --
1589 --  Version     Initial version number  =   1.0
1590 --  History     Current version number  =   1.0
1591 --=======================================================
1592 procedure UPDATE_PAGE_REGION_ITEM (
1593 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
1594 p_api_version_number       IN      NUMBER,
1595 p_init_msg_tbl             IN      BOOLEAN := FALSE,
1596 p_msg_count                OUT NOCOPY     NUMBER,
1597 p_msg_data                 OUT NOCOPY     VARCHAR2,
1598 p_return_status            OUT NOCOPY     VARCHAR2,
1599 p_flow_application_id      IN      NUMBER,
1600 p_flow_code                IN      VARCHAR2,
1601 p_page_application_id      IN      NUMBER,
1602 p_page_code                IN      VARCHAR2,
1603 p_region_application_id    IN      NUMBER,
1604 p_region_code              IN      VARCHAR2,
1605 p_attribute_application_id IN      NUMBER,
1606 p_attribute_code           IN      VARCHAR2,
1607 p_to_page_appl_id          IN      NUMBER := FND_API.G_MISS_NUM,
1608 p_to_page_code             IN      VARCHAR2 := FND_API.G_MISS_CHAR,
1609 p_to_url_attribute_appl_id IN      NUMBER := FND_API.G_MISS_NUM,
1610 p_to_url_attribute_code    IN      VARCHAR2 := FND_API.G_MISS_CHAR,
1611 p_created_by               IN     NUMBER := FND_API.G_MISS_NUM,
1612 p_creation_date            IN      DATE := FND_API.G_MISS_DATE,
1613 p_last_updated_by          IN     NUMBER := FND_API.G_MISS_NUM,
1614 p_last_update_date         IN      DATE := FND_API.G_MISS_DATE,
1615 p_last_update_login        IN     NUMBER := FND_API.G_MISS_NUM
1616 ) is
1617 l_api_version_number CONSTANT number := 1.0;
1618 l_api_name           CONSTANT varchar2(30) := 'Update_Page_Region_Item';
1619 l_return_status      VARCHAR2(1);
1620 l_pass               NUMBER := 2;
1621 l_copy_redo_flag     BOOLEAN := FALSE;
1622 begin
1623 -- Check API version number
1624 IF NOT FND_API.Compatible_API_Call (
1625 l_api_version_number, p_api_version_number, l_api_name,
1626 G_PKG_NAME) then
1627 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1628 return;
1629 END IF;
1630 
1631 -- Initialize the message table if requested.
1632 
1633 if p_init_msg_tbl then
1634 FND_MSG_PUB.initialize;
1635 end if;
1636 
1637 savepoint start_update_item;
1638 
1639 -- Call private procedure to update a page region item
1640 AK_FLOW_PVT.UPDATE_PAGE_REGION_ITEM (
1641 p_validation_level => p_validation_level,
1642 p_api_version_number => 1.0,
1643 p_msg_count => p_msg_count,
1644 p_msg_data => p_msg_data,
1645 p_return_status => l_return_status,
1646 p_flow_application_id => p_flow_application_id,
1647 p_flow_code => p_flow_code,
1648 p_page_application_id => p_page_application_id,
1649 p_page_code => p_page_code,
1650 p_region_application_id => p_region_application_id,
1651 p_region_code => p_region_code,
1652 p_attribute_application_id => p_attribute_application_id,
1653 p_attribute_code => p_attribute_code,
1654 p_to_page_appl_id => p_to_page_appl_id,
1655 p_to_page_code => p_to_page_code,
1656 p_to_url_attribute_appl_id => p_to_url_attribute_appl_id,
1657 p_to_url_attribute_code => p_to_url_attribute_code,
1658 p_created_by => p_created_by,
1659 p_creation_date => p_creation_date,
1660 p_last_updated_by => p_last_updated_by,
1661 p_last_update_date => p_last_update_date,
1662 p_last_update_login => p_lasT_update_login,
1663 p_pass => l_pass,
1664 p_copy_redo_flag => l_copy_redo_flag
1665 );
1669 (l_return_status = FND_API.G_RET_STS_ERROR) then
1666 
1667 -- If API call returns with an error status...
1668 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
1670 RAISE FND_API.G_EXC_ERROR;
1671 end if;
1672 
1673 p_return_status := FND_API.G_RET_STS_SUCCESS;
1674 
1675 EXCEPTION
1676 WHEN FND_API.G_EXC_ERROR THEN
1677 p_return_status := FND_API.G_RET_STS_ERROR;
1678 rollback to start_update_item;
1679 WHEN OTHERS THEN
1680 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1681 rollback to start_update_item;
1682 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
1683 SUBSTR (SQLERRM, 1, 240) );
1684 FND_MSG_PUB.Add;
1685 end UPDATE_PAGE_REGION_ITEM;
1686 
1687 --=======================================================
1688 --  Procedure   UPDATE_REGION_RELATION
1689 --
1690 --  Usage       Group API for updating a flow region relation
1691 --
1692 --  Desc        This API calls the private API to update
1693 --              a flow region relation using the given info
1694 --
1695 --  Results     The API returns the standard p_return_status parameter
1696 --              indicating one of the standard return statuses :
1697 --                  * Unexpected error
1698 --                  * Error
1699 --                  * Success
1700 --  Parameters  Flow Region Relation columns
1701 --
1702 --  Version     Initial version number  =   1.0
1703 --  History     Current version number  =   1.0
1704 --=======================================================
1705 procedure UPDATE_REGION_RELATION (
1706 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
1707 p_api_version_number       IN      NUMBER,
1708 p_init_msg_tbl             IN      BOOLEAN := FALSE,
1709 p_msg_count                OUT NOCOPY     NUMBER,
1710 p_msg_data                 OUT NOCOPY     VARCHAR2,
1711 p_return_status            OUT NOCOPY     VARCHAR2,
1712 p_flow_application_id      IN      NUMBER,
1713 p_flow_code                IN      VARCHAR2,
1714 p_foreign_key_name         IN      VARCHAR2,
1715 p_from_page_appl_id        IN      NUMBER,
1716 p_from_page_code           IN      VARCHAR2,
1717 p_from_region_appl_id      IN      NUMBER,
1718 p_from_region_code         IN      VARCHAR2,
1719 p_to_page_appl_id          IN      NUMBER,
1720 p_to_page_code             IN      VARCHAR2,
1721 p_to_region_appl_id        IN      NUMBER,
1722 p_to_region_code           IN      VARCHAR2,
1723 p_application_id           IN      NUMBER,
1724 p_created_by               IN     NUMBER := FND_API.G_MISS_NUM,
1725 p_creation_date            IN      DATE := FND_API.G_MISS_DATE,
1726 p_last_updated_by          IN     NUMBER := FND_API.G_MISS_NUM,
1727 p_last_update_date         IN      DATE := FND_API.G_MISS_DATE,
1728 p_last_update_login        IN     NUMBER := FND_API.G_MISS_NUM
1729 ) is
1730 l_api_version_number CONSTANT number := 1.0;
1731 l_api_name           CONSTANT varchar2(30) := 'Update_Region_Relation';
1732 l_return_status      VARCHAR2(1);
1733 l_pass               NUMBER := 2;
1734 l_copy_redo_flag     BOOLEAN := FALSE;
1735 begin
1736 -- Check API version number
1737 IF NOT FND_API.Compatible_API_Call (
1738 l_api_version_number, p_api_version_number, l_api_name,
1739 G_PKG_NAME) then
1740 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1741 return;
1742 END IF;
1743 
1744 -- Initialize the message table if requested.
1745 
1746 if p_init_msg_tbl then
1747 FND_MSG_PUB.initialize;
1748 end if;
1749 
1750 savepoint start_update_relation;
1751 
1752 -- Call private procedure to update a flow region relation
1753 AK_FLOW_PVT.UPDATE_REGION_RELATION (
1754 p_validation_level => p_validation_level,
1755 p_api_version_number => 1.0,
1756 p_msg_count => p_msg_count,
1757 p_msg_data => p_msg_data,
1758 p_return_status => l_return_status,
1759 p_flow_application_id => p_flow_application_id,
1760 p_flow_code => p_flow_code,
1761 p_foreign_key_name => p_foreign_key_name,
1762 p_from_page_appl_id => p_from_page_appl_id,
1763 p_from_page_code => p_from_page_code,
1764 p_from_region_appl_id => p_from_region_appl_id,
1765 p_from_region_code => p_from_region_code,
1766 p_to_page_appl_id => p_to_page_appl_id,
1767 p_to_page_code => p_to_page_code,
1768 p_to_region_appl_id => p_to_region_appl_id,
1769 p_to_region_code => p_to_region_code,
1770 p_application_id => p_application_id,
1771 p_created_by => p_created_by,
1772 p_creation_date => p_creation_date,
1773 p_last_updated_by => p_last_updated_by,
1774 p_last_update_date => p_last_update_date,
1775 p_last_update_login => p_lasT_update_login,
1776 p_pass => l_pass,
1777 p_copy_redo_flag => l_copy_redo_flag
1778 );
1779 
1780 -- If API call returns with an error status...
1781 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
1782 (l_return_status = FND_API.G_RET_STS_ERROR) then
1783 RAISE FND_API.G_EXC_ERROR;
1784 end if;
1785 
1786 p_return_status := FND_API.G_RET_STS_SUCCESS;
1787 
1788 EXCEPTION
1789 WHEN FND_API.G_EXC_ERROR THEN
1790 p_return_status := FND_API.G_RET_STS_ERROR;
1791 rollback to start_update_relation;
1792 WHEN OTHERS THEN
1793 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1794 rollback to start_update_relation;
1795 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
1796 SUBSTR (SQLERRM, 1, 240) );
1797 FND_MSG_PUB.Add;
1798 end UPDATE_REGION_RELATION;
1799 
1800 end AK_FLOW_GRP;