1 PACKAGE FND_OAM_DSCRAM_DMLS_PKG as
2 /* $Header: AFOAMDSDMLS.pls 120.3 2005/09/27 12:00 ilawler noship $ */
3
4 ------------
5 -- Constants
6 ------------
7
8 ---------------------------------
9 -- Public Procedures/Functions --
10 ---------------------------------
11
12 -- Accessor function to obtain dml-related state
13 -- Invariants:
14 -- State must have been initialized by a prior call to one of the execute_dml* procedures
15 -- Parameters:
16 -- None
17 -- Returns:
18 -- The numerical ID of the currently executing DML
19 -- Exceptions:
20 -- If a prior call to execute_dml wasn't executed, a NO_DATA_FOUND exception is thrown.
21 FUNCTION GET_CURRENT_DML_ID
22 RETURN NUMBER;
23
24 -- This API is used to get the list of unfinished DMLs for a given unit id.
25 -- Invariants:
26 -- None. Low enough level that there's no safety harness to higher state.
27 -- Parameters:
28 -- p_unit_id DSCRAM_UNITS.UNIT_ID of the parent unit, not obtained from state to facilitate composite unit types
29 -- x_work_queue: Work queue containing the fetched DMLs in the proper order
30 -- x_return_status: FND_API-compliant return status
31 -- x_return_msg: Message explaining non-success return statuses
32 -- Return Statuses:
33 -- G_RET_STS_SUCCESS Success
34 -- G_RET_STS_ERROR Expected, possible error found. See return_msg.
35 -- G_RET_STS_ERROR_UNEXP Unexpected Error found. See return_msg.
36 PROCEDURE FETCH_DML_IDS(p_unit_id IN NUMBER,
37 x_work_queue OUT NOCOPY FND_OAM_DSCRAM_UNITS_PKG.ordered_work_queue_type,
38 x_return_status OUT NOCOPY VARCHAR2,
39 x_return_msg OUT NOCOPY VARCHAR2);
40
41 -- API used when processing a DML on a range of rowids. No autonomous transaction
42 -- and no calls to AD complete procedures to avoid any implicit commits that would make it
43 -- harder to use this in a composite unit.
44 -- Invariants:
45 -- None
46 -- Parameters:
47 -- p_dml_ids: DSCRAM_DMLS.DML_ID of DMLs to execute
48 -- px_arg_context: Argument context for execution
49 -- p_rowid_lbound: Lower Bound ROWID to process (first arg of 'between')
50 -- p_rowid_ubound: Upper Bound ROWID to process (second arg of 'between')
51 -- x_rows_processed: Reporting stat returned for use by parent in calling AD complete procedure
52 -- x_return_status: FND_API-compliant return status
53 -- x_return_msg: Message explaining non-success return statuses
54 -- Return Statuses:
55 -- G_RET_STS_SUCCESS Success
56 -- G_RET_STS_ERROR Expected, possible error found. See return_msg.
57 -- G_RET_STS_ERROR_UNEXP Unexpected Error found. See return_msg.
58 PROCEDURE EXECUTE_DML_ON_RANGE(p_dml_id IN NUMBER,
59 px_arg_context IN OUT NOCOPY FND_OAM_DSCRAM_ARGS_PKG.arg_context,
60 p_rowid_lbound IN ROWID,
61 p_rowid_ubound IN ROWID,
62 x_rows_processed OUT NOCOPY NUMBER,
63 x_return_status OUT NOCOPY VARCHAR2,
64 x_return_msg OUT NOCOPY VARCHAR2);
65
66 -- API used by UNITS_PKG.INTERNAL_EXECUTE to perform an entire (hopefully small) DML.
67 -- An implicit COMPLETE_DML is called to put the metadata in sync with the data change
68 -- to facilitate autonomous commits. No commit or rollback is done here.
69 -- Invariants:
70 -- None
71 -- Parameters:
72 -- p_dml_id: DSCRAM_DMLS.DML_ID of DML to execute
73 -- px_arg_context: Arg context for execution
74 -- x_return_status: FND_API-compliant return status
75 -- x_return_msg: Message explaining non-success return statuses
76 -- Return Statuses:
77 -- G_RET_STS_SUCCESS Success
78 -- G_RET_STS_ERROR Expected, possible error found. See return_msg.
79 -- G_RET_STS_ERROR_UNEXP Unexpected Error found. See return_msg.
80 PROCEDURE EXECUTE_DML(p_dml_id IN NUMBER,
81 px_arg_context IN OUT NOCOPY FND_OAM_DSCRAM_ARGS_PKG.arg_context,
82 x_return_status OUT NOCOPY VARCHAR2,
83 x_return_msg OUT NOCOPY VARCHAR2);
84
85 -- Used by complete_unit to update the writable args for a completed DML
86 -- Invariants:
87 -- None
88 -- Parameters:
89 -- p_dml_id: DSCRAM_DMLS.DML_ID of DML to update
90 -- px_arg_context: Arg context
91 -- p_using_splitting Boolean indicating whether the args should assume we're using AD Splitting
92 -- x_return_status: FND_API-compliant return status
93 -- x_return_msg: Message explaining non-success return statuses
94 -- Return Statuses:
95 -- G_RET_STS_SUCCESS Success
96 -- G_RET_STS_ERROR Expected, possible error found. See return_msg.
97 -- G_RET_STS_ERROR_UNEXP Unexpected Error found. See return_msg.
98 PROCEDURE UPDATE_COMP_DML_WRITABLE_ARGS(p_dml_id IN NUMBER,
99 px_arg_context IN OUT NOCOPY FND_OAM_DSCRAM_ARGS_PKG.arg_context,
100 p_using_splitting IN BOOLEAN,
101 x_return_status OUT NOCOPY VARCHAR2,
102 x_return_msg OUT NOCOPY VARCHAR2);
103
104 -- Called internally and by _UNIT procedures to mark DMLs as completed. When executing DMLs serially,
105 -- this is called after each execute to allow incremental commits. If the DML was split, this will
106 -- get called by each worker when completing the unit so that n-1 workers can submit the number of rows
107 -- they processed and the last worker can also submit the the dml's finished state.
108 -- Invariants:
109 -- None
110 -- Parameters:
111 -- p_dml_id: DSCRAM_DMLS.DML_ID of DML to complete
112 -- p_finished_ret_sts Last Execute's return status of the DML
113 -- p_message Last Execute's return msg
114 -- p_workers_assigned The number of workers assigned to this DML - determines if we should just modify our local
115 -- cache or make updates to the DML tables.
116 -- x_return_status: FND_API-compliant return status
117 -- x_return_msg: Message explaining non-success return statuses
118 -- Return Statuses:
119 -- G_RET_STS_SUCCESS Success
120 -- G_RET_STS_ERROR Expected, possible error found. See return_msg.
121 -- G_RET_STS_ERROR_UNEXP Unexpected Error found. See return_msg.
122 PROCEDURE COMPLETE_DML(p_dml_id IN NUMBER,
123 p_finished_ret_sts IN VARCHAR2 DEFAULT NULL,
124 p_message IN VARCHAR2 DEFAULT NULL,
125 p_workers_assigned IN NUMBER DEFAULT NULL,
126 x_return_status OUT NOCOPY VARCHAR2,
127 x_return_msg OUT NOCOPY VARCHAR2);
128
129 -- Removes the DML cache entry for a dml ID and cleans up all child entities
130 -- such as the argument list and the DML's cursor. If p_update_context is true,
131 -- also rolls the arg list into the context.
132 -- Invariants:
133 -- None
134 -- Parameters:
135 -- p_dml_id: DSCRAM_DMLS.DML_ID of DML to destroy
136 -- px_arg_context: Arg context
137 -- p_update_context Boolean indicating whether the arg list should be rolled into the context
138 -- x_return_status: FND_API-compliant return status
139 -- x_return_msg: Message explaining non-success return statuses
140 -- Return Statuses:
141 -- G_RET_STS_SUCCESS Success
142 -- G_RET_STS_ERROR Expected, possible error found. See return_msg.
143 -- G_RET_STS_ERROR_UNEXP Unexpected Error found. See return_msg.
144 PROCEDURE DESTROY_DML_CACHE_ENTRY(p_dml_id IN NUMBER,
145 px_arg_context IN OUT NOCOPY FND_OAM_DSCRAM_ARGS_PKG.arg_context,
146 p_update_context IN BOOLEAN,
147 x_return_status OUT NOCOPY VARCHAR2,
148 x_return_msg OUT NOCOPY VARCHAR2);
149
150 -- Convenience wrapper to destroy any open dmls in the cache. This is the fallback API which
151 -- is always called by complete_unit to make sure that dmls and arguments are cleaned up. DMLs
152 -- found by this API do not enjoy the privledge of rolling their values into the context. DMLs
153 -- must be specifically completed using the above API for that to happen.
154 -- Invariants:
155 -- None
156 -- Parameters:
157 -- px_arg_context: Arg context
158 -- x_return_status: FND_API-compliant return status
159 -- x_return_msg: Message explaining non-success return statuses
160 -- Return Statuses:
161 -- G_RET_STS_SUCCESS Success
162 -- G_RET_STS_ERROR Expected, possible error found. See return_msg.
163 -- G_RET_STS_ERROR_UNEXP Unexpected Error found. See return_msg.
164 PROCEDURE DESTROY_DML_CACHE(px_arg_context IN OUT NOCOPY FND_OAM_DSCRAM_ARGS_PKG.arg_context,
165 x_return_status OUT NOCOPY VARCHAR2,
166 x_return_msg OUT NOCOPY VARCHAR2);
167
168 END FND_OAM_DSCRAM_DMLS_PKG;