33: fetch csr_wiav into l_dummy;
34: if csr_wiav%notfound then
35: --
36: -- item attribute does not exist so create it
37: wf_engine.additemattr
38: (itemtype => p_item_type
39: ,itemkey => p_item_key
40: ,aname => p_name);
41: end if;
202: ELSE
203: l_item_key := 'LP^' ||p_lp_enrollment_id || '^' || l_lp_details.notify_days_before_target||'^' ||to_char(sysdate,'DDMMRRRR');
204: END IF;
205:
206: WF_ENGINE.CREATEPROCESS(l_item_type, l_item_key, l_process);
207: --Enh 5606090: Language support for LrngPath.
208: WF_ENGINE.setitemattrtext(l_item_type, l_item_key, 'LP_NAME', p_lp_enrollment_id);
209: WF_ENGINE.setitemattrdate(l_item_type, l_item_key, 'TARGET_DATE', l_lp_details.completion_target);
210: WF_ENGINE.setitemattrdate(l_item_type, l_item_key, 'COMPLETION_DATE', l_lp_details.completion_date);
204: END IF;
205:
206: WF_ENGINE.CREATEPROCESS(l_item_type, l_item_key, l_process);
207: --Enh 5606090: Language support for LrngPath.
208: WF_ENGINE.setitemattrtext(l_item_type, l_item_key, 'LP_NAME', p_lp_enrollment_id);
209: WF_ENGINE.setitemattrdate(l_item_type, l_item_key, 'TARGET_DATE', l_lp_details.completion_target);
210: WF_ENGINE.setitemattrdate(l_item_type, l_item_key, 'COMPLETION_DATE', l_lp_details.completion_date);
211: WF_ENGINE.setitemattrnumber(l_item_type, l_item_key, 'NOTIFY_DAYS_BEFORE_TARGET', l_lp_details.notify_days_before_target);
212:
205:
206: WF_ENGINE.CREATEPROCESS(l_item_type, l_item_key, l_process);
207: --Enh 5606090: Language support for LrngPath.
208: WF_ENGINE.setitemattrtext(l_item_type, l_item_key, 'LP_NAME', p_lp_enrollment_id);
209: WF_ENGINE.setitemattrdate(l_item_type, l_item_key, 'TARGET_DATE', l_lp_details.completion_target);
210: WF_ENGINE.setitemattrdate(l_item_type, l_item_key, 'COMPLETION_DATE', l_lp_details.completion_date);
211: WF_ENGINE.setitemattrnumber(l_item_type, l_item_key, 'NOTIFY_DAYS_BEFORE_TARGET', l_lp_details.notify_days_before_target);
212:
213: create_item_attrib_if_notexist(p_item_type => l_item_type
206: WF_ENGINE.CREATEPROCESS(l_item_type, l_item_key, l_process);
207: --Enh 5606090: Language support for LrngPath.
208: WF_ENGINE.setitemattrtext(l_item_type, l_item_key, 'LP_NAME', p_lp_enrollment_id);
209: WF_ENGINE.setitemattrdate(l_item_type, l_item_key, 'TARGET_DATE', l_lp_details.completion_target);
210: WF_ENGINE.setitemattrdate(l_item_type, l_item_key, 'COMPLETION_DATE', l_lp_details.completion_date);
211: WF_ENGINE.setitemattrnumber(l_item_type, l_item_key, 'NOTIFY_DAYS_BEFORE_TARGET', l_lp_details.notify_days_before_target);
212:
213: create_item_attrib_if_notexist(p_item_type => l_item_type
214: ,p_item_key => l_item_key
207: --Enh 5606090: Language support for LrngPath.
208: WF_ENGINE.setitemattrtext(l_item_type, l_item_key, 'LP_NAME', p_lp_enrollment_id);
209: WF_ENGINE.setitemattrdate(l_item_type, l_item_key, 'TARGET_DATE', l_lp_details.completion_target);
210: WF_ENGINE.setitemattrdate(l_item_type, l_item_key, 'COMPLETION_DATE', l_lp_details.completion_date);
211: WF_ENGINE.setitemattrnumber(l_item_type, l_item_key, 'NOTIFY_DAYS_BEFORE_TARGET', l_lp_details.notify_days_before_target);
212:
213: create_item_attrib_if_notexist(p_item_type => l_item_type
214: ,p_item_key => l_item_key
215: ,p_name => 'LP_ENROLLMENT_ID');
212:
213: create_item_attrib_if_notexist(p_item_type => l_item_type
214: ,p_item_key => l_item_key
215: ,p_name => 'LP_ENROLLMENT_ID');
216: WF_ENGINE.setitemattrnumber(l_item_type,l_item_key,'LP_ENROLLMENT_ID',p_lp_enrollment_id);
217: l_person_id := l_lp_details.person_id;
218: l_contact_id := l_lp_details.contact_id;
219:
220: IF l_lp_details.creator_person_id <> l_person_id THEN
221: OPEN csr_get_person_name(l_lp_details.creator_person_id);
222: FETCH csr_get_person_name INTO l_creator_person_name;
223: CLOSE csr_get_person_name;
224: fnd_file.put_line(FND_FILE.LOG,'creator_person_id ' || l_creator_person_name);
225: WF_ENGINE.setitemattrtext(l_item_type,l_item_key,'LP_CREATOR_NAME',l_creator_person_name);
226: END IF;
227:
228: ELSIF p_lp_notification_type IS NOT NULL THEN
229: OPEN csr_get_lpm_details;
231: CLOSE csr_get_lpm_details;
232:
233: l_item_key := 'LPM^' ||p_lp_member_enrollment_id || '^' || l_lpm_details.notify_days_before_target||'^' ||to_char(sysdate,'DDMMRRRR');
234:
235: WF_ENGINE.CREATEPROCESS(l_item_type, l_item_key, l_process);
236:
237:
238: WF_ENGINE.setitemattrtext(l_item_type, l_item_key, 'COURSE_NAME', l_lpm_details.course_name);
239: --Enh 5606090: Language support for LrngPath.
234:
235: WF_ENGINE.CREATEPROCESS(l_item_type, l_item_key, l_process);
236:
237:
238: WF_ENGINE.setitemattrtext(l_item_type, l_item_key, 'COURSE_NAME', l_lpm_details.course_name);
239: --Enh 5606090: Language support for LrngPath.
240: WF_ENGINE.setitemattrtext(l_item_type, l_item_key, 'LP_NAME', p_lp_member_enrollment_id);
241: WF_ENGINE.setitemattrdate(l_item_type, l_item_key, 'TARGET_DATE', l_lpm_details.completion_target);
242: create_item_attrib_if_notexist(p_item_type => l_item_type
236:
237:
238: WF_ENGINE.setitemattrtext(l_item_type, l_item_key, 'COURSE_NAME', l_lpm_details.course_name);
239: --Enh 5606090: Language support for LrngPath.
240: WF_ENGINE.setitemattrtext(l_item_type, l_item_key, 'LP_NAME', p_lp_member_enrollment_id);
241: WF_ENGINE.setitemattrdate(l_item_type, l_item_key, 'TARGET_DATE', l_lpm_details.completion_target);
242: create_item_attrib_if_notexist(p_item_type => l_item_type
243: ,p_item_key => l_item_key
244: ,p_name => 'LPM_ENROLLMENT_ID');
237:
238: WF_ENGINE.setitemattrtext(l_item_type, l_item_key, 'COURSE_NAME', l_lpm_details.course_name);
239: --Enh 5606090: Language support for LrngPath.
240: WF_ENGINE.setitemattrtext(l_item_type, l_item_key, 'LP_NAME', p_lp_member_enrollment_id);
241: WF_ENGINE.setitemattrdate(l_item_type, l_item_key, 'TARGET_DATE', l_lpm_details.completion_target);
242: create_item_attrib_if_notexist(p_item_type => l_item_type
243: ,p_item_key => l_item_key
244: ,p_name => 'LPM_ENROLLMENT_ID');
245: WF_ENGINE.setitemattrnumber(l_item_type,l_item_key,'LPM_ENROLLMENT_ID',p_lp_member_enrollment_id);
241: WF_ENGINE.setitemattrdate(l_item_type, l_item_key, 'TARGET_DATE', l_lpm_details.completion_target);
242: create_item_attrib_if_notexist(p_item_type => l_item_type
243: ,p_item_key => l_item_key
244: ,p_name => 'LPM_ENROLLMENT_ID');
245: WF_ENGINE.setitemattrnumber(l_item_type,l_item_key,'LPM_ENROLLMENT_ID',p_lp_member_enrollment_id);
246: WF_ENGINE.setitemattrnumber(l_item_type, l_item_key, 'NOTIFY_DAYS_BEFORE_TARGET', l_lpm_details.notify_days_before_target);
247: l_person_id := l_lpm_details.person_id;
248: l_contact_id := l_lpm_details.contact_id;
249:
242: create_item_attrib_if_notexist(p_item_type => l_item_type
243: ,p_item_key => l_item_key
244: ,p_name => 'LPM_ENROLLMENT_ID');
245: WF_ENGINE.setitemattrnumber(l_item_type,l_item_key,'LPM_ENROLLMENT_ID',p_lp_member_enrollment_id);
246: WF_ENGINE.setitemattrnumber(l_item_type, l_item_key, 'NOTIFY_DAYS_BEFORE_TARGET', l_lpm_details.notify_days_before_target);
247: l_person_id := l_lpm_details.person_id;
248: l_contact_id := l_lpm_details.contact_id;
249:
250:
252: OPEN csr_get_person_name(l_lpm_details.creator_person_id);
253: FETCH csr_get_person_name INTO l_creator_person_name;
254: CLOSE csr_get_person_name;
255: fnd_file.put_line(FND_FILE.LOG,'creator_person_id ' || l_creator_person_name);
256: WF_ENGINE.setitemattrtext(l_item_type,l_item_key,'LP_CREATOR_NAME',l_creator_person_name);
257: END IF;
258:
259: IF p_lp_notification_type = 'LNR_CTG_LPM_REMINDER' OR p_lp_notification_type = 'MGR_CTG_LPM_REMINDER' THEN
260: OPEN csr_get_section_name;
259: IF p_lp_notification_type = 'LNR_CTG_LPM_REMINDER' OR p_lp_notification_type = 'MGR_CTG_LPM_REMINDER' THEN
260: OPEN csr_get_section_name;
261: FETCH csr_get_section_name INTO l_section_name;
262: CLOSE csr_get_section_name;
263: WF_ENGINE.setitemattrtext(l_item_type,l_item_key,'SECTION_NAME',l_section_name);
264: END IF;
265:
266: END IF;
267:
267:
268: create_item_attrib_if_notexist(p_item_type => l_item_type
269: ,p_item_key => l_item_key
270: ,p_name => 'LP_NOTIFICATION_TYPE');
271: WF_ENGINE.setitemattrtext(l_item_type, l_item_key, 'LP_NOTIFICATION_TYPE', p_lp_notification_type);
272:
273:
274: IF l_person_id IS NOT NULL THEN
275: l_person_details := ota_learner_enroll_ss.Get_Person_To_Enroll_Details(p_person_id => l_person_id);
290: END IF;
291:
292:
293: IF l_person_details.full_name IS NOT NULL then
294: WF_ENGINE.setitemattrtext(l_item_type,l_item_key,'EVENT_OWNER',l_user_name);
295: WF_ENGINE.setitemattrtext(l_item_type,l_item_key,'LP_ENROLLEE',l_person_details.full_name);
296: END IF;
297: ELSIF l_contact_id IS NOT NULL THEN
298: OPEN csr_get_contact_name;
291:
292:
293: IF l_person_details.full_name IS NOT NULL then
294: WF_ENGINE.setitemattrtext(l_item_type,l_item_key,'EVENT_OWNER',l_user_name);
295: WF_ENGINE.setitemattrtext(l_item_type,l_item_key,'LP_ENROLLEE',l_person_details.full_name);
296: END IF;
297: ELSIF l_contact_id IS NOT NULL THEN
298: OPEN csr_get_contact_name;
299: FETCH csr_get_contact_name INTO l_contact_name;
318: ELSE
319: CLOSE csr_get_contact_user_name;
320: END IF;
321:
322: WF_ENGINE.setitemattrtext(l_item_type,l_item_key,'LP_ENROLLEE',l_contact_name);
323: WF_ENGINE.setitemattrtext(l_item_type,l_item_key,'EVENT_OWNER',l_user_name);
324: END IF;
325:
326:
319: CLOSE csr_get_contact_user_name;
320: END IF;
321:
322: WF_ENGINE.setitemattrtext(l_item_type,l_item_key,'LP_ENROLLEE',l_contact_name);
323: WF_ENGINE.setitemattrtext(l_item_type,l_item_key,'EVENT_OWNER',l_user_name);
324: END IF;
325:
326:
327:
334: p_name =>l_role_name,
335: p_display_name =>l_role_display_name);
336:
337:
338: WF_ENGINE.SetItemOwner(itemtype => l_item_type,
339: itemkey =>l_item_key,
340: owner =>l_role_name);
341:
342: hr_utility.set_location('After Setting Owner'||l_proc, 10);
341:
342: hr_utility.set_location('After Setting Owner'||l_proc, 10);
343:
344:
345: WF_ENGINE.STARTPROCESS(l_item_type,l_item_key);
346:
347: hr_utility.set_location('leaving:'||l_proc, 20);
348:
349: EXCEPTION
361:
362: l_notification_type varchar2(30);
363: BEGIN
364: IF (funcmode='RUN') THEN
365: l_notification_type := WF_ENGINE.getitemattrtext(itemtype => itemtype,
366: itemkey => itemkey,
367: aname =>'LP_NOTIFICATION_TYPE',
368: ignore_notfound => true);
369: resultout := 'COMPLETE:'||l_notification_type;
408:
409: BEGIN
410: --
411: IF (funcmode = 'RUN') THEN
412: l_lp_enrollment_id := wf_engine.getItemAttrNumber
413: (itemtype => itemtype
414: ,itemkey => itemkey
415: ,aname => 'LP_ENROLLMENT_ID');
416:
416:
417: OPEN csr_get_manager_name;
418: FETCH csr_get_manager_name INTO l_manager_details;
419: IF csr_get_manager_name%FOUND THEN
420: WF_ENGINE.setitemattrtext(itemtype,itemkey,'LP_CREATOR_NAME',l_manager_details.full_name);
421: create_item_attrib_if_notexist(p_item_type => itemtype
422: ,p_item_key => itemkey
423: ,p_name => 'MANAGER_ID');
424: WF_ENGINE.setitemattrNumber(itemtype,itemkey,'MANAGER_ID',l_manager_details.person_id);
420: WF_ENGINE.setitemattrtext(itemtype,itemkey,'LP_CREATOR_NAME',l_manager_details.full_name);
421: create_item_attrib_if_notexist(p_item_type => itemtype
422: ,p_item_key => itemkey
423: ,p_name => 'MANAGER_ID');
424: WF_ENGINE.setitemattrNumber(itemtype,itemkey,'MANAGER_ID',l_manager_details.person_id);
425: CLOSE csr_get_manager_name;
426: OPEN csr_get_user_name(l_manager_details.person_id);
427: FETCH csr_get_user_name INTO l_manager_user_name;
428: IF csr_get_user_name%FOUND THEN
425: CLOSE csr_get_manager_name;
426: OPEN csr_get_user_name(l_manager_details.person_id);
427: FETCH csr_get_user_name INTO l_manager_user_name;
428: IF csr_get_user_name%FOUND THEN
429: WF_ENGINE.setitemattrText(itemtype,itemkey,'EVENT_OWNER',l_manager_user_name);
430: END IF;
431: CLOSE csr_get_user_name;
432: resultout := 'COMPLETE:T';
433: ELSE
471:
472: BEGIN
473: --
474: IF (funcmode = 'RUN') THEN
475: l_manager_id := wf_engine.getItemAttrNumber
476: (itemtype => itemtype
477: ,itemkey => itemkey
478: ,aname => 'MANAGER_ID');
479:
476: (itemtype => itemtype
477: ,itemkey => itemkey
478: ,aname => 'MANAGER_ID');
479:
480: l_lp_enrollment_id := wf_engine.getItemAttrNumber
481: (itemtype => itemtype
482: ,itemkey => itemkey
483: ,aname => 'LP_ENROLLMENT_ID');
484: OPEN csr_get_creator_name;
486: IF l_creator_details.person_id = l_manager_id THEN
487: CLOSE csr_get_creator_name;
488: resultout := 'COMPLETE:T';
489: ELSE
490: WF_ENGINE.setitemattrtext(itemtype,itemkey,'LP_CREATOR_NAME',l_creator_details.full_name);
491: create_item_attrib_if_notexist(p_item_type => itemtype
492: ,p_item_key => itemkey
493: ,p_name => 'MANAGER_ID');
494: WF_ENGINE.setitemattrNumber(itemtype,itemkey,'MANAGER_ID',l_creator_details.person_id);
490: WF_ENGINE.setitemattrtext(itemtype,itemkey,'LP_CREATOR_NAME',l_creator_details.full_name);
491: create_item_attrib_if_notexist(p_item_type => itemtype
492: ,p_item_key => itemkey
493: ,p_name => 'MANAGER_ID');
494: WF_ENGINE.setitemattrNumber(itemtype,itemkey,'MANAGER_ID',l_creator_details.person_id);
495: CLOSE csr_get_creator_name;
496: OPEN csr_get_user_name(l_creator_details.person_id);
497: FETCH csr_get_user_name INTO l_manager_user_name;
498: IF csr_get_user_name%FOUND THEN
495: CLOSE csr_get_creator_name;
496: OPEN csr_get_user_name(l_creator_details.person_id);
497: FETCH csr_get_user_name INTO l_manager_user_name;
498: IF csr_get_user_name%FOUND THEN
499: WF_ENGINE.setitemattrText(itemtype,itemkey,'EVENT_OWNER',l_manager_user_name);
500: END IF;
501: CLOSE csr_get_user_name;
502: resultout := 'COMPLETE:F';
503: END IF;