1 PACKAGE FND_OAM_DSCRAM_ARGS_PKG as
2 /* $Header: AFOAMDSARGS.pls 120.3 2005/11/07 19:45 ilawler noship $ */
3
4 -------------------
5 -- Types/Constants
6 -------------------
7
8 -- entity representing an arg in an arg context or arg list
9 TYPE arg IS RECORD (arg_id NUMBER,
10 arg_name VARCHAR2(60),
11 init_locally BOOLEAN, --indicator of whether the arg cache entity has been initialized
12 initialized_success_flag VARCHAR2(3),
13 allow_override_source BOOLEAN,
14 binding_enabled BOOLEAN, --whether an arg corresponds to a bind variable
15 permissions VARCHAR2(30),
16 write_policy VARCHAR2(30),
17 datatype VARCHAR2(30),
18 valid_value_flag VARCHAR2(3), --need NULL for unknown, T=yes, F=value invalid, don't re-source
19 canonical_value VARCHAR2(4000), --caches value for args with write_policy of ONCE or PER_WORKER
20 rowid_lbound ROWID,
21 rowid_ubound ROWID,
22 is_constant BOOLEAN, --derived, whether the arg is a constant and therefore requires special handling
23 source_cursor_id INTEGER,
24 source_sql_bind_rowids BOOLEAN, --derived, whether cursor requires rowids to be bound
25 source_state_key VARCHAR2(60), --derived, the state key used for sourcing when source_type=state
26 source_use_exec_cursor BOOLEAN --derived, set when a writable arg has source_type=execution_cursor
27 );
28
29 --arg context is a hash table of args keyed by name, passed from parent objects to supply dynamic
30 --values for arguments
31 TYPE arg_context IS TABLE OF arg INDEX BY VARCHAR2(60);
32
33 --arg list is an unordered list of arguments used by leaf consumers (dml, plsql) to provide the
34 --values needed for execution and reporting
35 TYPE arg_list IS TABLE OF arg;
36
37 ---------------------------------
38 -- Public Procedures/Functions --
39 ---------------------------------
40
41 --Tests the permissions attribute to see if it's readable
42 FUNCTION IS_READABLE(p_arg IN arg)
43 RETURN BOOLEAN;
44
45 --Tests the permissions attribute to see if it's writable
46 FUNCTION IS_WRITABLE(p_arg IN arg)
47 RETURN BOOLEAN;
48
49 -- Debug method to print out an arg context.
50 PROCEDURE PRINT_ARG_CONTEXT(px_arg_context IN OUT NOCOPY arg_context);
51
52 -- Pulls global and run scoped arguments and puts them into a context. Does no init or get.
53 PROCEDURE FETCH_RUN_ARG_CONTEXT(p_run_id IN NUMBER,
54 x_arg_context OUT NOCOPY arg_context,
55 x_return_status OUT NOCOPY VARCHAR2,
56 x_return_msg OUT NOCOPY VARCHAR2);
57
58 -- Getter for an arg's value as type VARCHAR2
59 PROCEDURE GET_ARG_VALUE(px_arg IN OUT NOCOPY arg,
60 px_arg_context IN OUT NOCOPY arg_context,
61 p_using_splitting IN BOOLEAN DEFAULT FALSE,
62 p_rowid_lbound IN ROWID DEFAULT NULL,
63 p_rowid_ubound IN ROWID DEFAULT NULL,
64 p_execution_cursor_id IN INTEGER DEFAULT NULL,
65 x_value OUT NOCOPY VARCHAR2,
66 x_return_status OUT NOCOPY VARCHAR2,
67 x_return_msg OUT NOCOPY VARCHAR2);
68
69
70 --Getter for an arg's value as type NUMBER
71 PROCEDURE GET_ARG_VALUE(px_arg IN OUT NOCOPY arg,
72 px_arg_context IN OUT NOCOPY arg_context,
73 p_using_splitting IN BOOLEAN DEFAULT FALSE,
74 p_rowid_lbound IN ROWID DEFAULT NULL,
75 p_rowid_ubound IN ROWID DEFAULT NULL,
76 p_execution_cursor_id IN INTEGER DEFAULT NULL,
77 x_value OUT NOCOPY NUMBER,
78 x_return_status OUT NOCOPY VARCHAR2,
79 x_return_msg OUT NOCOPY VARCHAR2);
80
81 --Getter for an arg's value as type DATE
82 PROCEDURE GET_ARG_VALUE(px_arg IN OUT NOCOPY arg,
83 px_arg_context IN OUT NOCOPY arg_context,
84 p_using_splitting IN BOOLEAN DEFAULT FALSE,
85 p_rowid_lbound IN ROWID DEFAULT NULL,
86 p_rowid_ubound IN ROWID DEFAULT NULL,
87 p_execution_cursor_id IN INTEGER DEFAULT NULL,
88 x_value OUT NOCOPY DATE,
89 x_return_status OUT NOCOPY VARCHAR2,
90 x_return_msg OUT NOCOPY VARCHAR2);
91
92 --Getter for an arg's value as type ROWID, needs different name since rowid/varchar2 interchangeable
93 PROCEDURE GET_ARG_VALUE_ROWID(px_arg IN OUT NOCOPY arg,
94 px_arg_context IN OUT NOCOPY arg_context,
95 p_using_splitting IN BOOLEAN DEFAULT FALSE,
96 p_rowid_lbound IN ROWID DEFAULT NULL,
97 p_rowid_ubound IN ROWID DEFAULT NULL,
98 p_execution_cursor_id IN INTEGER DEFAULT NULL,
99 x_value OUT NOCOPY ROWID,
100 x_return_status OUT NOCOPY VARCHAR2,
101 x_return_msg OUT NOCOPY VARCHAR2);
102
103 -- For DMLs/PLSQLs and any other consumer of arguments, we need a procedure to
104 -- produce a list of arguments needed for dbms_sql binding. This is done by fetching
105 -- the argument list from the _ARGS_B table. The arguments are wrapped up and returned with no processing.
106 PROCEDURE FETCH_ARG_LIST(p_parent_type IN VARCHAR2,
107 p_parent_id IN NUMBER,
108 x_arg_list OUT NOCOPY arg_list,
109 x_has_writable OUT NOCOPY BOOLEAN,
110 x_return_status OUT NOCOPY VARCHAR2,
111 x_return_msg OUT NOCOPY VARCHAR2);
112
113 -- Traverses the provided arg list and binds all readable/bindable args to the cursor using the arg_name field.
114 PROCEDURE BIND_ARG_LIST_TO_CURSOR(p_arg_list IN OUT NOCOPY arg_list,
115 px_arg_context IN OUT NOCOPY arg_context,
116 p_cursor_id IN INTEGER,
117 p_using_splitting IN BOOLEAN DEFAULT FALSE,
118 p_rowid_lbound IN ROWID DEFAULT NULL,
119 p_rowid_ubound IN ROWID DEFAULT NULL,
120 x_return_status OUT NOCOPY VARCHAR2,
121 x_return_msg OUT NOCOPY VARCHAR2);
122
123 -- After an object has been executed, we should get values for all writable args - used for reporting purposes
124 -- but also possible to collect data which is pushed to the context for use as a source by another unit. The
125 -- p_entity_finished boolean allows us to collect ranged writable args at the end of each range and defer
126 -- collecting write_once args till the entire work item is done. The execution_cursor_id is provided to
127 -- allow for sourcing from that object.
128 PROCEDURE UPDATE_WRITABLE_ARG_VALUES(px_arg_list IN OUT NOCOPY arg_list,
129 px_arg_context IN OUT NOCOPY arg_context,
130 p_entity_finished IN BOOLEAN DEFAULT FALSE,
131 p_using_splitting IN BOOLEAN DEFAULT FALSE,
132 p_rowid_lbound IN ROWID DEFAULT NULL,
133 p_rowid_ubound IN ROWID DEFAULT NULL,
134 p_execution_cursor_id IN INTEGER DEFAULT NULL,
135 x_return_status OUT NOCOPY VARCHAR2,
136 x_return_msg OUT NOCOPY VARCHAR2);
137
138 -- Used by the work item destroy procedures to default values into the context from values in the arg list. Only performs
139 -- the update when the context has no value set and the arg list does and we allow overriding among other tests.
140 PROCEDURE UPDATE_CONTEXT_USING_ARG_LIST(px_arg_context IN OUT NOCOPY arg_context,
141 p_arg_list IN arg_list,
142 p_using_splitting IN BOOLEAN DEFAULT FALSE);
143
144 --Used by consumers of arg lists to de-allocate the args in the list when finished. Does not try to push
145 --values to the arg list since this may be called purely as a cleanup procedure.
146 PROCEDURE DESTROY_ARG_LIST(px_arg_list IN OUT NOCOPY arg_list,
147 x_return_status OUT NOCOPY VARCHAR2,
148 x_return_msg OUT NOCOPY VARCHAR2);
149
150 --Called whenever a context goes out of scope. Before de-allocating, it combs the context
151 --attemps to update any untouched, writable args.
152 PROCEDURE DESTROY_ARG_CONTEXT(px_arg_context IN OUT NOCOPY arg_context,
153 x_return_status OUT NOCOPY VARCHAR2,
154 x_return_msg OUT NOCOPY VARCHAR2);
155
156 /*
157 -- Pulls task-scoped args and overlays them on top of the run context
158 -- V2: add a task and unit level context check to allow sharing args at this level,
159 -- v1 just supports global/run
160 FUNCTION FETCH_TASK_ARG_CONTEXT(p_unit_id IN NUMBER)
161 RETURN arg_context;
162 -- Needed to push changed arguments from one context up to its parent context if
163 -- a parent context arg exists with the same name and has a type that allows writing.
164 FUNCTION ROLLUP_ARG_CTXT_INTO_PARENT_CTXT()
165 */
166
167 -- Bug #47007636 - ilawler - Mon Nov 7 15:03:41 2005
168 -- Table handler required for translated entities to populate the _TL table when
169 -- a new language is added to an environment.
170 -- Invariants:
171 -- None
172 -- Parameters:
173 -- None
174 PROCEDURE ADD_LANGUAGE;
175
176 END FND_OAM_DSCRAM_ARGS_PKG;