16: G_PKG_NAME CONSTANT VARCHAR2(30):= 'AMS_Rule_Group_PVT';
17: G_FILE_NAME CONSTANT VARCHAR2(12) := 'amsvrgpb.pls';
18:
19: -- Hint: Primary key needs to be returned.
20: AMS_DEBUG_HIGH_ON constant boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH);
21: AMS_DEBUG_LOW_ON constant boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW);
22: AMS_DEBUG_MEDIUM_ON constant boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_MEDIUM);
23:
24: PROCEDURE Create_Rule_Group(
17: G_FILE_NAME CONSTANT VARCHAR2(12) := 'amsvrgpb.pls';
18:
19: -- Hint: Primary key needs to be returned.
20: AMS_DEBUG_HIGH_ON constant boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH);
21: AMS_DEBUG_LOW_ON constant boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW);
22: AMS_DEBUG_MEDIUM_ON constant boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_MEDIUM);
23:
24: PROCEDURE Create_Rule_Group(
25: p_api_version_number IN NUMBER,
18:
19: -- Hint: Primary key needs to be returned.
20: AMS_DEBUG_HIGH_ON constant boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH);
21: AMS_DEBUG_LOW_ON constant boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW);
22: AMS_DEBUG_MEDIUM_ON constant boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_MEDIUM);
23:
24: PROCEDURE Create_Rule_Group(
25: p_api_version_number IN NUMBER,
26: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
72:
73: -- Initialize message list if p_init_msg_list is set to TRUE.
74: IF FND_API.to_Boolean( p_init_msg_list )
75: THEN
76: FND_MSG_PUB.initialize;
77: END IF;
78:
79: -- Debug Message
80: IF (AMS_DEBUG_HIGH_ON) THEN
116: l_no := 0;
117: END;
118:
119: IF (l_no > 0) THEN
120: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error)
121: THEN
122: FND_MESSAGE.set_name('AMS','AMS_POST_RULE_PRIOR_NOT_UNIQUE');
123: FND_MSG_PUB.add;
124: END IF;
119: IF (l_no > 0) THEN
120: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error)
121: THEN
122: FND_MESSAGE.set_name('AMS','AMS_POST_RULE_PRIOR_NOT_UNIQUE');
123: FND_MSG_PUB.add;
124: END IF;
125: RAISE FND_API.g_exc_error;
126: END IF;
127:
328: AMS_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'end');
329: END IF;
330:
331: -- Standard call to get message count and if count is 1, get message info.
332: FND_MSG_PUB.Count_And_Get
333: (p_count => x_msg_count,
334: p_data => x_msg_data
335: );
336:
343: WHEN FND_API.G_EXC_ERROR THEN
344: ROLLBACK TO CREATE_Rule_Group_PVT;
345: x_return_status := FND_API.G_RET_STS_ERROR;
346: -- Standard call to get message count and if count=1, get the message
347: FND_MSG_PUB.Count_And_Get (
348: p_encoded => FND_API.G_FALSE,
349: p_count => x_msg_count,
350: p_data => x_msg_data
351: );
353: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
354: ROLLBACK TO CREATE_Rule_Group_PVT;
355: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
356: -- Standard call to get message count and if count=1, get the message
357: FND_MSG_PUB.Count_And_Get (
358: p_encoded => FND_API.G_FALSE,
359: p_count => x_msg_count,
360: p_data => x_msg_data
361: );
362:
363: WHEN OTHERS THEN
364: ROLLBACK TO CREATE_Rule_Group_PVT;
365: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
366: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
367: THEN
368: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
369: END IF;
370: -- Standard call to get message count and if count=1, get the message
364: ROLLBACK TO CREATE_Rule_Group_PVT;
365: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
366: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
367: THEN
368: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
369: END IF;
370: -- Standard call to get message count and if count=1, get the message
371: FND_MSG_PUB.Count_And_Get (
372: p_encoded => FND_API.G_FALSE,
367: THEN
368: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
369: END IF;
370: -- Standard call to get message count and if count=1, get the message
371: FND_MSG_PUB.Count_And_Get (
372: p_encoded => FND_API.G_FALSE,
373: p_count => x_msg_count,
374: p_data => x_msg_data
375: );
422:
423: -- Initialize message list if p_init_msg_list is set to TRUE.
424: IF FND_API.to_Boolean( p_init_msg_list )
425: THEN
426: FND_MSG_PUB.initialize;
427: END IF;
428:
429: -- Debug Message
430: IF (AMS_DEBUG_HIGH_ON) THEN
447: WHEN NO_DATA_FOUND THEN
448: l_no := 0;
449: END;
450: IF (l_no > 0) THEN
451: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error)
452: THEN
453: FND_MESSAGE.set_name('AMS','AMS_POST_RULE_PRIOR_NOT_UNIQUE');
454: FND_MSG_PUB.add;
455: END IF;
450: IF (l_no > 0) THEN
451: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error)
452: THEN
453: FND_MESSAGE.set_name('AMS','AMS_POST_RULE_PRIOR_NOT_UNIQUE');
454: FND_MSG_PUB.add;
455: END IF;
456: RAISE FND_API.g_exc_error;
457: END IF;
458:
628: WHERE rulegroup_id = p_rule_group_rec.rulegroup_id
629: AND USERENV('LANG') IN (language, source_lang);
630:
631: IF (SQL%NOTFOUND) THEN
632: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
633: FND_MESSAGE.set_name('AMS', 'AMS_API_RECORD_NOT_FOUND');
634: FND_MSG_PUB.add;
635: END IF;
636: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
630:
631: IF (SQL%NOTFOUND) THEN
632: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
633: FND_MESSAGE.set_name('AMS', 'AMS_API_RECORD_NOT_FOUND');
634: FND_MSG_PUB.add;
635: END IF;
636: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
637: END IF;
638:
661: AMS_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'end');
662: END IF;
663:
664: -- Standard call to get message count and if count is 1, get message info.
665: FND_MSG_PUB.Count_And_Get
666: (p_count => x_msg_count,
667: p_data => x_msg_data
668: );
669: EXCEPTION
675: WHEN FND_API.G_EXC_ERROR THEN
676: ROLLBACK TO UPDATE_Rule_Group_PVT;
677: x_return_status := FND_API.G_RET_STS_ERROR;
678: -- Standard call to get message count and if count=1, get the message
679: FND_MSG_PUB.Count_And_Get (
680: p_encoded => FND_API.G_FALSE,
681: p_count => x_msg_count,
682: p_data => x_msg_data
683: );
685: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
686: ROLLBACK TO UPDATE_Rule_Group_PVT;
687: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
688: -- Standard call to get message count and if count=1, get the message
689: FND_MSG_PUB.Count_And_Get (
690: p_encoded => FND_API.G_FALSE,
691: p_count => x_msg_count,
692: p_data => x_msg_data
693: );
694:
695: WHEN OTHERS THEN
696: ROLLBACK TO UPDATE_Rule_Group_PVT;
697: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
698: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
699: THEN
700: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
701: END IF;
702: -- Standard call to get message count and if count=1, get the message
696: ROLLBACK TO UPDATE_Rule_Group_PVT;
697: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
698: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
699: THEN
700: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
701: END IF;
702: -- Standard call to get message count and if count=1, get the message
703: FND_MSG_PUB.Count_And_Get (
704: p_encoded => FND_API.G_FALSE,
699: THEN
700: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
701: END IF;
702: -- Standard call to get message count and if count=1, get the message
703: FND_MSG_PUB.Count_And_Get (
704: p_encoded => FND_API.G_FALSE,
705: p_count => x_msg_count,
706: p_data => x_msg_data
707: );
740:
741: -- Initialize message list if p_init_msg_list is set to TRUE.
742: IF FND_API.to_Boolean( p_init_msg_list )
743: THEN
744: FND_MSG_PUB.initialize;
745: END IF;
746:
747: -- Debug Message
748: IF (AMS_DEBUG_HIGH_ON) THEN
783: AMS_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'end');
784: END IF;
785:
786: -- Standard call to get message count and if count is 1, get message info.
787: FND_MSG_PUB.Count_And_Get
788: (p_count => x_msg_count,
789: p_data => x_msg_data
790: );
791: EXCEPTION
797: WHEN FND_API.G_EXC_ERROR THEN
798: ROLLBACK TO DELETE_Rule_Group_PVT;
799: x_return_status := FND_API.G_RET_STS_ERROR;
800: -- Standard call to get message count and if count=1, get the message
801: FND_MSG_PUB.Count_And_Get (
802: p_encoded => FND_API.G_FALSE,
803: p_count => x_msg_count,
804: p_data => x_msg_data
805: );
807: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
808: ROLLBACK TO DELETE_Rule_Group_PVT;
809: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
810: -- Standard call to get message count and if count=1, get the message
811: FND_MSG_PUB.Count_And_Get (
812: p_encoded => FND_API.G_FALSE,
813: p_count => x_msg_count,
814: p_data => x_msg_data
815: );
816:
817: WHEN OTHERS THEN
818: ROLLBACK TO DELETE_Rule_Group_PVT;
819: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
820: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
821: THEN
822: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
823: END IF;
824: -- Standard call to get message count and if count=1, get the message
818: ROLLBACK TO DELETE_Rule_Group_PVT;
819: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
820: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
821: THEN
822: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
823: END IF;
824: -- Standard call to get message count and if count=1, get the message
825: FND_MSG_PUB.Count_And_Get (
826: p_encoded => FND_API.G_FALSE,
821: THEN
822: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
823: END IF;
824: -- Standard call to get message count and if count=1, get the message
825: FND_MSG_PUB.Count_And_Get (
826: p_encoded => FND_API.G_FALSE,
827: p_count => x_msg_count,
828: p_data => x_msg_data
829: );
867:
868: -- Initialize message list if p_init_msg_list is set to TRUE.
869: IF FND_API.to_Boolean( p_init_msg_list )
870: THEN
871: FND_MSG_PUB.initialize;
872: END IF;
873:
874: -- Standard call to check for call compatibility.
875: IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
899: FETCH c_Rule_Group INTO l_RULEGROUP_ID;
900:
901: IF (c_Rule_Group%NOTFOUND) THEN
902: CLOSE c_Rule_Group;
903: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
904: FND_MESSAGE.set_name('AMS', 'AMS_API_RECORD_NOT_FOUND');
905: FND_MSG_PUB.add;
906: END IF;
907: RAISE FND_API.g_exc_error;
901: IF (c_Rule_Group%NOTFOUND) THEN
902: CLOSE c_Rule_Group;
903: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
904: FND_MESSAGE.set_name('AMS', 'AMS_API_RECORD_NOT_FOUND');
905: FND_MSG_PUB.add;
906: END IF;
907: RAISE FND_API.g_exc_error;
908: END IF;
909:
909:
910: CLOSE c_Rule_Group;
911:
912: -------------------- finish --------------------------
913: FND_MSG_PUB.count_and_get(
914: p_encoded => FND_API.g_false,
915: p_count => x_msg_count,
916: p_data => x_msg_data);
917: IF (AMS_DEBUG_HIGH_ON) THEN
927: WHEN FND_API.G_EXC_ERROR THEN
928: ROLLBACK TO LOCK_Rule_Group_PVT;
929: x_return_status := FND_API.G_RET_STS_ERROR;
930: -- Standard call to get message count and if count=1, get the message
931: FND_MSG_PUB.Count_And_Get (
932: p_encoded => FND_API.G_FALSE,
933: p_count => x_msg_count,
934: p_data => x_msg_data
935: );
937: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
938: ROLLBACK TO LOCK_Rule_Group_PVT;
939: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
940: -- Standard call to get message count and if count=1, get the message
941: FND_MSG_PUB.Count_And_Get (
942: p_encoded => FND_API.G_FALSE,
943: p_count => x_msg_count,
944: p_data => x_msg_data
945: );
946:
947: WHEN OTHERS THEN
948: ROLLBACK TO LOCK_Rule_Group_PVT;
949: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
950: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
951: THEN
952: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
953: END IF;
954: -- Standard call to get message count and if count=1, get the message
948: ROLLBACK TO LOCK_Rule_Group_PVT;
949: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
950: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
951: THEN
952: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
953: END IF;
954: -- Standard call to get message count and if count=1, get the message
955: FND_MSG_PUB.Count_And_Get (
956: p_encoded => FND_API.G_FALSE,
951: THEN
952: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
953: END IF;
954: -- Standard call to get message count and if count=1, get the message
955: FND_MSG_PUB.Count_And_Get (
956: p_encoded => FND_API.G_FALSE,
957: p_count => x_msg_count,
958: p_data => x_msg_data
959: );
1116:
1117: -- Initialize message list if p_init_msg_list is set to TRUE.
1118: IF FND_API.to_Boolean( p_init_msg_list )
1119: THEN
1120: FND_MSG_PUB.initialize;
1121: END IF;
1122: IF p_validation_level >= JTF_PLSQL_API.g_valid_level_item THEN
1123: Check_rule_group_Items(
1124: p_rule_group_rec => p_rule_group_rec,
1151: AMS_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'end');
1152: END IF;
1153:
1154: -- Standard call to get message count and if count is 1, get message info.
1155: FND_MSG_PUB.Count_And_Get
1156: (p_count => x_msg_count,
1157: p_data => x_msg_data
1158: );
1159: EXCEPTION
1165: WHEN FND_API.G_EXC_ERROR THEN
1166: ROLLBACK TO VALIDATE_Rule_Group_;
1167: x_return_status := FND_API.G_RET_STS_ERROR;
1168: -- Standard call to get message count and if count=1, get the message
1169: FND_MSG_PUB.Count_And_Get (
1170: p_encoded => FND_API.G_FALSE,
1171: p_count => x_msg_count,
1172: p_data => x_msg_data
1173: );
1175: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1176: ROLLBACK TO VALIDATE_Rule_Group_;
1177: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1178: -- Standard call to get message count and if count=1, get the message
1179: FND_MSG_PUB.Count_And_Get (
1180: p_encoded => FND_API.G_FALSE,
1181: p_count => x_msg_count,
1182: p_data => x_msg_data
1183: );
1184:
1185: WHEN OTHERS THEN
1186: ROLLBACK TO VALIDATE_Rule_Group_;
1187: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1188: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1189: THEN
1190: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1191: END IF;
1192: -- Standard call to get message count and if count=1, get the message
1186: ROLLBACK TO VALIDATE_Rule_Group_;
1187: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1188: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1189: THEN
1190: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1191: END IF;
1192: -- Standard call to get message count and if count=1, get the message
1193: FND_MSG_PUB.Count_And_Get (
1194: p_encoded => FND_API.G_FALSE,
1189: THEN
1190: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1191: END IF;
1192: -- Standard call to get message count and if count=1, get the message
1193: FND_MSG_PUB.Count_And_Get (
1194: p_encoded => FND_API.G_FALSE,
1195: p_count => x_msg_count,
1196: p_data => x_msg_data
1197: );
1210: BEGIN
1211: -- Initialize message list if p_init_msg_list is set to TRUE.
1212: IF FND_API.to_Boolean( p_init_msg_list )
1213: THEN
1214: FND_MSG_PUB.initialize;
1215: END IF;
1216:
1217: -- Initialize API return status to SUCCESS
1218: x_return_status := FND_API.G_RET_STS_SUCCESS;
1227:
1228: AMS_UTILITY_PVT.debug_message('Private API: Validate_dm_model_rec');
1229: END IF;
1230: -- Standard call to get message count and if count is 1, get message info.
1231: FND_MSG_PUB.Count_And_Get
1232: (p_count => x_msg_count,
1233: p_data => x_msg_data
1234: );
1235: END Validate_rule_group_Rec;