1 package WF_ENGINE_BULK AUTHID CURRENT_USER as
2 /* $Header: wfengblks.pls 120.7 2006/10/04 21:38:40 dlam noship $ */
3 /*#
4 * Provides APIs that can be called by an application program
5 * to launch multiple work items at once in bulk and to set
6 * values for item attributes in bulk across multiple work
7 * items.
8 * @rep:scope public
9 * @rep:product OWF
10 * @rep:displayname Workflow Engine Bulk Processing
11 * @rep:lifecycle active
12 * @rep:compatibility S
13 * @rep:category BUSINESS_ENTITY WF_ENGINE
14 * @rep:ihelp FND/@wfebulk See the related online help
15 */
16 --
17 -- Constant values
18 --
19
20 debug boolean := FALSE; -- Run engine in debug or normal mode
21
22 -- Standard date format string. Used to convert dates to strings
23 -- when returning date values as activity function results.
24 date_format varchar2(30) := 'YYYY/MM/DD HH24:MI:SS';
25
26 -- Itemkey List
27 type itemkeytabtype is table of varchar2(240) index by binary_integer;
28
29 -- UserKey List
30 Type UserKeyTabType is table of varchar2(240) index by binary_integer;
31
32 --OwnerRole List
33 Type OwnerRoleTabType is table of varchar2(320) index by binary_integer;
34
35
36 -- commit for every n iterations
37 commit_frequency number := 500;
38
39 -- Table of Failed Items
40 g_FailedItems WF_ENGINE_BULK.ItemKeyTabType;
41
42 -- Table of Successful Items
43 g_SuccessItems WF_ENGINE_BULK.ItemKeyTabType;
44 --
45 -- Table of failed attributes
46 g_FailedAttributes wf_engine.nametabtyp;
47
48
49 --
50 -- CreateProcess (PUBLIC)
51 -- Create a new runtime process for a given list of itemkeys
52 -- (for an application itemtype).
53 -- IN
54 -- itemtype - A valid item type
55 -- itemkeys - A list of itemkeys generated from the application
56 -- object's primary key.
57 -- process - A valid root process for this item type
58 -- (or null to use the item's selector function)
59 -- user_keys - A list of userkeys bearing one to one
60 -- correspondence with the itek ley list
61 -- owner_roles - A list of ownerroles bearing one-to-one
62 -- correspondence with the item key list
63 -- parent_item_type - Optional Parent work item
64 -- parent_item_key - Optional parent item key
65 -- parent_context - Context info about parent
66 -- masterDetail - Master Detail Co-ordination
67
68 /*#
69 * Creates multiple new runtime process instances of the specified
70 * item type at once, based on the specified array of workflow
71 * item keys. You can optionally specify one existing work item as
72 * the parent for all the new work items. You cannot use this API
73 * to create forced synchronous processes.
74 * @param itemtype Item Type
75 * @param itemkeys Array of Item Keys
76 * @param process Process Name
77 * @param user_keys Array of User Keys
78 * @param owner_roles Array of Owner Roles
79 * @param parent_itemtype Parent Item Type
80 * @param parent_itemkey Parent Item Key
81 * @param parent_context Parent Context Information
82 * @param masterdetail Master Detail Coordination
83 * @rep:scope public
84 * @rep:lifecycle active
85 * @rep:displayname Create Processes in Bulk
86 * @rep:compatibility S
87 * @rep:ihelp FND/@a_cpbulk See the related online help
88 */
89 procedure CreateProcess(itemtype in varchar2,
90 itemkeys in wf_engine_bulk.itemkeytabtype,
91 process in varchar2,
92 user_keys in wf_engine_bulk.userkeytabtype,
93 owner_roles in wf_engine_bulk.ownerroletabtype,
94 parent_itemtype in varchar2 default null,
95 parent_itemkey in varchar2 default null,
96 parent_context in varchar2 default null,
97 masterdetail in boolean default null);
98
99 --
100 -- StartProcess (PUBLIC)
101 -- Begins execution of the process.It identifies the start activities
102 -- for the run-time process and launches them in bulk for all the item keys
103 -- in the list, under the given itemtype.
104 -- IN
105 -- itemtype - A valid item type
106 -- itemkeys - A list of itemkeys generated from the application object's
107 -- primary key.
108 --
109 /*#
110 * Begins execution of multiple new runtime process instances at
111 * once, identified by the specified item type and array of
112 * workflow item keys. The Workflow Engine locates the activity
113 * marked as a Start activity in the process definition and then
114 * defers that activity for each of the new work items. You must
115 * call either WF_ENGINE.CreateProcess() or
116 * WF_ENGINE_BULK.CreateProcess() to define the item type and item
117 * keys before calling WF_ENGINE_BULK.StartProcess(). You cannot use
118 * this API to start forced synchronous processes.
119 * @param itemtype Item Type
120 * @param itemkeys Array of Item Keys
121 * @rep:scope public
122 * @rep:lifecycle active
123 * @rep:displayname Start Processes in Bulk
124 * @rep:compatibility S
125 * @rep:ihelp FND/@a_spbulk See the related online help
126 */
127 procedure StartProcess(itemtype in varchar2,
128 itemkeys in wf_engine_bulk.itemkeytabtype);
129
130
131 -- FastForward (PUBLIC)
132 --
133 --This API starts a specific activity for a list of items. This activity
134 --must be marked as start, but does not need to be an activity without
135 --any in transition.This API would fast forward the launch process by
136 --bulk-creating the items, bulk initializing item attributes and bulk
137 --starting a specified start activity within the process across all the
138 --itemkeys.The activity must be a direct child of the root process specified.
139
140 -- IN
141 -- itemtype - A valid item type
142 -- itemkeys - A list of itemkeys generated from the application object's
143 -- primary key.
144 -- process - The process to be started
145 -- activity - The label of the specific activity within the process to be started.
146 -- activityStatus - The status of the activity.This should be restricted to 'NOTIFIED'
147 -- and 'DEFERRED' only.
148 /*#
149 * Creates multiple new runtime process instances of the
150 * specified item type at once, based on the specified array of
151 * workflow item keys, and begins execution of the new work items
152 * at the specified activity. You can optionally specify one
153 * existing work item as the parent for all the new work items.
154 * The activity at which execution begins must be marked as a Start
155 * activity. However, it can have incoming transitions. The activity
156 * must be a direct child of the process in which execution of the
157 * work item begins. It cannot be part of a subprocess. The Workflow
158 * Engine first calls WF_ENGINE_BULK.CreateProcess() to create the
159 * new work items and then sets the Start activity for each work
160 * item to the specified status, either 'DEFERRED' or 'NOTIFIED'.
161 * You cannot use WF_ENGINE_BULK.FastForward() to start forced
162 * synchronous processes.
163 * @param itemtype Item Type
164 * @param itemkeys Array of Item Keys
165 * @param process Process Name
166 * @param activity Activity Node Label
167 * @param activityStatus Activity Status to Set
168 * @param parent_itemtype Parent Item Type
169 * @param parent_itemkey Parent Item Key
170 * @param parent_context Parent Context Information
171 * @param masterdetail Master Detail Coordination
172 * @rep:scope public
173 * @rep:lifecycle active
174 * @rep:displayname Fast Forward Processes in Bulk
175 * @rep:compatibility S
176 * @rep:ihelp FND/@a_ffbulk See the related online help
177 */
178 procedure FastForward(itemtype in varchar2,
179 itemkeys in wf_engine_bulk.itemkeytabtype,
180 process in varchar2,
181 activity in varchar2,
182 activityStatus in varchar2 default null,
183 parent_itemtype in varchar2 default null,
184 parent_itemkey in varchar2 default null,
185 parent_context in varchar2 default null,
186 masterdetail in boolean default null);
187
188 -- SetItemAttrText (PUBLIC)
189 -- Set the values of an array of text item attribute.
190 -- Unlike SetItemAttrText(), it stores the values directly.
191 -- IN:
192 -- itemtype - Item type
193 -- itemkey - Item key
194 -- aname - Array of Names
195 -- avalue - Array of New values for attribute
196 --
197 /*#
198 * Sets the values of an array of item type attributes of type
199 * text in multiple work items, identified by the specified item
200 * type and array of item keys. You can also use this API to set
201 * attributes of type role, form, URL, lookup, or document. This
202 * API sets the value of one item type attribute in each work
203 * item. Consequently, the array of item keys must correspond on
204 * a one-to-one basis with the array of item type attribute names
205 * and with the array of item type attribute values.
206 * @param itemtype Item Type
207 * @param itemkeys Array of Item Keys
208 * @param anames Array of Attribute Names
209 * @param avalues Array of Attribute Values
210 * @rep:scope public
211 * @rep:lifecycle active
212 * @rep:displayname Set Text Item Attribute Values in Bulk
213 * @rep:compatibility S
214 * @rep:ihelp FND/@a_siatbulk See the related online help
215 */
216 procedure SetItemAttrText(
217 itemtype in varchar2,
218 itemkeys in Wf_Engine_Bulk.ItemKeyTabType,
219 anames in Wf_Engine.NameTabTyp,
220 avalues in Wf_Engine.TextTabTyp);
221
222 -- SetItemAttrNumber (PUBLIC)
223 -- Set the values of an array of number item attribute.
224 -- Unlike SetItemAttrText(), it stores the values directly.
225 -- IN:
226 -- itemtype - Item type
227 -- itemkey - Item key
228 -- aname - Array of Names
229 -- avalue - Array of New values for attribute
230 --
231 /*#
232 * Sets the values of an array of item type attributes of type
233 * number in multiple work items, identified by the specified
234 * item type and array of item keys. This API sets the value of
235 * one item type attribute in each work item. Consequently, the
236 * array of item keys must correspond on a one-to-one basis with
237 * array of item keys must correspond on a one-to-one basis with
238 * the array of item type attribute names and with the array of
239 * item type attribute values.
240 * @param itemtype Item Type
241 * @param itemkeys Array of Item Keys
242 * @param anames Array of Attribute Names
243 * @param avalues Array of Attribute Values
244 * @rep:scope public
245 * @rep:lifecycle active
246 * @rep:displayname Set Number Item Attribute Values in Bulk
247 * @rep:compatibility S
248 * @rep:ihelp FND/@a_sianbulk See the related online help
249 */
250 procedure SetItemAttrNumber(
251 itemtype in varchar2,
252 itemkeys in Wf_Engine_Bulk.ItemKeyTabType,
253 anames in Wf_Engine.NameTabTyp,
254 avalues in Wf_Engine.NumTabTyp);
255
256 -- SetItemAttrDate (PUBLIC)
257 -- Set the values of an array of date item attribute.
258 -- Unlike SetItemAttrText(), it stores the values directly.
259 -- IN:
260 -- itemtype - Item type
261 -- itemkey - Item key
262 -- aname - Array of Names
263 -- avalue - Array of New values for attribute
264 --
265 /*#
266 * Sets the values of an array of item type attributes of type
267 * date in multiple work items, identified by the specified
268 * item type and array of item keys. This API sets the value of
269 * one item type attribute in each work item. Consequently, the
270 * array of item keys must correspond on a one-to-one basis with
271 * the array of item type attribute names and with the array of
272 * item type attribute values.
273 * @param itemtype Item Type
274 * @param itemkeys Array of Item Keys
275 * @param anames Array of Attribute Name
276 * @param avalues Array of Attribute Values
277 * @rep:scope public
278 * @rep:lifecycle active
279 * @rep:displayname Set Date Item Attribute Values in Bulk
280 * @rep:compatibility S
281 * @rep:ihelp FND/@a_siadbulk See the related online help
282 */
283 procedure SetItemAttrDate(
284 itemtype in varchar2,
285 itemkeys in Wf_Engine_Bulk.ItemKeyTabType,
286 anames in Wf_Engine.NameTabTyp,
287 avalues in Wf_Engine.DateTabTyp);
288
289 end WF_ENGINE_BULK;