26: l_default_retest_interval NUMBER(3) := 7;
27: /* make sure that process runs with background engine
28: to prevent SAVEPOINT/ROLLBACK error (see Workflow FAQ)
29: the 'magic value' to use for this is -1 */
30: l_run_wf_in_background CONSTANT WF_ENGINE.THRESHOLD%TYPE := -1;
31:
32: l_retest_notify_date DATE ;
33: l_wf_start_date DATE ;
34:
95: /* Check the status of the root activity */
96: wf_item_activity_status.root_status (l_itemtype, l_itemkey, l_status, l_result);
97: /* If it is not completed then abort the process */
98: IF (l_status <> 'COMPLETE')THEN
99: wf_engine.abortprocess (itemtype=> l_itemtype, itemkey=> l_itemkey, process=> l_workflowprocess);
100: END IF;
101: /* Purge the workflow data for workflow key */
102: wf_purge.total (itemtype=> l_itemtype, itemkey=> l_itemkey, docommit=> FALSE);
103: END IF;
108: END;
109: /*END BUG#2134597*/
110:
111: BEGIN
112: WF_ENGINE.CREATEPROCESS (itemtype => l_itemtype,
113: itemkey => l_itemkey,
114: process => l_WorkflowProcess);
115: EXCEPTION
116: WHEN DUP_VAL_ON_INDEX THEN
116: WHEN DUP_VAL_ON_INDEX THEN
117: RAISE wf_item_already_exists ;
118: END ;
119:
120: WF_ENGINE.THRESHOLD := l_run_wf_in_background ;
121:
122: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
123: itemkey => l_itemkey,
124: aname => 'LOT_ID',
118: END ;
119:
120: WF_ENGINE.THRESHOLD := l_run_wf_in_background ;
121:
122: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
123: itemkey => l_itemkey,
124: aname => 'LOT_ID',
125: avalue => p_lot_id);
126:
123: itemkey => l_itemkey,
124: aname => 'LOT_ID',
125: avalue => p_lot_id);
126:
127: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
128: itemkey => l_itemkey,
129: aname => 'LOT_NO',
130: avalue => p_lot_no);
131:
128: itemkey => l_itemkey,
129: aname => 'LOT_NO',
130: avalue => p_lot_no);
131:
132: WF_ENGINE.SETITEMATTRTEXT (itemtype => l_itemtype,
133: itemkey => l_itemkey,
134: aname => 'SUBLOT_NO',
135: avalue => p_sublot_no);
136:
133: itemkey => l_itemkey,
134: aname => 'SUBLOT_NO',
135: avalue => p_sublot_no);
136:
137: WF_ENGINE.SETITEMATTRDATE (itemtype => l_itemtype,
138: itemkey => l_itemkey,
139: aname => 'RETEST_DATE',
140: avalue => p_retest_date);
141:
175:
176: IF l_role_name IS NULL THEN
177: /* no notification target found for this item
178: so default to previously-selected FND_USER values */
179: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
180: itemkey => l_itemkey,
181: aname => 'PERNAME',
182: avalue => l_performer_name);
183: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
179: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
180: itemkey => l_itemkey,
181: aname => 'PERNAME',
182: avalue => l_performer_name);
183: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
184: itemkey => l_itemkey,
185: aname => 'PERDISP',
186: avalue => l_performer_display_name);
187:
185: aname => 'PERDISP',
186: avalue => l_performer_display_name);
187:
188: /*Added FROM_ROLE attribute for BLAF standard */
189: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
190: itemkey => l_itemkey,
191: aname => '#FROM_ROLE',
192: avalue => l_performer_name) ;
193: ELSE
190: itemkey => l_itemkey,
191: aname => '#FROM_ROLE',
192: avalue => l_performer_name) ;
193: ELSE
194: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
195: itemkey => l_itemkey,
196: aname => 'PERNAME',
197: avalue => l_role_name) ;
198:
195: itemkey => l_itemkey,
196: aname => 'PERNAME',
197: avalue => l_role_name) ;
198:
199: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
200: itemkey => l_itemkey,
201: aname => 'PERDISP',
202: avalue => l_role_display_name) ;
203:
201: aname => 'PERDISP',
202: avalue => l_role_display_name) ;
203:
204: /*Added FROM_ROLE attribute for BLAF standard */
205: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
206: itemkey => l_itemkey,
207: aname => '#FROM_ROLE',
208: avalue => l_role_name) ;
209: END IF;
208: avalue => l_role_name) ;
209: END IF;
210:
211:
212: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
213: itemkey => l_itemkey,
214: aname => 'ITEM_NO',
215: avalue => l_item_no);
216:
213: itemkey => l_itemkey,
214: aname => 'ITEM_NO',
215: avalue => l_item_no);
216:
217: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
218: itemkey => l_itemkey,
219: aname => 'ITEM_DESC1',
220: avalue => l_item_desc1);
221:
218: itemkey => l_itemkey,
219: aname => 'ITEM_DESC1',
220: avalue => l_item_desc1);
221:
222: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
223: itemkey => l_itemkey,
224: aname => 'ITEM_UM',
225: avalue => l_item_um);
226:
223: itemkey => l_itemkey,
224: aname => 'ITEM_UM',
225: avalue => l_item_um);
226:
227: WF_ENGINE.SETITEMATTRTEXT(itemtype => l_itemtype,
228: itemkey => l_itemkey,
229: aname => 'ITEM_UM2',
230: avalue => l_item_um2);
231:
228: itemkey => l_itemkey,
229: aname => 'ITEM_UM2',
230: avalue => l_item_um2);
231:
232: WF_ENGINE.SETITEMATTRNUMBER(itemtype => l_itemtype,
233: itemkey => l_itemkey,
234: aname => 'DUALUM_IND',
235: avalue => l_dualum_ind);
236:
233: itemkey => l_itemkey,
234: aname => 'DUALUM_IND',
235: avalue => l_dualum_ind);
236:
237: WF_ENGINE.SETITEMATTRDATE(itemtype => l_itemtype,
238: itemkey => l_itemkey,
239: aname => 'WF_START_DATE',
240: avalue => l_wf_start_date) ;
241:
256: IF (l_retest_notify_date < l_wf_start_date) THEN
257: l_retest_notify_date := l_wf_start_date ;
258: END IF ;
259:
260: WF_ENGINE.SETITEMATTRDATE (itemtype => l_itemtype,
261: itemkey => l_itemkey,
262: aname => 'RETEST_NOTIFY_DATE',
263: avalue => l_retest_notify_date);
264:
261: itemkey => l_itemkey,
262: aname => 'RETEST_NOTIFY_DATE',
263: avalue => l_retest_notify_date);
264:
265: WF_ENGINE.SETITEMATTRDATE (itemtype => l_itemtype,
266: itemkey => l_itemkey,
267: aname => 'RETEST_NOTIFY_TIME',
268: avalue => l_retest_notify_date ) ;
269:
267: aname => 'RETEST_NOTIFY_TIME',
268: avalue => l_retest_notify_date ) ;
269:
270:
271: WF_ENGINE.STARTPROCESS (itemtype => l_itemtype,
272: itemkey => l_itemkey);
273:
274:
275:
348: ELSE
349: p_resultout := 'COMPLETE:INVEXIST';
350: END IF ;
351:
352: WF_ENGINE.SETITEMATTRNUMBER (itemtype => p_itemtype,
353: itemkey => p_itemkey,
354: aname => 'QUANTITY',
355: avalue => l_sum_loct_onhand) ;
356: WF_ENGINE.SETITEMATTRNUMBER (itemtype => p_itemtype,
352: WF_ENGINE.SETITEMATTRNUMBER (itemtype => p_itemtype,
353: itemkey => p_itemkey,
354: aname => 'QUANTITY',
355: avalue => l_sum_loct_onhand) ;
356: WF_ENGINE.SETITEMATTRNUMBER (itemtype => p_itemtype,
357: itemkey => p_itemkey,
358: aname => 'QUANTITY2',
359: avalue => l_sum_loct_onhand2) ;
360:
366: ELSIF (p_funcmode = 'TIMEOUT') THEN
367: p_resultout := 'COMPLETE' ;
368:
369: ELSE
370: l_lot_no := WF_ENGINE.GETITEMATTRTEXT (p_itemtype,
371: p_itemkey,
372: 'LOT_NO');
373:
374: WF_ENGINE.SETITEMATTRTEXT (itemtype => p_itemtype,
370: l_lot_no := WF_ENGINE.GETITEMATTRTEXT (p_itemtype,
371: p_itemkey,
372: 'LOT_NO');
373:
374: WF_ENGINE.SETITEMATTRTEXT (itemtype => p_itemtype,
375: itemkey => p_itemkey,
376: aname => 'ERRMSG',
377: avalue => 'Bad p_funcmode passed to ' ||
378: 'the workflow lot retest ' ||
390:
391: l_sqlcode := SQLCODE;
392: l_sqlerrm := SQLERRM(-l_sqlcode);
393:
394: l_lot_no := WF_ENGINE.GETITEMATTRTEXT (p_itemtype,
395: p_itemkey,
396: 'LOT_NO');
397:
398: l_sublot_no := WF_ENGINE.GETITEMATTRTEXT (p_itemtype,
394: l_lot_no := WF_ENGINE.GETITEMATTRTEXT (p_itemtype,
395: p_itemkey,
396: 'LOT_NO');
397:
398: l_sublot_no := WF_ENGINE.GETITEMATTRTEXT (p_itemtype,
399: p_itemkey,
400: 'SUBLOT_NO');
401:
402: WF_ENGINE.SETITEMATTRTEXT (itemtype => p_itemtype,
398: l_sublot_no := WF_ENGINE.GETITEMATTRTEXT (p_itemtype,
399: p_itemkey,
400: 'SUBLOT_NO');
401:
402: WF_ENGINE.SETITEMATTRTEXT (itemtype => p_itemtype,
403: itemkey => p_itemkey,
404: aname => 'ERRMSG',
405: avalue => 'A database error occurred in ' ||
406: 'the workflow lot retest ' ||