2325: SELECT na.NAME
2326: , na.TEXT_VALUE
2327: , na.NUMBER_VALUE
2328: , na.DATE_VALUE
2329: FROM WF_NOTIFICATION_ATTRIBUTES na,
2330: WF_MESSAGE_ATTRIBUTES ma,
2331: WF_NOTIFICATIONS ntf
2332: WHERE ntf.NOTIFICATION_ID = p_orig_ntf_id
2333: AND na.NOTIFICATION_ID = ntf.NOTIFICATION_ID
2327: , na.NUMBER_VALUE
2328: , na.DATE_VALUE
2329: FROM WF_NOTIFICATION_ATTRIBUTES na,
2330: WF_MESSAGE_ATTRIBUTES ma,
2331: WF_NOTIFICATIONS ntf
2332: WHERE ntf.NOTIFICATION_ID = p_orig_ntf_id
2333: AND na.NOTIFICATION_ID = ntf.NOTIFICATION_ID
2334: AND ma.MESSAGE_NAME = ntf.MESSAGE_NAME
2335: AND ma.MESSAGE_TYPE = ntf.MESSAGE_TYPE
2355: IF ntf_resp_rec.TEXT_VALUE IS NOT NULL
2356: THEN
2357:
2358:
2359: WF_NOTIFICATION.SetAttrText
2360: ( nid => p_dupllicate_ntf_id
2361: , aname => ntf_resp_rec.NAME
2362: , avalue => ntf_resp_rec.TEXT_VALUE
2363: );
2366:
2367: IF ntf_resp_rec.NUMBER_VALUE IS NOT NULL
2368: THEN
2369:
2370: WF_NOTIFICATION.SetAttrNumber
2371: ( nid => p_dupllicate_ntf_id
2372: , aname => ntf_resp_rec.NAME
2373: , avalue => ntf_resp_rec.NUMBER_VALUE
2374: );
2377:
2378: IF ntf_resp_rec.DATE_VALUE IS NOT NULL
2379: THEN
2380:
2381: WF_NOTIFICATION.SetAttrDate
2382: ( nid => p_dupllicate_ntf_id
2383: , aname => ntf_resp_rec.NAME
2384: , avalue => ntf_resp_rec.DATE_VALUE
2385: );
2388:
2389: END LOOP ;
2390:
2391: IF g_debug_flag THEN
2392: Write_Debug('Calling WF_NOTIFICATION.RESPOND for Target Dup Ntf ');
2393: END IF ;
2394:
2395: WF_NOTIFICATION.RESPOND
2396: ( nid => p_dupllicate_ntf_id -- nid in number
2391: IF g_debug_flag THEN
2392: Write_Debug('Calling WF_NOTIFICATION.RESPOND for Target Dup Ntf ');
2393: END IF ;
2394:
2395: WF_NOTIFICATION.RESPOND
2396: ( nid => p_dupllicate_ntf_id -- nid in number
2397: , responder => p_responder -- responder in varchar2 default null
2398: ) ;
2399:
7567: CURSOR c_ntf (p_notification_id NUMBER)
7568: IS
7569: SELECT fu.user_id
7570: FROM FND_USER fu
7571: , WF_NOTIFICATIONS wn
7572: WHERE fu.user_name = wn.recipient_role
7573: AND wn.notification_id = p_notification_id ;
7574:
7575:
7638:
7639: IF p_comment IS NULL THEN
7640:
7641: /*
7642: l_comment := WF_NOTIFICATION.GetAttrText
7643: ( nid => p_notification_id
7644: , aname => 'RESPONSE_COMMENT');
7645: */
7646:
7643: ( nid => p_notification_id
7644: , aname => 'RESPONSE_COMMENT');
7645: */
7646:
7647: l_comment := WF_NOTIFICATION.GetAttrText
7648: ( nid => p_notification_id
7649: , aname => 'WF_NOTE');
7650:
7651: IF g_debug_flag THEN
8289: , RoutePeople.original_assignee_type_code
8290: , RoutePeople.response_condition_code
8291: FROM ENG_CHANGE_ROUTE_PEOPLE RoutePeople
8292: , ENG_SECURITY_PEOPLE_V EngSecPeople
8293: , WF_NOTIFICATIONS wn
8294: WHERE RoutePeople.assignee_id = EngSecPeople.person_id
8295: -- AND RoutePeople.assignee_type_code = p_assignee_type_code
8296: AND RoutePeople.step_id = p_step_id
8297: AND EngSecPeople.user_name = wn.recipient_role
8306: ntf.RECIPIENT_ROLE,
8307: ntf.MESSAGE_NAME,
8308: ntf.message_type
8309: FROM WF_ITEM_ACTIVITY_STATUSES wias,
8310: WF_NOTIFICATIONS ntf ,
8311: WF_NOTIFICATIONS orig_ntf
8312: WHERE ntf.STATUS = 'OPEN'
8313: AND wias.NOTIFICATION_ID = ntf.group_id
8314: AND wias.NOTIFICATION_ID IS NOT NULL
8307: ntf.MESSAGE_NAME,
8308: ntf.message_type
8309: FROM WF_ITEM_ACTIVITY_STATUSES wias,
8310: WF_NOTIFICATIONS ntf ,
8311: WF_NOTIFICATIONS orig_ntf
8312: WHERE ntf.STATUS = 'OPEN'
8313: AND wias.NOTIFICATION_ID = ntf.group_id
8314: AND wias.NOTIFICATION_ID IS NOT NULL
8315: AND (wias.ACTIVITY_STATUS = 'NOTIFIED' OR wias.ACTIVITY_STATUS = 'ERROR')
8319: AND ntf.GROUP_ID = orig_ntf.GROUP_ID
8320: AND ntf.NOTIFICATION_ID <> orig_ntf.NOTIFICATION_ID
8321: AND orig_ntf.NOTIFICATION_ID = p_orig_ntf_id
8322: AND EXISTS (SELECT 1
8323: FROM WF_NOTIFICATION_ATTRIBUTES na,
8324: WF_MESSAGE_ATTRIBUTES ma
8325: WHERE na.NOTIFICATION_ID = ntf.NOTIFICATION_ID
8326: AND ma.MESSAGE_NAME = ntf.MESSAGE_NAME
8327: AND ma.MESSAGE_TYPE = ntf.MESSAGE_TYPE
8411:
8412: IF p_comment IS NULL THEN
8413:
8414: /*
8415: l_comment := WF_NOTIFICATION.GetAttrText
8416: ( nid => p_notification_id
8417: , aname => 'RESPONSE_COMMENT');
8418: */
8419:
8416: ( nid => p_notification_id
8417: , aname => 'RESPONSE_COMMENT');
8418: */
8419:
8420: l_comment := WF_NOTIFICATION.GetAttrText
8421: ( nid => p_notification_id
8422: , aname => 'WF_NOTE');
8423:
8424:
8482: X_RESPONSE_DATE => SYSDATE ,
8483: X_STEP_ID => l_step_id,
8484: X_ASSIGNEE_TYPE_CODE => l_assignee_type_code,
8485: X_ADHOC_PEOPLE_FLAG => l_adhoc_people_flag,
8486: X_WF_NOTIFICATION_ID => p_notification_id,
8487: X_RESPONSE_CODE => p_response_code,
8488: X_RESPONSE_DESCRIPTION => l_comment ,
8489: X_LAST_UPDATE_DATE => SYSDATE ,
8490: X_LAST_UPDATED_BY => l_performer_user_id ,
8498: ) ;
8499: */
8500:
8501: update ENG_CHANGE_ROUTE_PEOPLE set
8502: WF_NOTIFICATION_ID = p_notification_id,
8503: RESPONSE_CODE = p_response_code ,
8504: RESPONSE_DATE = SYSDATE ,
8505: LAST_UPDATE_DATE = SYSDATE ,
8506: LAST_UPDATED_BY = l_performer_user_id ,
8567: -- Check Notifiation Result to make sure
8568: -- this notifiaction has not been responded
8569: -- WF Code has cache mechanism
8570: -- So just querying table is not enough
8571: l_result := WF_NOTIFICATION.GetAttrText(nid => dup_ntf_rec.notification_id
8572: ,aname => 'RESULT' ) ;
8573:
8574: IF g_debug_flag THEN
8575: Write_Debug('Duplicate Ntf Result : ' || l_result ) ;
9683: -- d. REQUIRE_ALL_VOTES and all votes are cast
9684: -- Tally votes.
9685: for result_rec in result_codes loop
9686: -- Tally Vote Count for this result code
9687: Wf_Notification.VoteCount(l_group_id,result_rec.result_code,
9688: l_code_count,l_per_of_total,l_per_of_vote);
9689:
9690: IF g_debug_flag THEN
9691: Write_Debug('Couting result code : ' || result_rec.result_code );
9790:
9791:
9792: -- If we get here no non-default results were satisfied.
9793: if (funcmode = wf_engine.eng_run and
9794: wf_notification.OpenNotificationsExist(l_group_id)) then
9795: -- Not timed out and still open notifications.
9796: -- Return waiting to continue voting.
9797:
9798: IF g_debug_flag THEN
9881: SELECT COUNT(*)
9882: INTO l_total_pop
9883: FROM ENG_CHANGE_ROUTE_PEOPLE RoutePeople
9884: , EGO_USER_V UserV
9885: , WF_NOTIFICATIONS wn
9886: WHERE RoutePeople.assignee_id = UserV.party_id
9887: AND RoutePeople.response_condition_code = 'MANDATORY'
9888: AND RoutePeople.step_id = StepId
9889: AND UserV.user_name = wn.recipient_role
9893: SELECT COUNT(*)
9894: INTO l_total_voted
9895: FROM ENG_CHANGE_ROUTE_PEOPLE RoutePeople
9896: , EGO_USER_V UserV
9897: , WF_NOTIFICATIONS wn
9898: WHERE RoutePeople.assignee_id = UserV.party_id
9899: AND RoutePeople.response_condition_code = 'MANDATORY'
9900: AND RoutePeople.step_id = StepId
9901: AND UserV.user_name = wn.recipient_role
9906: SELECT COUNT(*)
9907: INTO l_code_count
9908: FROM ENG_CHANGE_ROUTE_PEOPLE RoutePeople
9909: , EGO_USER_V UserV
9910: , WF_NOTIFICATION_ATTRIBUTES wfna
9911: , WF_NOTIFICATIONS wn
9912: WHERE RoutePeople.assignee_id = UserV.party_id
9913: AND RoutePeople.response_condition_code = 'MANDATORY'
9914: AND RoutePeople.step_id = StepId
9907: INTO l_code_count
9908: FROM ENG_CHANGE_ROUTE_PEOPLE RoutePeople
9909: , EGO_USER_V UserV
9910: , WF_NOTIFICATION_ATTRIBUTES wfna
9911: , WF_NOTIFICATIONS wn
9912: WHERE RoutePeople.assignee_id = UserV.party_id
9913: AND RoutePeople.response_condition_code = 'MANDATORY'
9914: AND RoutePeople.step_id = StepId
9915: AND UserV.user_name = wn.recipient_role
10009:
10010:
10011: ELSE
10012:
10013: Wf_Notification.VoteCount
10014: (Gid => Gid ,
10015: ResultCode => ResultCode ,
10016: ResultCount => ResultCount,
10017: PercentOfTotalPop => PercentOfTotalPop,
10198:
10199: ELSE
10200:
10201: -- Tally Vote Count for this result code
10202: Wf_Notification.VoteCount(l_group_id,result_rec.result_code,
10203: l_code_count,l_per_of_total,l_per_of_vote);
10204:
10205: END IF ;
10206:
10308:
10309:
10310: -- If we get here no non-default results were satisfied.
10311: if (funcmode = wf_engine.eng_run and
10312: wf_notification.OpenNotificationsExist(l_group_id)) then
10313: -- Not timed out and still open notifications.
10314: -- Return waiting to continue voting.
10315:
10316: IF g_debug_flag THEN
10692: IS
10693:
10694: SELECT UserV.user_id user_id
10695: FROM EGO_USER_V UserV
10696: , WF_NOTIFICATIONS wf
10697: WHERE UserV.user_name = wf.recipient_role
10698: AND wf.notification_id = p_ntf_id ;
10699:
10700:
10694: SELECT UserV.user_id user_id
10695: FROM EGO_USER_V UserV
10696: , WF_NOTIFICATIONS wf
10697: WHERE UserV.user_name = wf.recipient_role
10698: AND wf.notification_id = p_ntf_id ;
10699:
10700:
10701: CURSOR c_person_id (p_user_id NUMBER)
10702: IS
10809: IS
10810:
10811: SELECT UserV.user_id user_id
10812: FROM EGO_USER_V UserV
10813: , WF_NOTIFICATIONS wf
10814: WHERE UserV.user_name = wf.recipient_role
10815: AND wf.notification_id = p_ntf_id ;
10816:
10817:
10811: SELECT UserV.user_id user_id
10812: FROM EGO_USER_V UserV
10813: , WF_NOTIFICATIONS wf
10814: WHERE UserV.user_name = wf.recipient_role
10815: AND wf.notification_id = p_ntf_id ;
10816:
10817:
10818: CURSOR c_person_id (p_user_id NUMBER)
10819: IS
11129: ntf.RECIPIENT_ROLE,
11130: ntf.MESSAGE_NAME,
11131: ntf.message_type
11132: FROM WF_ITEM_ACTIVITY_STATUSES wias,
11133: WF_NOTIFICATIONS ntf
11134: WHERE ntf.STATUS = 'OPEN'
11135: AND wias.NOTIFICATION_ID = ntf.group_id
11136: AND wias.NOTIFICATION_ID IS NOT NULL
11137: AND (wias.ACTIVITY_STATUS = 'NOTIFIED' OR wias.ACTIVITY_STATUS = 'ERROR')
11138: AND wias.ITEM_TYPE = p_item_type
11139: AND wias.ITEM_KEY = p_item_key
11140: AND ntf.RECIPIENT_ROLE = p_responder
11141: AND EXISTS (SELECT 1
11142: FROM WF_NOTIFICATION_ATTRIBUTES na,
11143: WF_MESSAGE_ATTRIBUTES ma
11144: WHERE na.NOTIFICATION_ID = ntf.NOTIFICATION_ID
11145: AND ma.MESSAGE_NAME = ntf.MESSAGE_NAME
11146: AND ma.MESSAGE_TYPE = ntf.MESSAGE_TYPE
11183: END IF ;
11184:
11185:
11186: IF g_debug_flag THEN
11187: Write_Debug('Calling WF_NOTIFICATION.SetAttrText for RESULT' );
11188: END IF ;
11189:
11190:
11191: IF x_processed_ntf_id IS NOT NULL AND x_processed_ntf_id > 0
11189:
11190:
11191: IF x_processed_ntf_id IS NOT NULL AND x_processed_ntf_id > 0
11192: THEN
11193: WF_NOTIFICATION.SetAttrText
11194: ( nid => x_processed_ntf_id
11195: , aname => 'RESULT'
11196: , avalue => G_REPLY
11197: );
11196: , avalue => G_REPLY
11197: );
11198:
11199: IF g_debug_flag THEN
11200: Write_Debug('Calling WF_NOTIFICATION.SetAttrText for WF_NOTE' );
11201: END IF ;
11202:
11203: WF_NOTIFICATION.SetAttrText
11204: ( nid => x_processed_ntf_id
11199: IF g_debug_flag THEN
11200: Write_Debug('Calling WF_NOTIFICATION.SetAttrText for WF_NOTE' );
11201: END IF ;
11202:
11203: WF_NOTIFICATION.SetAttrText
11204: ( nid => x_processed_ntf_id
11205: , aname => 'WF_NOTE'
11206: , avalue=> p_response_comment) ;
11207:
11205: , aname => 'WF_NOTE'
11206: , avalue=> p_response_comment) ;
11207:
11208: IF g_debug_flag THEN
11209: Write_Debug('Calling WF_NOTIFICATION.RESPOND' );
11210: END IF ;
11211:
11212: WF_NOTIFICATION.RESPOND
11213: ( nid => x_processed_ntf_id -- nid in number
11208: IF g_debug_flag THEN
11209: Write_Debug('Calling WF_NOTIFICATION.RESPOND' );
11210: END IF ;
11211:
11212: WF_NOTIFICATION.RESPOND
11213: ( nid => x_processed_ntf_id -- nid in number
11214: , responder => p_responder -- responder in varchar2 default null
11215: ) ;
11216:
13230: , RoutePeople.original_assignee_type_code
13231: , RoutePeople.response_condition_code
13232: FROM ENG_CHANGE_ROUTE_PEOPLE RoutePeople
13233: , ENG_SECURITY_PEOPLE_V EngSecPeople
13234: , WF_NOTIFICATIONS wn
13235: WHERE RoutePeople.assignee_id = EngSecPeople.person_id
13236: -- AND RoutePeople.assignee_type_code = p_assignee_type_code
13237: AND RoutePeople.step_id = p_step_id
13238: AND ( RoutePeople.response_code IS NULL
13337: l_response_condition_code := rtp_rec.response_condition_code ;
13338:
13339:
13340: update ENG_CHANGE_ROUTE_PEOPLE set
13341: WF_NOTIFICATION_ID = p_notification_id,
13342: RESPONSE_CODE = l_response_code ,
13343: RESPONSE_DATE = SYSDATE ,
13344: LAST_UPDATE_DATE = SYSDATE ,
13345: LAST_UPDATED_BY = l_performer_user_id ,
13388: X_STEP_ID => l_step_id ,
13389: X_ASSIGNEE_ID => l_new_party_id,
13390: X_ASSIGNEE_TYPE_CODE => G_PERSON,
13391: X_ADHOC_PEOPLE_FLAG => 'Y',
13392: X_WF_NOTIFICATION_ID => l_notification_id ,
13393: X_RESPONSE_CODE => l_default_assignee_resp ,
13394: X_RESPONSE_DATE => TO_DATE(NULL),
13395: X_REQUEST_ID => NULL,
13396: X_ORIGINAL_SYSTEM_REFERENCE => NULL,