1 PACKAGE IEX_STRATEGY_WF AUTHID CURRENT_USER as
2 /* $Header: iexstrws.pls 120.6.12010000.5 2009/07/16 14:19:24 gnramasa ship $ */
3
4
5 --jsanju 05/30/02
6 -- Table Of Competence Ids.
7 TYPE tab_of_comp_id is TABLE of NUMBER
8 INDEX BY BINARY_INTEGER;
9
10 /**
11 * aborting workflow
12 * ..
13 **/
14 --procedure custom_abort_process(p_itemtype IN varchar2, p_itemkey IN varchar2);
15 /**
16 * check to see if there are any pending
17 * work items to be processed
18 **/
19 procedure check_work_items_completed(
20 itemtype in varchar2,
21 itemkey in varchar2,
22 actid in number,
23 funcmode in varchar2,
24 result out NOCOPY varchar2);
25
26 /**
27 * Close all the pending work items
28 * and close the strategy
29 * if the update fails , go and wait
30 * for the signal again
31 **/
32
33 procedure close_strategy(
34 itemtype in varchar2,
35 itemkey in varchar2,
36 actid in number,
37 funcmode in varchar2,
38 result out NOCOPY varchar2);
39
40 /**
41 * Get the next work item for the strategy
42 * creates the work item in strategy_work_items table
43 * update the attribute work_item_id in the workflow with the
44 * create workitem_id.
45 **/
46
47 procedure create_next_work_item(
48 itemtype in varchar2,
49 itemkey in varchar2,
50 actid in number,
51 funcmode in varchar2,
52 result out NOCOPY varchar2);
53
54 /**
55 * This will suspend the existing process
56 **/
57 procedure set_notification_resources(
58 p_resource_id in number,
59 itemtype in varchar2,
60 itemkey in varchar2
61 );
62
63 procedure wait_signal(
64 itemtype in varchar2,
65 itemkey in varchar2,
66 actid in number,
67 funcmode in varchar2,
68 result out NOCOPY varchar2);
69
70
71 procedure wait_complete_signal(
72 itemtype in varchar2,
73 itemkey in varchar2,
74 actid in number,
75 funcmode in varchar2,
76 result out NOCOPY varchar2) ;
77
78 --get the status of the process
79 -- to see if the process is SUSPEND(wf_engine.eng_suspended )
80 PROCEDURE process_status ( p_process in varchar2 ,
81 p_itemtype in varchar2,
82 p_itemkey in varchar2,
83 x_status out NOCOPY varchar2);
84
85 /**
86 * This will be called from the form or the concurrent program
87 * once the work item
88 * status is changed or if the strategy is closed or cancelled
89 * if the work item is null ,then the strategy and the pending
90 * work items are to be closed/cancelled
91 * else just complete or cancel the work item only
92 *03/19/02
93 * --sub process addition --
94 * if it is waiting for optional check or escalte check
95 * then we have not reached the wait for response activity
96 * or the process is not suspended so these are the things we should do
97 * 1.DO NOT resume process
98 * 2.Complete activity (depending on the activity label - this will be
99 * either escalte_check or optional_check)
100 * then the subprocess will be completed
101 *04/02/2002
102 * add a new parameter signal_source for custom work flow and fulfilment
103 *work flow check if the agent has already changed the work item status
104 *before the completion of custom or fulfillment wf's.then do nothing ,
105 *else update workitem and resume process
106 **/
107
108 procedure send_signal(
109 process in varchar2 ,
110 strategy_id in varchar2,
111 status in VARCHAR2,
112 work_item_id in number DEFAULT NULL,
113 signal_source in varchar2 DEFAULT NULL);
114
115
116 /**
117 * check whether the work item is optional or not
118 **/
119 procedure OPTIONAL_CHECK(
120 itemtype in varchar2,
121 itemkey in varchar2,
122 actid in number,
123 funcmode in varchar2,
124 result out NOCOPY varchar2);
125
126 /**
127 * check whether the work item should be escalated or not
128 **/
129 procedure ESCALATE_CHECK(
130 itemtype in varchar2,
131 itemkey in varchar2,
132 actid in number,
133 funcmode in varchar2,
134 result out NOCOPY varchar2);
135
136 /**
137 * check whether the work item status is on hold
138 **/
139 procedure ONHOLD_CHECK(
140 itemtype in varchar2,
141 itemkey in varchar2,
142 actid in number,
143 funcmode in varchar2,
144 result out NOCOPY varchar2);
145
146 /**
147 * check whether the fulfil_temp_id is populated for this work item
148 *
149 **/
150 procedure FULFIL_CHECK(
151 itemtype in varchar2,
152 itemkey in varchar2,
153 actid in number,
154 funcmode in varchar2,
155 result out NOCOPY varchar2);
156
157
158 procedure cal_post_wait(
159 itemtype in varchar2,
160 itemkey in varchar2,
161 actid in number,
162 funcmode in varchar2,
163 result out NOCOPY varchar2);
164
165 procedure cal_pre_wait(
166 itemtype in varchar2,
167 itemkey in varchar2,
168 actid in number,
169 funcmode in varchar2,
170 result out NOCOPY varchar2);
171
172 /* begin bug 4141678 by ctlee 3/14/2005 - loop one when create workitem failed */
173 procedure wi_failed_first_time(
174 itemtype in varchar2,
175 itemkey in varchar2,
176 actid in number,
177 funcmode in varchar2,
178 result out nocopy varchar2);
179 /* end bug 4141678 by ctlee 3/14/2005 - loop one when create workitem failed */
180
181 /**
182 * check whether the to send a notification
183 **/
184 procedure NOTIFY_CHECK(
185 itemtype in varchar2,
186 itemkey in varchar2,
187 actid in number,
188 funcmode in varchar2,
189 result out NOCOPY varchar2);
190
191 /**
192 * check whether there is a custom worlflow attached
193 **/
194 procedure CUSTOM_CHECK(
195 itemtype in varchar2,
196 itemkey in varchar2,
197 actid in number,
198 funcmode in varchar2,
199 result out NOCOPY varchar2);
200
201 /**
202 * updatework item to Timeout
203 **/
204 procedure UPDATE_WORK_ITEM(
205 itemtype in varchar2,
206 itemkey in varchar2,
207 actid in number,
208 funcmode in varchar2,
209 result out NOCOPY varchar2);
210
211
212 procedure WAIT_OPTIONAL(
213 itemtype in varchar2,
214 itemkey in varchar2,
215 actid in number,
216 funcmode in varchar2,
217 result out NOCOPY varchar2) ;
218
219 procedure WAIT_ESCALATION(
220 itemtype in varchar2,
221 itemkey in varchar2,
222 actid in number,
223 funcmode in varchar2,
224 result out NOCOPY varchar2);
225
226
227 procedure WAIT_STRATEGY(
228 itemtype in varchar2,
229 itemkey in varchar2,
230 actid in number,
231 funcmode in varchar2,
232 result out NOCOPY varchar2);
233
234 --get messages from server side
235 PROCEDURE Get_Messages (
236 p_message_count IN NUMBER,
237 x_msgs OUT NOCOPY VARCHAR2);
238 ----------------------------------------------
239 --if work item creation fails ,
240 --and if adminstartor does not want to continue
241 --replies via email 'NO' then close strategy and
242 --complete the workflow.
243 --set the status attribute to 'CANCELLED'
244 -- when closing strategy(CLOSE_STRATEGY procedure)
245 -- this attribute is checked.
246 --05/02/02
247
248 procedure SET_STRATEGY_STATUS(
249 itemtype in varchar2,
250 itemkey in varchar2,
251 actid in number,
252 funcmode in varchar2,
253 result out NOCOPY varchar2);
254
255 --set user_id,responsibility_id
256 --and application responsibility id
257 --which will then used by the the an other activity
258 -- which comes after a deferred activitiy
259 --08/02/02
260
261 procedure SET_SESSION_CTX(
262 itemtype in varchar2,
263 itemkey in varchar2,
264 actid in number,
265 funcmode in varchar2,
266 result out NOCOPY varchar2);
267
268
269
270
271 /**
272 --07/31/02
273 --abort the strategy workflow
274 --update the work items,
275 --close or cancel strategy
276 --abort all the custom workflows
277 --this will happen if the workflow failed before
278 --being suspended, for example if notification
279 -- does not have a performer.
280
281 **/
282 procedure CLOSE_AND_ABORT_STRATEGY_WF(
283 l_strategy_id in NUMBER,
284 l_status in VARCHAR2 ) ;
285
286
287 -- Begin- Andre 07/28/2004 - Add bill to assignmnet
288
289 ------------------- procedure get_billto_resource ------------------------------
290 /** get resource id for the given competence and bill to address
291 *
292 **/
293 function get_billto_resource ( p_siteuse_id IN NUMBER,
294 p_competence_tab IN tab_of_comp_id,
295 x_resource_id OUT NOCOPY NUMBER)
296 RETURN BOOLEAN;
297
298 -- End- Andre 07/28/2004 - Add bill to assignmnet
299
300 -- Begin- Kasreeni 01/07/2005 - Add account assignmnet
301
302 ------------------- procedure get_billto_resource ------------------------------
303 /** get resource id for the given competence and account
304 *
305 **/
306 function get_account_resource ( p_account_id IN NUMBER,
307 p_competence_tab IN tab_of_comp_id,
308 x_resource_id OUT NOCOPY NUMBER)
309 RETURN BOOLEAN;
310
311 -- End- kasreeni 07/28/2004 - Add account assignmnet
312
313
314 --Begin - schekuri - 03-Dec-2005 - Bug#4506922
315 --to make the wf wait when the status of strategy is ONHOLD
316 procedure wait_on_hold_signal(
317 itemtype in varchar2,
318 itemkey in varchar2,
319 actid in number,
320 funcmode in varchar2,
321 result out NOCOPY varchar2) ;
322 --End - schekuri - 03-Dec-2005 - Bug#4506922
323
324
325 --Begin - schekuri - 06-Dec-2005 - Bug#4506922
326 -- procedure to update the workitem to open
327 procedure update_work_item_to_open(
328 itemtype in varchar2,
329 itemkey in varchar2,
330 actid in number,
331 funcmode in varchar2,
332 result out NOCOPY varchar2) ;
333 --End - schekuri - 06-Dec-2005 - Bug#4506922
334
335 /**
336 * update Escalation flag of the workitem
337 **/
338 procedure UPDATE_ESC_FLAG(
339 itemtype in varchar2,
340 itemkey in varchar2,
341 actid in number,
342 funcmode in varchar2,
343 result out NOCOPY varchar2);
344
345 --Start added by gnramasa for bug 8630852 13-July-09
346 procedure get_resource ( p_party_id IN NUMBER,
347 p_competence_tab IN tab_of_comp_id,
348 x_resource_id OUT NOCOPY NUMBER);
349 --End added by gnramasa for bug 8630852 13-July-09
350
351 end IEX_STRATEGY_WF;