1: PACKAGE BODY MSD_DEM_EVENT AS
2: /* $Header: msddemevntb.pls 120.11.12020000.3 2012/09/14 16:06:58 nallkuma ship $ */
3:
4:
5: /* Private Function - Added for creating the SOP component user in Demantra */
94: log_debug ('Schema: ' || x_schema);
95:
96: IF (x_schema IS NULL)
97: THEN
98: log ('msd_dem_event.user_change - Profile MSD_DEM_SCHEMA is not set.');
99: log_debug ('msd_dem_event.user_change - Profile MSD_DEM_SCHEMA is not set.');
100: RETURN SUCCESS;
101: ELSE
102: OPEN c_is_mdp_matrix_present (x_schema);
95:
96: IF (x_schema IS NULL)
97: THEN
98: log ('msd_dem_event.user_change - Profile MSD_DEM_SCHEMA is not set.');
99: log_debug ('msd_dem_event.user_change - Profile MSD_DEM_SCHEMA is not set.');
100: RETURN SUCCESS;
101: ELSE
102: OPEN c_is_mdp_matrix_present (x_schema);
103: FETCH c_is_mdp_matrix_present INTO x_table_name;
104: CLOSE c_is_mdp_matrix_present;
105:
106: IF (x_table_name IS NULL)
107: THEN
108: log ('msd_dem_event.user_change - Profile MSD_DEM_SCHEMA is incorrectly set or Demantra schema is not installed.');
109: log_debug ('msd_dem_event.user_change - Profile MSD_DEM_SCHEMA is incorrectly set or Demantra schema is not installed.');
110: RETURN SUCCESS;
111: END IF;
112: END IF;
105:
106: IF (x_table_name IS NULL)
107: THEN
108: log ('msd_dem_event.user_change - Profile MSD_DEM_SCHEMA is incorrectly set or Demantra schema is not installed.');
109: log_debug ('msd_dem_event.user_change - Profile MSD_DEM_SCHEMA is incorrectly set or Demantra schema is not installed.');
110: RETURN SUCCESS;
111: END IF;
112: END IF;
113: --Bug#7140524
145: log_debug ('Old User Name: ' || x_old_name);
146: END IF;
147:
148: ELSE
149: log_debug('Exiting msd_dem_event.user_change: Unknown Event');
150: RETURN SUCCESS;
151: END IF;
152:
153: /*** END- Get the user name from the event ***/
165: log_debug ('Unable to get user id for user name = ' || x_curr_name);
166: --Bug#7140524 : returning success in case user id not found, so that workflow calling this method will proceed without erroring out
167: return SUCCESS;
168: /*return ( handleError ( PKG_NAME
169: , 'msd_dem_event.user_change'
170: , p_event
171: , p_subscription_guid
172: , ERROR
173: ));*/
337: when others then
338: log_debug (substr(SQLERRM,1,150));
339: log ('Query on user_id ' || to_char(userid) || ' failed. Please ignore if not an Demand Management User.');
340: return ( handleError ( PKG_NAME
341: , 'msd_dem_event.user_change'
342: , p_event
343: , p_subscription_guid
344: , ERROR
345: ));
549: WHEN NO_DATA_FOUND THEN
550: log_debug ('excep no data');
551: LOG('No rows returned');
552: return ( handleError ( PKG_NAME
553: , 'msd_dem_event.user_change'
554: , p_event
555: , p_subscription_guid
556: , ERROR
557: ));
556: , ERROR
557: ));
558: WHEN OTHERS THEN
559: return ( handleError ( PKG_NAME
560: , 'msd_dem_event.user_change'
561: , p_event
562: , p_subscription_guid
563: , ERROR
564: ));
688: log_debug ('Old User Name: ' || x_old_name);
689: END IF;
690:
691: ELSE
692: log_debug('Exiting msd_dem_event.user_change: Unknown Event');
693: RETURN SUCCESS;
694: END IF;
695:
696: /*** END- Get the user name from the event ***/
708: log_debug ('Unable to get user id for user name = ' || x_curr_name);
709: --Bug#7140524 : returning success in case user id not found, so that workflow calling this method will proceed without erroring out
710: return SUCCESS;
711: /*return ( handleError ( PKG_NAME
712: , 'msd_dem_event.user_change'
713: , p_event
714: , p_subscription_guid
715: , ERROR
716: ));*/
844: when others then
845: log_debug (substr(SQLERRM,1,150));
846: log ('Query on user_id ' || to_char(userid) || ' failed. Please ignore if not an Sales and Operations Planning User.');
847: return ( handleError ( PKG_NAME
848: , 'msd_dem_event.user_change'
849: , p_event
850: , p_subscription_guid
851: , ERROR
852: ));
1062: WHEN NO_DATA_FOUND THEN
1063: log_debug ('excep no data');
1064: LOG('No rows returned');
1065: return ( handleError ( PKG_NAME
1066: , 'msd_dem_event.user_change'
1067: , p_event
1068: , p_subscription_guid
1069: , ERROR
1070: ));
1069: , ERROR
1070: ));
1071: WHEN OTHERS THEN
1072: return ( handleError ( PKG_NAME
1073: , 'msd_dem_event.user_change'
1074: , p_event
1075: , p_subscription_guid
1076: , ERROR
1077: ));
1120: RETURN 0;
1121: END GET_LANGUAGE_ID;
1122: */
1123:
1124: end msd_dem_event;