[Home] [Help]
45: l_count pls_integer := 0;
46: l_overall_status VARCHAR2(20);
47: i pls_integer;
48: BEGIN
49: l_status := EDR_CONSTANTS_GRP.g_indetermined_status;
50: --read the status of each of the events and maintain a count
51: l_total_events := p_events.COUNT;
52:
53: if (l_total_events > 0) then
56: --keep on adding to the count till there is no
57: --break on the status value
58: while i is not null loop
59: if (p_events(i).event_status = l_status
60: OR l_status = EDR_CONSTANTS_GRP.g_indetermined_status)
61: then
62: l_status := p_events(i).event_status;
63: l_count := l_count + 1;
64: else
73: if (l_count = l_total_events) then
74: l_overall_status := l_status;
75: else
76: l_overall_status
77: := EDR_CONSTANTS_GRP.g_indetermined_status;
78: end if;
79:
80: end if;
81:
78: end if;
79:
80: end if;
81:
82: if l_overall_status = EDR_CONSTANTS_GRP.g_no_action_status
83: then
84: l_overall_status := EDR_CONSTANTS_GRP.g_complete_status;
85: end if;
86:
80: end if;
81:
82: if l_overall_status = EDR_CONSTANTS_GRP.g_no_action_status
83: then
84: l_overall_status := EDR_CONSTANTS_GRP.g_complete_status;
85: end if;
86:
87: return l_overall_status;
88:
122: --l_relationship can have three possible values
123: --EVALUATE_NORMAL, IGNORE_SIGNATURE, ERECORD_ONLY
124:
125: if (l_relationship is null OR
126: (l_relationship <> EDR_CONSTANTS_GRP.g_evaluate_normal AND
127: l_relationship <> EDR_CONSTANTS_GRP.g_erecord_only AND
128: l_relationship <> EDR_CONSTANTS_GRP.g_ignore_signature)
129: )
130: then
123: --EVALUATE_NORMAL, IGNORE_SIGNATURE, ERECORD_ONLY
124:
125: if (l_relationship is null OR
126: (l_relationship <> EDR_CONSTANTS_GRP.g_evaluate_normal AND
127: l_relationship <> EDR_CONSTANTS_GRP.g_erecord_only AND
128: l_relationship <> EDR_CONSTANTS_GRP.g_ignore_signature)
129: )
130: then
131: l_return_value := FALSE;
124:
125: if (l_relationship is null OR
126: (l_relationship <> EDR_CONSTANTS_GRP.g_evaluate_normal AND
127: l_relationship <> EDR_CONSTANTS_GRP.g_erecord_only AND
128: l_relationship <> EDR_CONSTANTS_GRP.g_ignore_signature)
129: )
130: then
131: l_return_value := FALSE;
132: end if;
333: while i is not null loop
334: l_param_name := p_payload(i).Param_Name;
335: l_param_value := p_payload(i).Param_Value;
336:
337: if (l_param_name = EDR_CONSTANTS_GRP.g_source_param) then
338: l_source := l_param_value;
339:
340: if (l_source = EDR_CONSTANTS_GRP.g_db_mode
341: OR l_source = EDR_CONSTANTS_GRP.g_forms_mode
336:
337: if (l_param_name = EDR_CONSTANTS_GRP.g_source_param) then
338: l_source := l_param_value;
339:
340: if (l_source = EDR_CONSTANTS_GRP.g_db_mode
341: OR l_source = EDR_CONSTANTS_GRP.g_forms_mode
342: OR l_source = EDR_CONSTANTS_GRP.g_oaf_mode)
343: then
344: l_count := l_count + 1;
337: if (l_param_name = EDR_CONSTANTS_GRP.g_source_param) then
338: l_source := l_param_value;
339:
340: if (l_source = EDR_CONSTANTS_GRP.g_db_mode
341: OR l_source = EDR_CONSTANTS_GRP.g_forms_mode
342: OR l_source = EDR_CONSTANTS_GRP.g_oaf_mode)
343: then
344: l_count := l_count + 1;
345: else
338: l_source := l_param_value;
339:
340: if (l_source = EDR_CONSTANTS_GRP.g_db_mode
341: OR l_source = EDR_CONSTANTS_GRP.g_forms_mode
342: OR l_source = EDR_CONSTANTS_GRP.g_oaf_mode)
343: then
344: l_count := l_count + 1;
345: else
346: RAISE INVALID_SOURCE_ERROR;
346: RAISE INVALID_SOURCE_ERROR;
347: end if;
348: end if;
349:
350: if (l_param_name = EDR_CONSTANTS_GRP.g_deferred_param) then
351: l_deferred := l_param_value;
352:
353: if (l_deferred = 'Y' OR l_deferred = 'N') then
354: l_count := l_count + 1;
356: RAISE DEFERRED_PARAM_ERROR;
357: end if;
358: end if;
359:
360: if (l_param_name = EDR_CONSTANTS_GRP.g_postop_param) then
361: l_count := l_count + 1;
362: end if;
363:
364: if (l_param_name = EDR_CONSTANTS_GRP.g_user_label_param) then
360: if (l_param_name = EDR_CONSTANTS_GRP.g_postop_param) then
361: l_count := l_count + 1;
362: end if;
363:
364: if (l_param_name = EDR_CONSTANTS_GRP.g_user_label_param) then
365: l_count := l_count + 1;
366: end if;
367:
368: if (l_param_name = EDR_CONSTANTS_GRP.g_user_value_param) then
364: if (l_param_name = EDR_CONSTANTS_GRP.g_user_label_param) then
365: l_count := l_count + 1;
366: end if;
367:
368: if (l_param_name = EDR_CONSTANTS_GRP.g_user_value_param) then
369: l_count := l_count + 1;
370: end if;
371:
372: if (l_param_name = EDR_CONSTANTS_GRP.g_audit_param) then
368: if (l_param_name = EDR_CONSTANTS_GRP.g_user_value_param) then
369: l_count := l_count + 1;
370: end if;
371:
372: if (l_param_name = EDR_CONSTANTS_GRP.g_audit_param) then
373: l_count := l_count + 1;
374: end if;
375:
376: if (l_param_name = EDR_CONSTANTS_GRP.g_requester_param) then
372: if (l_param_name = EDR_CONSTANTS_GRP.g_audit_param) then
373: l_count := l_count + 1;
374: end if;
375:
376: if (l_param_name = EDR_CONSTANTS_GRP.g_requester_param) then
377: l_count := l_count + 1;
378: end if;
379:
380: -- additional parameters for inter event processing --
377: l_count := l_count + 1;
378: end if;
379:
380: -- additional parameters for inter event processing --
381: if (l_param_name = EDR_CONSTANTS_GRP.g_parent_event_name)
382: then
383: l_parent_event_name := l_param_value;
384: IF NOT valid_event_name(l_parent_event_name) then
385: l_error_param_name := l_param_name;
401:
402: l_inter_event_count := l_inter_event_count + 1;
403: end if;
404:
405: if (l_param_name = EDR_CONSTANTS_GRP.g_parent_event_key) then
406: l_parent_event_key := l_param_value;
407:
408: IF l_parent_event_key is null then
409: l_error_param_name := l_param_name;
413:
414: l_inter_event_count := l_inter_event_count + 1;
415: end if;
416:
417: if (l_param_name = EDR_CONSTANTS_GRP.g_parent_erecord_id) then
418: --SKARIMIS
419: /*As we are comparing to -1 we need to treate NULL also as -1 */
420: l_parent_erecord_id := NVL(l_param_value,-1);
421:
419: /*As we are comparing to -1 we need to treate NULL also as -1 */
420: l_parent_erecord_id := NVL(l_param_value,-1);
421:
422: if (l_parent_erecord_id <>
423: EDR_CONSTANTS_GRP.g_default_num_param_value)
424: then
425:
426: VALIDATE_ERECORD
427: ( p_api_version => 1.0,
448: end LOOP;
449:
450:
451:
452: if (l_count <> EDR_CONSTANTS_GRP.g_param_count)
453: then
454: RAISE INVALID_PAYLOAD_ERROR;
455: elsif (p_mode = EDR_CONSTANTS_GRP.g_db_mode AND l_source <> EDR_CONSTANTS_GRP.g_db_mode)
456: then
451:
452: if (l_count <> EDR_CONSTANTS_GRP.g_param_count)
453: then
454: RAISE INVALID_PAYLOAD_ERROR;
455: elsif (p_mode = EDR_CONSTANTS_GRP.g_db_mode AND l_source <> EDR_CONSTANTS_GRP.g_db_mode)
456: then
457: RAISE DEFERRED_DB_ERROR;
458: elsif (l_source = EDR_CONSTANTS_GRP.g_db_mode AND l_deferred <> 'Y')
459: then
454: RAISE INVALID_PAYLOAD_ERROR;
455: elsif (p_mode = EDR_CONSTANTS_GRP.g_db_mode AND l_source <> EDR_CONSTANTS_GRP.g_db_mode)
456: then
457: RAISE DEFERRED_DB_ERROR;
458: elsif (l_source = EDR_CONSTANTS_GRP.g_db_mode AND l_deferred <> 'Y')
459: then
460: RAISE DEFERRED_DB_ERROR;
461: end if;
462:
472: if (p_event_name = l_parent_event_name) and (p_event_key = l_parent_event_key) then
473: RAISE INTEREVENT_PARAM_ERROR;
474: end if;
475: /* End of Bug Fix */
476: if (l_inter_event_count <> EDR_CONSTANTS_GRP.g_inter_event_param_count) then
477: RAISE INTEREVENT_PARAM_ERROR;
478:
479: /* We will not perform this validating as we agreed on not bothering about parent erecord is being -1
480: elsif (p_mode = EDR_CONSTANTS_GRP.g_strict_mode
476: if (l_inter_event_count <> EDR_CONSTANTS_GRP.g_inter_event_param_count) then
477: RAISE INTEREVENT_PARAM_ERROR;
478:
479: /* We will not perform this validating as we agreed on not bothering about parent erecord is being -1
480: elsif (p_mode = EDR_CONSTANTS_GRP.g_strict_mode
481: AND l_parent_erecord_id = EDR_CONSTANTS_GRP.g_default_num_param_value)
482: then
483: RAISE INTEREVENT_DB_PARAM_ERROR;
484: */
477: RAISE INTEREVENT_PARAM_ERROR;
478:
479: /* We will not perform this validating as we agreed on not bothering about parent erecord is being -1
480: elsif (p_mode = EDR_CONSTANTS_GRP.g_strict_mode
481: AND l_parent_erecord_id = EDR_CONSTANTS_GRP.g_default_num_param_value)
482: then
483: RAISE INTEREVENT_DB_PARAM_ERROR;
484: */
485: elsif (l_inter_event_count = EDR_CONSTANTS_GRP.g_inter_event_param_count
481: AND l_parent_erecord_id = EDR_CONSTANTS_GRP.g_default_num_param_value)
482: then
483: RAISE INTEREVENT_DB_PARAM_ERROR;
484: */
485: elsif (l_inter_event_count = EDR_CONSTANTS_GRP.g_inter_event_param_count
486: AND l_parent_event_key = EDR_CONSTANTS_GRP.g_default_char_param_value)
487: then
488: l_error_param_name := EDR_CONSTANTS_GRP.g_parent_event_key;
489: l_error_param_value := l_parent_event_key;
482: then
483: RAISE INTEREVENT_DB_PARAM_ERROR;
484: */
485: elsif (l_inter_event_count = EDR_CONSTANTS_GRP.g_inter_event_param_count
486: AND l_parent_event_key = EDR_CONSTANTS_GRP.g_default_char_param_value)
487: then
488: l_error_param_name := EDR_CONSTANTS_GRP.g_parent_event_key;
489: l_error_param_value := l_parent_event_key;
490: RAISE INVALID_PARAM_ERROR;
484: */
485: elsif (l_inter_event_count = EDR_CONSTANTS_GRP.g_inter_event_param_count
486: AND l_parent_event_key = EDR_CONSTANTS_GRP.g_default_char_param_value)
487: then
488: l_error_param_name := EDR_CONSTANTS_GRP.g_parent_event_key;
489: l_error_param_value := l_parent_event_key;
490: RAISE INVALID_PARAM_ERROR;
491:
492: else
490: RAISE INVALID_PARAM_ERROR;
491:
492: else
493: /* SKARIMIS . Addef id condition to get event details only for a valid erecord */
494: if l_parent_erecord_id <> EDR_CONSTANTS_GRP.g_default_num_param_value then
495: EDR_ERES_EVENT_PUB.GET_EVENT_DETAILS
496: ( p_api_version => 1.0 ,
497: x_return_status => l_return_status ,
498: x_msg_count => l_msg_count ,
1023: i := l_parameter_list.NEXT(i);
1024: end loop;
1025:
1026: --Set the comma separated child e-record ID string on the payload.
1027: l_parameter_list(j+1).param_name := EDR_CONSTANTS_GRP.G_CHILD_ERECORD_IDS;
1028: l_parameter_list(j+1).param_value := l_child_erecord_ids;
1029:
1030: --Call raise event with the parameter list as the argument.
1031: EDR_ERES_EVENT_PVT.RAISE_EVENT
1035: x_return_status => l_return_status,
1036: x_msg_count => l_msg_count,
1037: x_msg_data => l_msg_data,
1038: x_event => x_event,
1039: p_mode => EDR_CONSTANTS_GRP.g_strict_mode,
1040: x_is_child_event => l_child,
1041: p_parameter_list => l_parameter_list
1042: );
1043: else
1050: x_return_status => l_return_status,
1051: x_msg_count => l_msg_count,
1052: x_msg_data => l_msg_data,
1053: x_event => x_event,
1054: p_mode => EDR_CONSTANTS_GRP.g_strict_mode,
1055: x_is_child_event => l_child
1056: );
1057: end if;
1058: --Bug 4122622: End
1088: while i is not null loop
1089: l_param_name := l_parameter_list(i).Param_Name;
1090: l_param_value := l_parameter_list(i).Param_Value;
1091:
1092: if (l_param_name = EDR_CONSTANTS_GRP.g_parent_event_name)
1093: then
1094: l_parent_event_name := l_param_value;
1095: end if;
1096:
1093: then
1094: l_parent_event_name := l_param_value;
1095: end if;
1096:
1097: if (l_param_name = EDR_CONSTANTS_GRP.g_parent_event_key)
1098: then
1099: l_parent_event_key := l_param_value;
1100: end if;
1101:
1098: then
1099: l_parent_event_key := l_param_value;
1100: end if;
1101:
1102: if (l_param_name = EDR_CONSTANTS_GRP.g_parent_erecord_id)
1103: then
1104: l_parent_erecord_id := l_param_value;
1105: end if;
1106:
1326:
1327: --Iterate through the parameter list of the current event.
1328: --Obtain the parent event details if they are set.
1329: WHILE i is not null loop
1330: if x_parameter_list(i).param_name = EDR_CONSTANTS_GRP.g_parent_event_name then
1331: l_parent_event_name := x_parameter_list(i).param_value;
1332: l_parent_name_set := true;
1333: elsif x_parameter_list(i).param_name = EDR_CONSTANTS_GRP.g_parent_event_key then
1334: l_parent_event_key := x_parameter_list(i).param_value;
1329: WHILE i is not null loop
1330: if x_parameter_list(i).param_name = EDR_CONSTANTS_GRP.g_parent_event_name then
1331: l_parent_event_name := x_parameter_list(i).param_value;
1332: l_parent_name_set := true;
1333: elsif x_parameter_list(i).param_name = EDR_CONSTANTS_GRP.g_parent_event_key then
1334: l_parent_event_key := x_parameter_list(i).param_value;
1335: l_parent_key_set := true;
1336: elsif x_parameter_list(i).param_name = EDR_CONSTANTS_GRP.g_parent_erecord_id then
1337: l_parent_erecord_id := x_parameter_list(i).param_value;
1332: l_parent_name_set := true;
1333: elsif x_parameter_list(i).param_name = EDR_CONSTANTS_GRP.g_parent_event_key then
1334: l_parent_event_key := x_parameter_list(i).param_value;
1335: l_parent_key_set := true;
1336: elsif x_parameter_list(i).param_name = EDR_CONSTANTS_GRP.g_parent_erecord_id then
1337: l_parent_erecord_id := x_parameter_list(i).param_value;
1338: l_parent_erecord_set := true;
1339: k := i;
1340: end if;
1351: if l_parent_name_set and l_parent_key_set and l_parent_erecord_set then
1352: --If the parent event details are set and the parent e-record ID is set to -1,
1353: --then fetch the corresponding e-record ID of the parent.
1354:
1355: if l_parent_erecord_id is not null and l_parent_erecord_id = EDR_CONSTANTS_GRP.G_DEFAULT_CHAR_ID_VALUE then
1356: GET_ERECORD_ID
1357: ( p_api_version => 1.0,
1358: p_init_msg_list => FND_API.G_FALSE,
1359: x_return_status => l_return_status,
1372: RAISE FND_API.G_EXC_ERROR;
1373: END IF;
1374:
1375:
1376: if l_parent_erecord is not null and l_parent_erecord <> EDR_CONSTANTS_GRP.G_DEFAULT_NUM_PARAM_VALUE
1377: then
1378: l_parent_erecord_id := to_char(l_parent_erecord);
1379: x_parameter_list(k).param_value := l_parent_erecord_id;
1380: end if;
1399:
1400: --Iterate through the parameter list. Obtain the parent event details if
1401: --they exist.
1402: WHILE i is not null loop
1403: if l_parameter_list(i).param_name = EDR_CONSTANTS_GRP.g_parent_event_name then
1404: l_parent_event_name := l_parameter_list(i).param_value;
1405: l_parent_name_set := true;
1406: elsif l_parameter_list(i).param_name = EDR_CONSTANTS_GRP.g_parent_event_key then
1407: l_parent_event_key := l_parameter_list(i).param_value;
1402: WHILE i is not null loop
1403: if l_parameter_list(i).param_name = EDR_CONSTANTS_GRP.g_parent_event_name then
1404: l_parent_event_name := l_parameter_list(i).param_value;
1405: l_parent_name_set := true;
1406: elsif l_parameter_list(i).param_name = EDR_CONSTANTS_GRP.g_parent_event_key then
1407: l_parent_event_key := l_parameter_list(i).param_value;
1408: l_parent_key_set := true;
1409: elsif l_parameter_list(i).param_name = EDR_CONSTANTS_GRP.g_parent_erecord_id then
1410: l_parent_erecord_id := l_parameter_list(i).param_value;
1405: l_parent_name_set := true;
1406: elsif l_parameter_list(i).param_name = EDR_CONSTANTS_GRP.g_parent_event_key then
1407: l_parent_event_key := l_parameter_list(i).param_value;
1408: l_parent_key_set := true;
1409: elsif l_parameter_list(i).param_name = EDR_CONSTANTS_GRP.g_parent_erecord_id then
1410: l_parent_erecord_id := l_parameter_list(i).param_value;
1411: l_parent_erecord_set := true;
1412: end if;
1413:
1423: l_parent_key_set := false;
1424: l_parent_erecord_set := false;
1425:
1426: if l_parent_event_name = p_events(p_index).event_name and l_parent_event_key = p_events(p_index).event_key
1427: and l_parent_erecord_id = EDR_CONSTANTS_GRP.G_DEFAULT_CHAR_ID_VALUE then
1428:
1429: if l_child_erecord_ids is null then
1430: l_child_erecord_ids := to_char(p_events(j).erecord_id);
1431: else
1450: j := i;
1451: i := x_parameter_list.NEXT(i);
1452: end loop;
1453: if j is not null then
1454: x_parameter_list(j+1).param_name := EDR_CONSTANTS_GRP.G_CHILD_ERECORD_IDS;
1455: x_parameter_list(j+1).param_value := l_child_erecord_ids;
1456: end if;
1457: end if;
1458: end SET_INTER_EVENT_DETAILS;
1539: x_msg_data => l_msg_data ,
1540: p_event_name => x_events(i).event_name,
1541: p_event_key => x_events(i).event_key,
1542: p_payload => l_parameter_list ,
1543: p_mode => EDR_CONSTANTS_GRP.g_db_mode
1544: );
1545:
1546: /*
1547: VALIDATE_PAYLOAD
1552: x_msg_data => l_msg_data ,
1553: p_event_name => x_events(i).event_name,
1554: p_event_key => x_events(i).event_key,
1555: p_payload => x_events(i).payload ,
1556: p_mode => EDR_CONSTANTS_GRP.g_db_mode
1557: );
1558: */
1559: --Bug 3136403: End
1560:
1638:
1639: --l_param_name := x_events(i).payload(j).Param_Name;
1640: --l_param_value := x_events(i).payload(j).Param_Value;
1641:
1642: if (l_param_name = EDR_CONSTANTS_GRP.g_parent_event_name)
1643: then
1644: l_inter_event_tbl(rel_number).parent_event_name
1645: := l_param_value;
1646: end if;
1644: l_inter_event_tbl(rel_number).parent_event_name
1645: := l_param_value;
1646: end if;
1647:
1648: if (l_param_name = EDR_CONSTANTS_GRP.g_parent_event_key)
1649: then
1650: l_inter_event_tbl(rel_number).parent_event_key
1651: := l_param_value;
1652: end if;
1650: l_inter_event_tbl(rel_number).parent_event_key
1651: := l_param_value;
1652: end if;
1653:
1654: if (l_param_name = EDR_CONSTANTS_GRP.g_parent_erecord_id)
1655: then
1656: l_inter_event_tbl(rel_number).parent_erecord_id
1657: := l_param_value;
1658: end if;
1690: if (l_inter_event_tbl.COUNT > 0) then
1691: for i IN l_inter_event_tbl.FIRST..l_inter_event_tbl.LAST
1692: loop
1693: if (l_inter_event_tbl(i).parent_erecord_id =
1694: EDR_CONSTANTS_GRP.g_default_num_param_value)
1695: then
1696:
1697: GET_ERECORD_ID
1698: ( p_api_version => 1.0,
1762: );
1763:
1764: EXCEPTION
1765: WHEN FND_API.G_EXC_ERROR THEN
1766: x_overall_status := EDR_CONSTANTS_GRP.g_error_status;
1767: x_return_status := FND_API.G_RET_STS_ERROR ;
1768:
1769: FND_MSG_PUB.Count_And_Get
1770: ( p_count => x_msg_count ,