1 PACKAGE qa_ss_results AS
2 /* $Header: qltssreb.pls 120.10.12010000.1 2008/07/25 09:22:50 appldev ship $ */
3
4 --
5 -- Post a result to the database. This is a wrapper to the QA API
6 -- qa_results_api.insert_row. Do not perform commit. Most of the
7 -- parameters are self explanatory.
8 --
9 -- x_result is a flattened @-separated list of <char_id>=<value>.
10 -- x_result1 is an @-sepated list of <char_id>=<id> used for
11 -- hardcoded referenced elements that have known IDs.
12 -- x_result2 is not used but can be reserved for
13 -- expansion if one VARCHAR2 is not enough.
14 -- x_enabled maps to the status flag in qa_results
15 -- (i.e., null or 2 for enabled, 1 for disabled).
16 -- x_committed is whether to commit the row afterwards,
17 -- 1 = yes, others = no.
18 -- x_messages is an @-separated string of error messages if there
19 -- is any error.
20 --
21 -- Return 0 if OK
22 -- Return -1 if error.
23 --
24 FUNCTION nontxn_post_result(
25 x_occurrence OUT NOCOPY NUMBER,
26 x_org_id IN NUMBER,
27 x_plan_id IN NUMBER,
28 x_spec_id IN NUMBER,
29 x_collection_id IN NUMBER,
30 x_result IN VARCHAR2,
31 x_result1 IN VARCHAR2,
32 x_result2 IN VARCHAR2, -- not used yet, for future expansion
33 x_enabled IN INTEGER,
34 x_committed IN INTEGER,
35 x_messages OUT NOCOPY VARCHAR2)
36 RETURN INTEGER;
37
38 --
39 -- The overloaded method is used for transaction only
40 --
41 FUNCTION post_result(
42 x_occurrence IN OUT NOCOPY NUMBER,
43 x_org_id IN NUMBER,
44 x_plan_id IN NUMBER,
45 x_spec_id IN NUMBER,
46 x_collection_id IN NUMBER,
47 x_result IN VARCHAR2,
48 x_result1 IN VARCHAR2,
49 x_result2 IN VARCHAR2, -- not used yet, for future expansion
50 x_enabled IN INTEGER,
51 x_committed IN INTEGER,
52 x_transaction_number IN NUMBER,
53 x_messages OUT NOCOPY VARCHAR2)
54 RETURN INTEGER;
55
56
57 --
58 -- The overloaded method is used for ssqr.
59 -- In addition to the code in post_result,
60 -- we call insert history and automatic records.
61 --
62 -- 12.1 QWB Usability Improvements
63 -- Added 2 new paramters to pass the aggregated values for
64 -- the parent plan collection elements to the JAVA layer.
65 --
66 FUNCTION ssqr_post_result(
67 x_occurrence IN OUT NOCOPY NUMBER,
68 x_org_id IN NUMBER,
69 x_plan_id IN NUMBER,
70 x_spec_id IN NUMBER,
71 x_collection_id IN NUMBER,
72 x_txn_header_id IN NUMBER,
73 x_par_plan_id IN NUMBER,
74 x_par_col_id IN NUMBER,
75 x_par_occ IN NUMBER,
76 x_result IN VARCHAR2,
77 x_result1 IN VARCHAR2,
78 x_result2 IN VARCHAR2, -- not used yet, for future expansion
79 x_enabled IN INTEGER,
80 x_committed IN INTEGER,
81 x_transaction_number IN NUMBER,
82 x_messages OUT NOCOPY VARCHAR2,
83 x_agg_elements OUT NOCOPY VARCHAR2,
84 x_agg_val OUT NOCOPY VARCHAR2,
85 p_last_update_date IN DATE DEFAULT SYSDATE)
86 RETURN INTEGER;
87
88 --
89 -- update_result
90 --
91 FUNCTION update_result(
92 x_occurrence IN NUMBER,
93 x_org_id IN NUMBER,
94 x_plan_id IN NUMBER,
95 x_spec_id IN NUMBER,
96 x_collection_id IN NUMBER,
97 x_result IN VARCHAR2,
98 x_result1 IN VARCHAR2,
99 x_result2 IN VARCHAR2, -- not used yet, for future expansion
100 x_enabled IN INTEGER,
101 x_committed IN INTEGER,
102 x_transaction_number IN NUMBER,
103 x_messages OUT NOCOPY VARCHAR2)
104 RETURN INTEGER;
105
106
107 --
108 -- Delete a result. Do not perform commit.
109 --
110 PROCEDURE delete_result(
111 x_plan_id IN NUMBER,
112 x_collection_id IN NUMBER,
113 x_occurrence IN NUMBER);
114
115 --
116 -- Batch delete a set of results (supply occurrences in
117 -- comma-separated list.) Do not perform commit.
118 --
119 PROCEDURE delete_results(
120 x_plan_id IN NUMBER,
121 x_collection_id IN NUMBER,
122 x_occurrences IN VARCHAR2);
123
124 --
125 -- Perform database commit. Do not use in transaction integration,
126 -- otherwise we will be committing the parent's data without their
127 -- knowing! Actions will be fired in the background.
128 --
129 PROCEDURE commit_results;
130
131 PROCEDURE wrapper_fire_action (
132 q_collection_id IN NUMBER,
133 q_return_status OUT NOCOPY VARCHAR2,
134 q_msg_count OUT NOCOPY NUMBER,
135 q_msg_data OUT NOCOPY VARCHAR2);
136
137
138 PROCEDURE GET_COLLECTION_ID (x_collection_id OUT NOCOPY NUMBER);
139
140 --
141 -- Bug 6881303
142 -- added 2 new elements, one a comma separated list of the
143 -- Parent collection elements that would receive aggregated
144 -- values and the other a comma separated list of the
145 -- aggregated values.
146 -- ntungare Fri Mar 21 01:19:03 PDT 2008
147 --
148 FUNCTION ssqr_update_result(
149 x_occurrence IN NUMBER,
150 x_org_id IN NUMBER,
151 x_plan_id IN NUMBER,
152 x_spec_id IN NUMBER,
153 x_collection_id IN NUMBER,
154 x_txn_header_id IN NUMBER,
155 x_par_plan_id IN NUMBER,
156 x_par_col_id IN NUMBER,
157 x_par_occ IN NUMBER,
158 x_result IN VARCHAR2,
159 x_result1 IN VARCHAR2,
160 x_result2 IN VARCHAR2, -- not used yet, for future expansion
161 x_enabled IN INTEGER,
162 x_committed IN INTEGER,
163 x_transaction_number IN NUMBER,
164 x_messages OUT NOCOPY VARCHAR2,
165 x_agg_elements OUT NOCOPY VARCHAR2,
166 x_agg_val OUT NOCOPY VARCHAR2,
167 p_last_update_date IN DATE DEFAULT SYSDATE)
168 RETURN INTEGER;
169
170 --
171 -- bug 5306909
172 -- Added p_last_update_date parameter. This parameter is used to
173 -- check whether the record which the user is trying to update has
174 -- been updated already by some other user.
175 -- ntungare Mon Apr 10 07:00:21 PDT 2006
176 --
177 FUNCTION ssqr_lock_row (
178 p_occurrence IN NUMBER,
179 p_plan_id IN NUMBER,
180 p_last_update_date IN DATE,
181 x_status OUT NOCOPY VARCHAR2)
182 RETURN INTEGER;
183
184 --
185 -- 12.1 QWB Usability Improvements
186 -- Added 2 new parameters x_charid_str and x_id_str
187 -- to return comma separated strings of HC
188 -- elements and the Normalized Id values
189 --
190 FUNCTION ssqr_validate_row (
191 p_occurrence IN OUT NOCOPY NUMBER,
192 p_org_id IN NUMBER,
193 p_plan_id IN NUMBER,
194 p_spec_id IN NUMBER,
195 p_collection_id IN NUMBER,
196 p_result IN VARCHAR2,
197 p_result1 IN VARCHAR2,
198 p_result2 IN VARCHAR2, -- not used yet, for future expansion
199 p_enabled IN INTEGER,
200 p_committed IN INTEGER,
201 p_transaction_number IN NUMBER,
202 p_transaction_id IN NUMBER DEFAULT 0,
203 -- p_who_created_by IN NUMBER := fnd_global.user_id,
204 x_messages OUT NOCOPY VARCHAR2,
205 x_charid_str OUT NOCOPY VARCHAR2,
206 x_id_str out NOCOPY VARCHAR2)
207 RETURN INTEGER ;
208
209
210 TYPE mesg_table IS TABLE OF VARCHAR2(30) INDEX BY BINARY_INTEGER;
211
212
213 -- Bug 4502450 R12. eSig Status support in Multirow UQR
214 -- Functions checks if the current plan row has PENDING eSig
215 -- Status, if not it checks all the parent plans for eSig Status
216 -- if for corresponding parent row has eSig Status as PENDING
217 -- fills the message array and returns -1
218 -- rest is taken care in updateRow() method of QualityResultsEOImpl
219 -- saugupta Wed, 24 Aug 2005 08:51:28 -0700 PDT
220 FUNCTION validate_esig_for_update(
221 p_plan_id IN NUMBER,
222 p_plan_collection_id IN NUMBER,
223 p_plan_occurrence IN NUMBER)
224 RETURN BOOLEAN;
225
226 -- bug 4658275. eSig functionality support in QWB
227 -- this new method checks if user can insert a new
228 -- child row if ERES is enables
229 -- saugupta Tue, 18 Oct 2005 02:55:19 -0700 PDT
230 FUNCTION validate_esig_for_insert(p_plan_id IN NUMBER,
231 p_plan_collection_id IN NUMBER,
232 p_plan_occurrence IN NUMBER)
233 RETURN BOOLEAN;
234
235
236 -- R12 Project MOAC 4637896
237 -- For modularity, exposing this method for use by
238 -- qa_mqa_results
239 --
240 -- Parse out the error messages in the ErrorArray
241 -- returned by the validation API and append them
242 -- into an @-separated string. If an error message
243 -- contains @, it will be doubly encoded.
244 --
245 PROCEDURE get_error_messages(
246 p_errors IN qa_validation_api.ErrorArray,
247 p_plan_id IN NUMBER,
248 x_messages OUT NOCOPY VARCHAR2);
249
250 PROCEDURE post_error_messages (p_errors IN qa_validation_api.ErrorArray,
251 plan_id NUMBER);
252
253 -- R12.1 QWB Usability Improvements project
254 -- Function to perform deletetion of rows
255 --
256 FUNCTION delete_row(p_plan_id IN NUMBER,
257 p_collection_id IN NUMBER,
258 p_occurrence IN NUMBER,
259 p_org_id IN NUMBER,
260 p_txn_header_id IN NUMBER,
261 p_par_plan_id IN NUMBER DEFAULT -1,
262 p_par_col_id IN NUMBER DEFAULT -1,
263 p_par_occ IN NUMBER DEFAULT -1)
264 RETURN VARCHAR2;
265
266 END qa_ss_results;