1 package ffdict AUTHID CURRENT_USER as
2 /* $Header: ffdict.pkh 120.3.12020000.3 2012/08/28 08:51:04 ranarra ship $ */
3
4 TYPE r_pur is record ( user_entity_id ff_user_entities.user_entity_id%type,
5 business_group_id ff_user_entities.business_group_id%type,
6 legislation_code ff_user_entities.legislation_code%type) ;
7
8 TYPE t_del is table of r_pur index by binary_integer;
9
10 --
11 -- Table to hold information for deleted rows
12 --
13
14 l_pur_del t_del ;
15 --
16 ------------------------------ get_context_level ------------------------------
17 --
18 -- NAME
19 -- get_context_level
20 -- DESCRIPTION
21 -- Contexts are allocated a power of 2 number so that database item context
22 -- dependencies can be calculated efficiently in FastFormula using bit masks
23 -- This function returns the next available context level.
24 --
25 -------------------------------------------------------------------------------
26 --
27 function get_context_level return number;
28 --
29 ----------------------------- is_used_in_formula ------------------------------
30 --
31 -- NAME
32 -- is_used_in_formula
33 --
34 -- DESCRIPTION
35 -- Returns TRUE if named item is used within a formula (ie is referenced in
36 -- the FDIU table) visible from the current business group and legislation.
37 -- Otherwise returns FALSE.
38 --
39 -- NOTES
40 -- The purpose of this interface is to prevent compilation / run-time issues
41 -- because of different items with clashing names.
42 --
43 -- Example 1:
44 -- A compiled formula with local variable "L1" has a compilation failure
45 -- because a database item "L1" was created in the mean time. This is
46 -- because local variables must be assigned values but database items
47 -- cannot be assigned values, and a formula item is treated as a database
48 -- item when its name is found in FF_DATABASE_ITEMS or FF_DATABASE_ITEMS_TL.
49 --
50 -- Example 2:
51 -- A database item that was referenced from a compiled formula is deleted.
52 -- The next formula compilation fails because the name is treated as a
53 -- local variable name, and that variable is unitialised.
54 --
55 -- Example 3:
56 -- A new formula context is given the same name as an input variable. This
57 -- leads to problems in existing code that executes a formula, searching
58 -- for contexts and inputs by name.
59 --
60 -------------------------------------------------------------------------------
61 --
62 function is_used_in_formula (p_item_name in varchar2,
63 p_bus_grp in number,
64 p_leg_code in varchar2) return boolean;
65 --
66 ---------------------------- dbitl_used_in_formula ----------------------------
67 --
68 -- NAME
69 -- dbitl_used_in_formula
70 --
71 -- DESCRIPTION
72 -- Returns TRUE if a translated database item name is used in a formula
73 -- (ie is referenced in the FDIU table) visible from the current business
74 -- group and legislation.
75 --
76 -- NOTES
77 -- The purpose of this interface is to avoid a formula becoming invalid
78 -- upon the update or deletion of a translated database item name.
79 -------------------------------------------------------------------------------
80 --
81 function dbitl_used_in_formula (p_tl_user_name in varchar2
82 ,p_user_name in varchar2
83 ,p_user_entity_id in number
84 ,p_language in varchar2
85 ) return boolean;
86 --
87 ----------------------------- dbi_used_in_formula -----------------------------
88 --
89 -- NAME
90 -- dbi_used_in_formula
91 --
92 -- DESCRIPTION
93 -- Returns TRUE if a base database item name is used in a formula
94 -- (ie is referenced in the FDIU table) visible from the current business
95 -- group and legislation.
96 --
97 -- NOTES
98 -- The purpose of this interface is to avoid a formula becoming invalid
99 -- upon the update or deletion of a database item.
100 --
101 -------------------------------------------------------------------------------
102 --
103 function dbi_used_in_formula (p_user_name in varchar2
104 ,p_user_entity_id in number
105 ) return boolean;
106 --
107 ------------------------------ validate_formula -------------------------------
108 --
109 -- NAME
110 -- validate_formula
111 -- DESCRIPTION
112 -- Procedure which succeeds if name supplied will make a valid formula
113 -- name. Fails with exception and error if name is invalid.
114 --
115 -------------------------------------------------------------------------------
116 --
117 procedure validate_formula(p_formula_name in out nocopy varchar2,
118 p_formula_type_id in number,
119 p_bus_grp in number,
120 p_leg_code in varchar2);
121 --
122 ------------------------------ validate_formula -------------------------------
123 --
124 -- NAME
125 -- validate_formula - Overload
126 -- DESCRIPTION
127 -- Procedure which succeeds if name supplied will make a valid formula
128 -- name. Fails with exception and error if name is invalid.
129 -- Overloaded to allow date effective formula creation.
130 --
131 -------------------------------------------------------------------------------
132 --
133 procedure validate_formula(p_formula_name in out nocopy varchar2,
134 p_formula_type_id in number,
135 p_bus_grp in number,
136 p_leg_code in varchar2,
137 p_effective_start_date in date,
138 p_effective_end_date in out nocopy date);
139 --
140 ------------------------------ validate_dbitem -------------------------------
141 --
142 -- NAME
143 -- validate_dbitem
144 -- DESCRIPTION
145 -- Procedure which succeeds if name supplied will make a valid database
146 -- item name. Fails with exception and error if name is invalid.
147 -- NOTES
148 -- This procedure is required for inserting a new database item.
149 --
150 ------------------------------------------------------------------------------
151 --
152 procedure validate_dbitem(p_dbi_name in out nocopy varchar2,
153 p_user_entity_id in number);
154 --
155 -------------------------- core_validate_tl_dbitem ---------------------------
156 --
157 -- NAME
158 -- core_validate_tl_dbitem
159 -- DESCRIPTION
160 -- Core procedure for testing whether or not a new translated database
161 -- item name is valid.
162 --
163 -- Parameters:
164 -- USER_NAME: Base DBI name.
165 -- USER_ENTITY_ID: USER_ENTITY_ID for this DBI.
166 -- TL_USER_NAME: The translated name - it is converted to valid
167 -- DBI format.
168 --
169 -- Returns a status code in p_outcome:
170 -- S - Success
171 -- C - Failure: name clashes with Formula Context name.
172 -- D - Failure: name clashes with a DBI name.
173 -- F - Failure: name used in a compiled Formula other than for a DBI
174 -- or Context.
175 --
176 -- NOTES
177 -- For FF and Core Pay private use only.
178 --
179 ------------------------------------------------------------------------------
180 --
181 procedure core_validate_tl_dbitem
182 (p_user_name in varchar2
183 ,p_user_entity_id in number
184 ,p_tl_user_name in out nocopy varchar2
185 ,p_outcome out nocopy varchar2
186 );
187 --
188 ------------------------------ validate_tl_dbi -------------------------------
189 --
190 -- NAME
191 -- validate_tl_dbi
192 --
193 -- DESCRIPTION
194 -- Procedure which succeeds if name supplied will make a valid translated
195 -- database item name. Fails with exception and error if name is invalid.
196 --
197 -- NOTES
198 -- This procedure is required for updating a translated database item
199 -- name. It is possible that p_tl_user_name will be modified - if the
200 -- name is not in database item name format, it will be modified.
201 --
202 ------------------------------------------------------------------------------
203 --
204 procedure validate_tl_dbi(p_user_name in varchar2
205 ,p_user_entity_id in number
206 ,p_tl_user_name in out nocopy varchar2
207 );
208 --
209 ------------------------------ validate_context -------------------------------
210 --
211 -- NAME
212 -- validate_context
213 -- DESCRIPTION
214 -- Procedure which succeeds if name supplied will make a valid context
215 -- name. Fails with exception and error if name is invalid.
216 --
217 -------------------------------------------------------------------------------
218 --
219 procedure validate_context(p_ctx_name in out nocopy varchar2);
220 --
221 ---------------------------- validate_user_entity -----------------------------
222 --
223 -- NAME
224 -- validate_user_entity
225 -- DESCRIPTION
226 -- Procedure which succeeds if name supplied will make a valid user
227 -- entity name. Fails with exception and error if name is invalid.
228 --
229 -------------------------------------------------------------------------------
230 --
231 procedure validate_user_entity(p_ue_name in out nocopy varchar2,
232 p_bus_grp in number,
233 p_leg_code in varchar2);
234 --
235 ----------------------------- validate_function ------------------------------
236 --
237 -- NAME
238 -- validate_function
239 -- DESCRIPTION
240 -- Procedure which succeeds if name supplied will make a valid function
241 -- name. Fails with exception and error if name is invalid.
242 --
243 ------------------------------------------------------------------------------
244 --
245 procedure validate_function(p_func_name in out nocopy varchar2,
246 p_class in varchar2,
247 p_alias in varchar2,
248 p_bus_grp in number,
249 p_leg_code in varchar2);
250 --
251 ------------------------------ validate_global -------------------------------
252 --
253 -- NAME
254 -- validate_global
255 -- DESCRIPTION
256 -- Procedure which succeeds if name supplied will make a valid global
257 -- variable name. Fails with exception and error if name is invalid.
258 --
259 ------------------------------------------------------------------------------
260 --
261 procedure validate_global(p_glob_name in out nocopy varchar2,
262 p_bus_grp in number,
263 p_leg_code in varchar2);
264 --
265 ---------------------------- validate_tl_global ------------------------------
266 --
267 -- NAME
268 -- validate_tl_global
269 -- DESCRIPTION
270 -- Procedure which succeeds if name supplied will make a valid global
271 -- variable name. Fails with exception and error if name is invalid.
272 --
273 ------------------------------------------------------------------------------
274 --
275 procedure validate_tl_global(p_global_id in number,
276 p_glob_name in varchar2,
277 p_bus_grp in number,
278 p_leg_code in varchar2);
279 --
280 -------------------------------- validate_rcu ---------------------------------
281 --
282 -- NAME
283 -- validate_rcu
284 -- DESCRIPTION
285 -- Check adding route context usage does not make any compiled formulae
286 -- invalid. Returns TRUE if OK, FALSE if not OK
287 --
288 -------------------------------------------------------------------------------
289 --
290 procedure validate_rcu(p_route_id in number);
291 --
292 -------------------------------- validate_rpv ---------------------------------
293 --
294 -- NAME
295 -- validate_rpv
296 -- DESCRIPTION
297 -- Check adding route parameter value does not make any compiled formulae
298 -- invalid. Returns TRUE if OK, FALSE if not OK
299 --
300 -------------------------------------------------------------------------------
301 --
302 procedure validate_rpv(p_user_entity_id in number);
303 --
304 ---------------------------- create_global_dbitem -----------------------------
305 --
306 -- NAME
310 -- formulae to access the global variable value
307 -- create_global_dbitem
308 -- DESCRIPTION
309 -- Does third party inserts to create a database item which is used within
311 --
312 -------------------------------------------------------------------------------
313 --
314 procedure create_global_dbitem(p_name in varchar2,
315 p_data_type in varchar2,
316 p_global_id in number,
317 p_business_group_id in number,
318 p_legislation_code in varchar2,
319 p_created_by in number,
320 p_creation_date in date);
321 --
322 ---------------------------- delete_global_dbitem -----------------------------
323 --
324 -- NAME
325 -- delete_global_dbitem
326 -- DESCRIPTION
327 -- Does third party deletes to remove a database item which is used within
328 -- formulae to access the global variable value
329 --
330 -------------------------------------------------------------------------------
331 --
332 procedure delete_global_dbitem(p_global_id in number);
333 --
334 ----------------------------- delete_ftcu_check ------------------------------
335 --
336 -- NAME
337 -- delete_ftcu_check
338 -- DESCRIPTION
339 -- Check deleting formula type context usage does not make any compiled
340 -- formulae invalid. Returns TRUE if OK, FALSE if not OK
341 --
342 ------------------------------------------------------------------------------
343 --
344 procedure delete_ftcu_check(p_ftype_id in number,
345 p_context_id in number);
346 --
347 ---------------------------- delete_dbitem_check -----------------------------
348 --
349 -- NAME
350 -- delete_dbitem_check
351 -- DESCRIPTION
352 -- Procedure which succeeds if it is OK to delete named DB item.
353 --
354 ------------------------------------------------------------------------------
355 --
356 procedure delete_dbitem_check(p_item_name in varchar2,
357 p_user_entity_id in number);
358 --
359 ---------------------------- delete_dbitem_check -----------------------------
360 --
361 -- NAME
362 -- delete_dbitem_check
363 -- DESCRIPTION
364 -- Procedure which succeeds if it is OK to delete named DB item.
365 -- Overloaded because sometimes business group and legislation are known
366 --
367 ------------------------------------------------------------------------------
368 --
369 procedure delete_dbitem_check(p_item_name in varchar2,
370 p_business_group_id in number,
371 p_legislation_code in varchar2);
372 --
373 ------------------------------- set_ue_details --------------------------------
374 --
375 -- NAME
376 -- set_ue_details
377 -- DESCRIPTION
378 -- Stores details of UE pending a delete (for use by delete_dbitem_check)
379 --
380 -------------------------------------------------------------------------------
381 --
382 procedure set_ue_details (user_entity_id in number,
383 business_group_id in number,
384 legislation_code in varchar2);
385 --
386 ------------------------------ clear_ue_details -------------------------------
387 --
391 -- Clears details of UE following a delete
388 -- NAME
389 -- clear_ue_details
390 -- DESCRIPTION
392 --
393 -------------------------------------------------------------------------------
394 --
395 procedure clear_ue_details;
396 --
397 ---------------------------- update_global_dbitem -----------------------------
398 --
399 -- NAME
400 -- update_global_dbitem
401 -- DESCRIPTION
402 -- Updates FF_DATABASE_ITEMS_TL to create a translated database item name.
403 --
404 -------------------------------------------------------------------------------
405 --
406 procedure update_global_dbitem(p_global_id in number,
407 p_new_name in varchar2,
408 p_description in varchar2,
409 p_source_lang in varchar2,
410 p_language in varchar2);
411 --
412 ------------------------- fetch_referencing_formulas --------------------------
413 --
414 -- NAME
415 -- fetch_referencing_formulas
416 -- DESCRIPTION
417 -- Fetches information about Formulas that reference a particular
418 -- translated Database Item name.
419 -- NOTES
420 -- For Core Pay and Formula team internal use.
421 --
422 -------------------------------------------------------------------------------
423 --
424 procedure fetch_referencing_formulas
425 (p_tl_user_name in varchar2
426 ,p_user_name in varchar2
427 ,p_user_entity_id in number
428 ,p_language in varchar2
429 ,p_formula_ids out nocopy dbms_sql.number_table
430 ,p_formula_names out nocopy dbms_sql.varchar2s
431 ,p_eff_start_dates out nocopy dbms_sql.date_table
432 ,p_eff_end_dates out nocopy dbms_sql.date_table
433 ,p_bus_group_ids out nocopy dbms_sql.number_table
434 ,p_leg_codes out nocopy dbms_sql.varchar2s
435 );
436 --
437 -------------------------------------------------------------------------------
438 --
439 procedure pur_brd ( p_ff_ue_id in ff_user_entities.USER_ENTITY_ID%type,
440 p_bg_id in ff_user_entities.business_group_id%type,
441 p_leg_code in ff_user_entities.legislation_code%type ) ;
442
443 procedure pur_asd ;
444
445 end ffdict;