[Home] [Help]
PACKAGE BODY: APPS.WSH_TP_RELEASE_GRP
Source
1 PACKAGE BODY WSH_TP_RELEASE_GRP as
2 /* $Header: WSHTPGPB.pls 115.2 2003/10/24 19:22:47 wrudge noship $ */
3
4
5 G_PKG_NAME CONSTANT VARCHAR2(50) := 'WSH_TP_RELEASE_GRP';
6
7
8
9 --
10 -- Procedure: action
11 -- Parameters:
12 -- p_id_tab list of ids to process, depending on action.
13 -- For actions 'RELEASE' and 'PURGE', list of group_id
14 -- identifies the trips in WSH_TRIPS_INTERFACE
15 -- with INTERFACE_ACTION_CODE = 'TP_RELEASE'
16 -- and their related records in other interface tables.
17 -- p_input_rec input parameters:
18 -- action_code:
19 -- 'RELEASE' - release the plan
20 --
21 -- if some groups fail, returns warning
22 -- if all fail, returns error
23 -- 'PURGE' - purge interface tables
24 -- commit_flag:
25 -- 'Y' - commit each group
26 -- 'N' - do not commit
27 -- p_output_rec_type output parameters:
28 -- placeholder for future
29 -- x_return_status return status
30 -- FND_API.G_RET_STS_SUCCESS - success
31 -- 'W' - warning (WSH_UTIL_CORE.G_RET_STS_WARNING)
32 -- FND_API.G_RET_STS_ERROR
33 -- FND_API.G_RET_STS_UNEXP_ERROR
34 --
35 -- Description:
36 -- Perform an action relating to TP integration, based on p_input_rec.action_code:
37 -- Release Plan
38 -- Purge Interface Tables
39 --
40 --
41 PROCEDURE action(
42 p_id_tab IN id_tab_type,
43 p_input_rec IN input_rec_type,
44 x_ouput_rec_type OUT NOCOPY output_rec_type,
45 x_return_status OUT NOCOPY VARCHAR2)
46 IS
47 --
48 l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'action';
49 --
50 l_debug_on BOOLEAN;
51 --
52 BEGIN
53 l_debug_on := WSH_DEBUG_INTERFACE.g_debug;
54 --
55 IF l_debug_on IS NULL THEN
56 l_debug_on := WSH_DEBUG_SV.is_debug_enabled;
57 END IF;
58
59 IF l_debug_on THEN
60 WSH_DEBUG_SV.push(l_module_name);
61 WSH_DEBUG_SV.log(l_module_name, 'p_id_tab.COUNT', p_id_tab.COUNT);
62 WSH_DEBUG_SV.log(l_module_name, 'p_input_rec.action_code', p_input_rec.action_code);
63 WSH_DEBUG_SV.log(l_module_name, 'p_input_rec.commit_flag', p_input_rec.commit_flag);
64 END IF;
65
66 x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
67
68
69 --
70 --
71
72 IF p_id_tab.COUNT > 0 THEN
73
74 IF p_input_rec.action_code = G_ACTION_RELEASE THEN
75 WSH_TP_RELEASE_INT.release_plan(
76 p_group_ids => p_id_tab,
77 p_commit_flag => p_input_rec.commit_flag,
78 x_return_status => x_return_status);
79
80 ELSIF p_input_rec.action_code = G_ACTION_PURGE THEN
81 WSH_TP_RELEASE_INT.purge_interface_tables(
82 p_group_ids => p_id_tab,
83 p_commit_flag => p_input_rec.commit_flag,
84 x_return_status => x_return_status);
85
86 END IF;
87
88 END IF;
89
90 --
91 --
92
93 IF l_debug_on THEN
94 WSH_DEBUG_SV.log(l_module_name, 'x_return_status', x_return_status);
95 WSH_DEBUG_SV.pop(l_module_name);
96 END IF;
97
98 EXCEPTION
99 WHEN OTHERS THEN
100 x_return_status := WSH_UTIL_CORE.G_RET_STS_UNEXP_ERROR;
101 WSH_UTIL_CORE.DEFAULT_HANDLER(
102 'WSH_TP_RELEASE_GRP.action',
103 l_module_name);
104 IF l_debug_on THEN
105 WSH_DEBUG_SV.logmsg(l_module_name,'Unexpected error has occured. Oracle error message is '|| SQLERRM,WSH_DEBUG_SV.C_UNEXPEC_ERR_LEVEL);
106 WSH_DEBUG_SV.pop(l_module_name,'EXCEPTION:OTHERS');
107 END IF;
108
109 END action;
110
111
112 END WSH_TP_RELEASE_GRP;