264: segment_less_than_2_stops EXCEPTION;
265:
266: BEGIN
267:
268: wsh_debug_sv.dpush (c_sdebug, 'Validate_Trip');
269:
270: wsh_debug_sv.dlog (c_debug,'FteTripId ',p_trip_info.fte_trip_id);
271: wsh_debug_sv.dlog (c_debug,'WshTripId ',p_trip_info.wsh_trip_id);
272: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',p_trip_info.sequence_number);
266: BEGIN
267:
268: wsh_debug_sv.dpush (c_sdebug, 'Validate_Trip');
269:
270: wsh_debug_sv.dlog (c_debug,'FteTripId ',p_trip_info.fte_trip_id);
271: wsh_debug_sv.dlog (c_debug,'WshTripId ',p_trip_info.wsh_trip_id);
272: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',p_trip_info.sequence_number);
273: wsh_debug_sv.dlog (c_debug,'ActionCode ',p_action_code);
274:
267:
268: wsh_debug_sv.dpush (c_sdebug, 'Validate_Trip');
269:
270: wsh_debug_sv.dlog (c_debug,'FteTripId ',p_trip_info.fte_trip_id);
271: wsh_debug_sv.dlog (c_debug,'WshTripId ',p_trip_info.wsh_trip_id);
272: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',p_trip_info.sequence_number);
273: wsh_debug_sv.dlog (c_debug,'ActionCode ',p_action_code);
274:
275: x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
268: wsh_debug_sv.dpush (c_sdebug, 'Validate_Trip');
269:
270: wsh_debug_sv.dlog (c_debug,'FteTripId ',p_trip_info.fte_trip_id);
271: wsh_debug_sv.dlog (c_debug,'WshTripId ',p_trip_info.wsh_trip_id);
272: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',p_trip_info.sequence_number);
273: wsh_debug_sv.dlog (c_debug,'ActionCode ',p_action_code);
274:
275: x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
276:
269:
270: wsh_debug_sv.dlog (c_debug,'FteTripId ',p_trip_info.fte_trip_id);
271: wsh_debug_sv.dlog (c_debug,'WshTripId ',p_trip_info.wsh_trip_id);
272: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',p_trip_info.sequence_number);
273: wsh_debug_sv.dlog (c_debug,'ActionCode ',p_action_code);
274:
275: x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
276:
277: wsh_debug_sv.dlog (c_debug,'about to get segment name...');
273: wsh_debug_sv.dlog (c_debug,'ActionCode ',p_action_code);
274:
275: x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
276:
277: wsh_debug_sv.dlog (c_debug,'about to get segment name...');
278:
279: fte_mls_util.get_trip_segment_name
280: (
281: p_trip_segment_id => p_trip_info.WSH_TRIP_ID,
282: x_trip_segment_name => l_wsh_trip_name,
283: x_return_status => x_return_status
284: );
285:
286: wsh_debug_sv.dlog (c_debug,'segment name',l_wsh_trip_name);
287: wsh_debug_sv.dlog (c_debug,'x_return_status',x_return_status);
288:
289: IF (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN
290: RETURN;
283: x_return_status => x_return_status
284: );
285:
286: wsh_debug_sv.dlog (c_debug,'segment name',l_wsh_trip_name);
287: wsh_debug_sv.dlog (c_debug,'x_return_status',x_return_status);
288:
289: IF (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN
290: RETURN;
291: END IF;
289: IF (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN
290: RETURN;
291: END IF;
292:
293: wsh_debug_sv.dlog (c_debug,'about to get trip name...');
294:
295: fte_trips_pvt.get_trip_name
296: (
297: p_trip_id => p_trip_info.FTE_TRIP_ID,
298: x_trip_name => l_fte_trip_name,
299: x_return_status => x_return_status
300: );
301:
302: wsh_debug_sv.dlog (c_debug,'trip name',l_fte_trip_name);
303: wsh_debug_sv.dlog (c_debug,'x_return_status',x_return_status);
304:
305: IF (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN
306: RETURN;
299: x_return_status => x_return_status
300: );
301:
302: wsh_debug_sv.dlog (c_debug,'trip name',l_fte_trip_name);
303: wsh_debug_sv.dlog (c_debug,'x_return_status',x_return_status);
304:
305: IF (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN
306: RETURN;
307: END IF;
305: IF (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN
306: RETURN;
307: END IF;
308:
309: wsh_debug_sv.dlog (c_debug,'about to validate PK...');
310:
311: Validate_PK
312: (
313: p_trip_info.FTE_TRIP_ID,
314: p_trip_info.WSH_TRIP_ID,
315: x_return_status
316: );
317:
318: wsh_debug_sv.dlog (c_debug,'x_return_status',x_return_status);
319:
320: IF (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN
321: RETURN;
322: END IF;
320: IF (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN
321: RETURN;
322: END IF;
323:
324: wsh_debug_sv.dlog (c_debug,'about to validate sequence...');
325:
326: Validate_Sequence
327: (
328: p_trip_info.FTE_TRIP_ID,
329: p_trip_info.SEQUENCE_NUMBER,
330: x_return_status
331: );
332:
333: wsh_debug_sv.dlog (c_debug,'x_return_status',x_return_status);
334:
335: IF (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN
336: RETURN;
337: END IF;
335: IF (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN
336: RETURN;
337: END IF;
338:
339: wsh_debug_sv.dlog (c_debug,'about to validate status...');
340:
341: -- Segment can only be added to open trip, (insert)
342: -- Segment's sequence can only be added to open trip (upadte)
343: l_status := Get_Fte_Trip_Status(p_trip_info.FTE_TRIP_ID);
386: end if;
387:
388: end if; -- p_action_code = 'CREATE' or 'UPDATE'
389:
390: wsh_debug_sv.dlog (c_debug,'x_return_status',x_return_status);
391:
392: wsh_debug_sv.dlog (c_debug,'about to validate 2 stops...');
393:
394: --check at least two stops for the segment
388: end if; -- p_action_code = 'CREATE' or 'UPDATE'
389:
390: wsh_debug_sv.dlog (c_debug,'x_return_status',x_return_status);
391:
392: wsh_debug_sv.dlog (c_debug,'about to validate 2 stops...');
393:
394: --check at least two stops for the segment
395: select count(*) into l_stop_count
396: from wsh_trip_stops
395: select count(*) into l_stop_count
396: from wsh_trip_stops
397: where trip_id = p_trip_info.WSH_TRIP_ID;
398:
399: wsh_debug_sv.dlog (c_debug,'wsh_trip_id',p_trip_info.WSH_TRIP_ID);
400: wsh_debug_sv.dlog (c_debug,'stop count',l_stop_count);
401:
402: if (l_stop_count < 2) then
403: update fte_trips
396: from wsh_trip_stops
397: where trip_id = p_trip_info.WSH_TRIP_ID;
398:
399: wsh_debug_sv.dlog (c_debug,'wsh_trip_id',p_trip_info.WSH_TRIP_ID);
400: wsh_debug_sv.dlog (c_debug,'stop count',l_stop_count);
401:
402: if (l_stop_count < 2) then
403: update fte_trips
404: set validation_required = 'Y'
404: set validation_required = 'Y'
405: where fte_trip_id = p_trip_info.FTE_TRIP_ID;
406:
407: -- give warning
408: wsh_debug_sv.dlog (c_debug,'about to set the warning message...');
409:
410: FND_MESSAGE.SET_NAME('FTE', 'FTE_SEGMENT_NO_TWO_STOPS');
411: FND_MESSAGE.SET_TOKEN('WSH_TRIP_NAME',l_wsh_trip_name);
412: x_return_status := WSH_UTIL_CORE.G_RET_STS_WARNING;
414:
415: return;
416: end if;
417:
418: wsh_debug_sv.dlog (c_debug,'about to validate connections...');
419:
420: --check connections
421:
422: l_connected := true;
422: l_connected := true;
423:
424: if (p_action_code = 'CREATE') then
425:
426: wsh_debug_sv.dlog (c_debug,'about to get_previous_segment_id...');
427:
428: fte_mls_util.get_previous_segment_id
429: (
430: p_trip_segment_id => p_trip_info.WSH_TRIP_ID,
435: x_previous_segment_id => l_previous_segment_id,
436: x_return_status => l_return_status
437: );
438:
439: wsh_debug_sv.dlog (c_debug,'previous segment id', l_previous_segment_id);
440: wsh_debug_sv.dlog (c_debug,'return status from get_previous_segment_id', l_return_status);
441:
442: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS
443: AND l_return_status <> WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
436: x_return_status => l_return_status
437: );
438:
439: wsh_debug_sv.dlog (c_debug,'previous segment id', l_previous_segment_id);
440: wsh_debug_sv.dlog (c_debug,'return status from get_previous_segment_id', l_return_status);
441:
442: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS
443: AND l_return_status <> WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
444: set_return_status
448: );
449: RETURN;
450: END IF;
451:
452: wsh_debug_sv.dlog (c_debug,'return status', x_return_status);
453:
454: if (l_previous_segment_id is NOT null) then
455:
456: select sequence_number into l_previous_sequence_number
457: from fte_wsh_trips
458: where fte_trip_id = p_trip_info.FTE_TRIP_ID
459: and wsh_trip_id = l_previous_segment_id;
460:
461: wsh_debug_sv.dlog (c_debug,'about to get_first_stop_location_id...');
462:
463: fte_mls_util.get_first_stop_location_id
464: (
465: p_trip_segment_id => p_trip_info.WSH_TRIP_ID,
467: x_first_stop_location_id => l_first_stop_location_id,
468: x_return_status => l_return_status
469: );
470:
471: wsh_debug_sv.dlog (c_debug,'first stop loc id',l_first_stop_location_id);
472: wsh_debug_sv.dlog (c_debug,'return status from get_first_stop_location_id',l_return_status);
473:
474: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS
475: AND l_return_status <> WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
468: x_return_status => l_return_status
469: );
470:
471: wsh_debug_sv.dlog (c_debug,'first stop loc id',l_first_stop_location_id);
472: wsh_debug_sv.dlog (c_debug,'return status from get_first_stop_location_id',l_return_status);
473:
474: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS
475: AND l_return_status <> WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
476: set_return_status
480: );
481: RETURN;
482: END IF;
483:
484: wsh_debug_sv.dlog (c_debug,'return status', x_return_status);
485:
486: wsh_debug_sv.dlog (c_debug,'about to check_previous_segment...');
487:
488: fte_mls_util.check_previous_segment
482: END IF;
483:
484: wsh_debug_sv.dlog (c_debug,'return status', x_return_status);
485:
486: wsh_debug_sv.dlog (c_debug,'about to check_previous_segment...');
487:
488: fte_mls_util.check_previous_segment
489: (
490: p_trip_id => p_trip_info.FTE_TRIP_ID,
496: x_connected => l_connected,
497: x_return_status => l_return_status
498: );
499:
500: wsh_debug_sv.dlog (c_debug,'l_connected',l_connected);
501: wsh_debug_sv.dlog (c_debug,'return_status from check_previous_segment',l_return_status);
502:
503: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS
504: AND l_return_status <> WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
497: x_return_status => l_return_status
498: );
499:
500: wsh_debug_sv.dlog (c_debug,'l_connected',l_connected);
501: wsh_debug_sv.dlog (c_debug,'return_status from check_previous_segment',l_return_status);
502:
503: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS
504: AND l_return_status <> WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
505: set_return_status
509: );
510: RETURN;
511: END IF;
512:
513: wsh_debug_sv.dlog (c_debug,'return status', x_return_status);
514:
515: if (l_connected is null or l_connected = false) then
516:
517: wsh_debug_sv.dlog (c_debug,'about to mark trip invalid...');
513: wsh_debug_sv.dlog (c_debug,'return status', x_return_status);
514:
515: if (l_connected is null or l_connected = false) then
516:
517: wsh_debug_sv.dlog (c_debug,'about to mark trip invalid...');
518:
519: update fte_trips
520: set validation_required = 'Y'
521: where fte_trip_id = p_trip_info.FTE_TRIP_ID;
519: update fte_trips
520: set validation_required = 'Y'
521: where fte_trip_id = p_trip_info.FTE_TRIP_ID;
522:
523: wsh_debug_sv.dlog (c_debug,'about to set warning message...');
524:
525: -- give warning
526: FND_MESSAGE.SET_NAME('FTE', 'FTE_SEGMENT_PREV_CONNECT_ERROR');
527: FND_MESSAGE.SET_TOKEN('TRIP_NAME',l_fte_trip_name);
531: end if;
532:
533: end if; -- l_previous_segment_id is NOT null
534:
535: wsh_debug_sv.dlog (c_debug,'about to get_next_segment_id...');
536:
537: fte_mls_util.get_next_segment_id
538: (
539: p_trip_segment_id => p_trip_info.WSH_TRIP_ID,
544: x_next_segment_id => l_next_segment_id,
545: x_return_status => l_return_status
546: );
547:
548: wsh_debug_sv.dlog (c_debug,'next segment id', l_next_segment_id);
549: wsh_debug_sv.dlog (c_debug,'return status from get_next_segment_id', l_return_status);
550:
551: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS
552: AND l_return_status <> WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
545: x_return_status => l_return_status
546: );
547:
548: wsh_debug_sv.dlog (c_debug,'next segment id', l_next_segment_id);
549: wsh_debug_sv.dlog (c_debug,'return status from get_next_segment_id', l_return_status);
550:
551: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS
552: AND l_return_status <> WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
553: set_return_status
557: );
558: RETURN;
559: END IF;
560:
561: wsh_debug_sv.dlog (c_debug,'return status', x_return_status);
562:
563: if (l_next_segment_id is NOT null) then
564:
565: select sequence_number into l_next_sequence_number
566: from fte_wsh_trips
567: where fte_trip_id = p_trip_info.FTE_TRIP_ID
568: and wsh_trip_id = l_next_segment_id;
569:
570: wsh_debug_sv.dlog (c_debug,'about to get_last_stop_location_id...');
571:
572: fte_mls_util.get_last_stop_location_id
573: (
574: p_trip_segment_id => p_trip_info.WSH_TRIP_ID,
576: x_last_stop_location_id => l_last_stop_location_id,
577: x_return_status => l_return_status
578: );
579:
580: wsh_debug_sv.dlog (c_debug,'last stop loc id',l_last_stop_location_id);
581: wsh_debug_sv.dlog (c_debug,'return status from get_last_stop_location_id',l_return_status);
582:
583: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS
584: AND l_return_status <> WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
577: x_return_status => l_return_status
578: );
579:
580: wsh_debug_sv.dlog (c_debug,'last stop loc id',l_last_stop_location_id);
581: wsh_debug_sv.dlog (c_debug,'return status from get_last_stop_location_id',l_return_status);
582:
583: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS
584: AND l_return_status <> WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
585: set_return_status
589: );
590: RETURN;
591: END IF;
592:
593: wsh_debug_sv.dlog (c_debug,'return status', x_return_status);
594:
595: wsh_debug_sv.dlog (c_debug,'about to check_next_segment...');
596:
597: fte_mls_util.check_next_segment
591: END IF;
592:
593: wsh_debug_sv.dlog (c_debug,'return status', x_return_status);
594:
595: wsh_debug_sv.dlog (c_debug,'about to check_next_segment...');
596:
597: fte_mls_util.check_next_segment
598: (
599: p_trip_id => p_trip_info.FTE_TRIP_ID,
605: x_connected => l_connected,
606: x_return_status => l_return_status
607: );
608:
609: wsh_debug_sv.dlog (c_debug,'l_connected',l_connected);
610: wsh_debug_sv.dlog (c_debug,'return_status from check_next_segment',l_return_status);
611:
612: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS
613: AND l_return_status <> WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
606: x_return_status => l_return_status
607: );
608:
609: wsh_debug_sv.dlog (c_debug,'l_connected',l_connected);
610: wsh_debug_sv.dlog (c_debug,'return_status from check_next_segment',l_return_status);
611:
612: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS
613: AND l_return_status <> WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
614: set_return_status
618: );
619: RETURN;
620: END IF;
621:
622: wsh_debug_sv.dlog (c_debug,'return status', x_return_status);
623:
624: if (l_connected is null or l_connected = false) then
625:
626: wsh_debug_sv.dlog (c_debug,'about to mark trip invalid...');
622: wsh_debug_sv.dlog (c_debug,'return status', x_return_status);
623:
624: if (l_connected is null or l_connected = false) then
625:
626: wsh_debug_sv.dlog (c_debug,'about to mark trip invalid...');
627:
628: update fte_trips
629: set validation_required = 'Y'
630: where fte_trip_id = p_trip_info.FTE_TRIP_ID;
628: update fte_trips
629: set validation_required = 'Y'
630: where fte_trip_id = p_trip_info.FTE_TRIP_ID;
631:
632: wsh_debug_sv.dlog (c_debug,'about to set warning message...');
633:
634: -- give warning
635: FND_MESSAGE.SET_NAME('FTE', 'FTE_SEGMENT_NEXT_CONNECT_ERROR');
636: FND_MESSAGE.SET_TOKEN('TRIP_NAME',l_fte_trip_name);
643: end if; -- l_next_segment_id is NOT null
644:
645: end if; -- p_action_code = 'CREATE'
646:
647: wsh_debug_sv.dlog (c_debug,'validate trip done');
648:
649: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
650: wsh_debug_sv.dpop (c_sdebug);
651: wsh_debug_sv.stop_debug;
645: end if; -- p_action_code = 'CREATE'
646:
647: wsh_debug_sv.dlog (c_debug,'validate trip done');
648:
649: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
650: wsh_debug_sv.dpop (c_sdebug);
651: wsh_debug_sv.stop_debug;
652:
653: EXCEPTION
646:
647: wsh_debug_sv.dlog (c_debug,'validate trip done');
648:
649: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
650: wsh_debug_sv.dpop (c_sdebug);
651: wsh_debug_sv.stop_debug;
652:
653: EXCEPTION
654: WHEN add_segment_to_closed_trip THEN
647: wsh_debug_sv.dlog (c_debug,'validate trip done');
648:
649: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
650: wsh_debug_sv.dpop (c_sdebug);
651: wsh_debug_sv.stop_debug;
652:
653: EXCEPTION
654: WHEN add_segment_to_closed_trip THEN
655: FND_MESSAGE.SET_NAME('FTE', 'FTE_INVALID_TRIP_STATUS');
655: FND_MESSAGE.SET_NAME('FTE', 'FTE_INVALID_TRIP_STATUS');
656: x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR;
657: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
658:
659: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
660: wsh_debug_sv.dpop (c_sdebug);
661: wsh_debug_sv.stop_debug;
662:
663: WHEN add_segment_to_in_transit_trip THEN
656: x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR;
657: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
658:
659: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
660: wsh_debug_sv.dpop (c_sdebug);
661: wsh_debug_sv.stop_debug;
662:
663: WHEN add_segment_to_in_transit_trip THEN
664: FND_MESSAGE.SET_NAME('FTE', 'FTE_INVALID_TRIP_STATUS2');
657: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
658:
659: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
660: wsh_debug_sv.dpop (c_sdebug);
661: wsh_debug_sv.stop_debug;
662:
663: WHEN add_segment_to_in_transit_trip THEN
664: FND_MESSAGE.SET_NAME('FTE', 'FTE_INVALID_TRIP_STATUS2');
665: x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR;
664: FND_MESSAGE.SET_NAME('FTE', 'FTE_INVALID_TRIP_STATUS2');
665: x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR;
666: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
667:
668: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
669: wsh_debug_sv.dpop (c_sdebug);
670: wsh_debug_sv.stop_debug;
671:
672: WHEN update_sequence_for_non_open THEN
665: x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR;
666: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
667:
668: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
669: wsh_debug_sv.dpop (c_sdebug);
670: wsh_debug_sv.stop_debug;
671:
672: WHEN update_sequence_for_non_open THEN
673: FND_MESSAGE.SET_NAME('FTE', 'FTE_INVALID_TRIP_STATUS3');
666: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
667:
668: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
669: wsh_debug_sv.dpop (c_sdebug);
670: wsh_debug_sv.stop_debug;
671:
672: WHEN update_sequence_for_non_open THEN
673: FND_MESSAGE.SET_NAME('FTE', 'FTE_INVALID_TRIP_STATUS3');
674: x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR;
673: FND_MESSAGE.SET_NAME('FTE', 'FTE_INVALID_TRIP_STATUS3');
674: x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR;
675: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
676:
677: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
678: wsh_debug_sv.dpop (c_sdebug);
679: wsh_debug_sv.stop_debug;
680:
681: WHEN others THEN
674: x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR;
675: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
676:
677: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
678: wsh_debug_sv.dpop (c_sdebug);
679: wsh_debug_sv.stop_debug;
680:
681: WHEN others THEN
682: wsh_util_core.default_handler('FTE_WSH_TRIPS_PUB.Validate_Trip');
675: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
676:
677: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
678: wsh_debug_sv.dpop (c_sdebug);
679: wsh_debug_sv.stop_debug;
680:
681: WHEN others THEN
682: wsh_util_core.default_handler('FTE_WSH_TRIPS_PUB.Validate_Trip');
683: x_return_status := WSH_UTIL_CORE.G_RET_STS_UNEXP_ERROR;
682: wsh_util_core.default_handler('FTE_WSH_TRIPS_PUB.Validate_Trip');
683: x_return_status := WSH_UTIL_CORE.G_RET_STS_UNEXP_ERROR;
684: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
685:
686: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
687: wsh_debug_sv.dpop (c_sdebug);
688: wsh_debug_sv.stop_debug;
689:
690: END Validate_Trip;
683: x_return_status := WSH_UTIL_CORE.G_RET_STS_UNEXP_ERROR;
684: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
685:
686: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
687: wsh_debug_sv.dpop (c_sdebug);
688: wsh_debug_sv.stop_debug;
689:
690: END Validate_Trip;
691:
684: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
685:
686: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
687: wsh_debug_sv.dpop (c_sdebug);
688: wsh_debug_sv.stop_debug;
689:
690: END Validate_Trip;
691:
692: --
702: x_return_status OUT NOCOPY VARCHAR2
703: ) IS
704: BEGIN
705:
706: wsh_debug_sv.dpush (c_sdebug, 'Create_Trip');
707:
708: wsh_debug_sv.dlog (c_debug,'FteTripId ',p_trip_info.fte_trip_id);
709: wsh_debug_sv.dlog (c_debug,'WshTripId ',p_trip_info.wsh_trip_id);
710: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',p_trip_info.sequence_number);
704: BEGIN
705:
706: wsh_debug_sv.dpush (c_sdebug, 'Create_Trip');
707:
708: wsh_debug_sv.dlog (c_debug,'FteTripId ',p_trip_info.fte_trip_id);
709: wsh_debug_sv.dlog (c_debug,'WshTripId ',p_trip_info.wsh_trip_id);
710: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',p_trip_info.sequence_number);
711:
712: x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
705:
706: wsh_debug_sv.dpush (c_sdebug, 'Create_Trip');
707:
708: wsh_debug_sv.dlog (c_debug,'FteTripId ',p_trip_info.fte_trip_id);
709: wsh_debug_sv.dlog (c_debug,'WshTripId ',p_trip_info.wsh_trip_id);
710: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',p_trip_info.sequence_number);
711:
712: x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
713:
706: wsh_debug_sv.dpush (c_sdebug, 'Create_Trip');
707:
708: wsh_debug_sv.dlog (c_debug,'FteTripId ',p_trip_info.fte_trip_id);
709: wsh_debug_sv.dlog (c_debug,'WshTripId ',p_trip_info.wsh_trip_id);
710: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',p_trip_info.sequence_number);
711:
712: x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
713:
714: wsh_debug_sv.dlog (c_debug,'about to validate trip...');
710: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',p_trip_info.sequence_number);
711:
712: x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
713:
714: wsh_debug_sv.dlog (c_debug,'about to validate trip...');
715:
716: Validate_Trip(p_trip_info, 'CREATE', x_return_status);
717: IF (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS
718: AND x_return_status <> WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
718: AND x_return_status <> WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
719: RETURN;
720: END IF;
721:
722: wsh_debug_sv.dlog (c_debug,'about to insert into fte_wsh_trips table...');
723:
724: insert into fte_wsh_trips
725: (
726: FTE_TRIP_ID ,
785: );
786:
787: IF (x_return_status = WSH_UTIL_CORE.G_RET_STS_WARNING) THEN
788:
789: wsh_debug_sv.dlog (c_debug,'about to mark trip invalid...');
790:
791: --mark trip as invalid
792: update fte_trips
793: set validation_required = 'Y'
793: set validation_required = 'Y'
794: where fte_trip_id = p_trip_info.FTE_TRIP_ID;
795: END IF;
796:
797: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
798: wsh_debug_sv.dpop (c_sdebug);
799: wsh_debug_sv.stop_debug;
800:
801: EXCEPTION
794: where fte_trip_id = p_trip_info.FTE_TRIP_ID;
795: END IF;
796:
797: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
798: wsh_debug_sv.dpop (c_sdebug);
799: wsh_debug_sv.stop_debug;
800:
801: EXCEPTION
802: WHEN others THEN
795: END IF;
796:
797: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
798: wsh_debug_sv.dpop (c_sdebug);
799: wsh_debug_sv.stop_debug;
800:
801: EXCEPTION
802: WHEN others THEN
803: wsh_util_core.default_handler('FTE_WSH_TRIPS_PUB.Create_Trip');
803: wsh_util_core.default_handler('FTE_WSH_TRIPS_PUB.Create_Trip');
804: x_return_status := WSH_UTIL_CORE.G_RET_STS_UNEXP_ERROR;
805: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
806:
807: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
808: wsh_debug_sv.dpop (c_sdebug);
809: wsh_debug_sv.stop_debug;
810:
811: END Create_Trip;
804: x_return_status := WSH_UTIL_CORE.G_RET_STS_UNEXP_ERROR;
805: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
806:
807: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
808: wsh_debug_sv.dpop (c_sdebug);
809: wsh_debug_sv.stop_debug;
810:
811: END Create_Trip;
812:
805: WSH_UTIL_CORE.ADD_MESSAGE(x_return_status);
806:
807: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
808: wsh_debug_sv.dpop (c_sdebug);
809: wsh_debug_sv.stop_debug;
810:
811: END Create_Trip;
812:
813: --
1096: no_trip_found EXCEPTION;
1097:
1098: BEGIN
1099:
1100: wsh_debug_sv.start_debug ('FteWshTrip-' || p_fte_trip_id || '-' || p_wsh_trip_id);
1101: wsh_debug_sv.dpush (c_sdebug, 'Delete_Trip');
1102:
1103: --
1104: --
1097:
1098: BEGIN
1099:
1100: wsh_debug_sv.start_debug ('FteWshTrip-' || p_fte_trip_id || '-' || p_wsh_trip_id);
1101: wsh_debug_sv.dpush (c_sdebug, 'Delete_Trip');
1102:
1103: --
1104: --
1105: -- Initialize message list if p_init_msg_list is set to TRUE.
1149: , p_data => x_msg_data
1150: , p_encoded => FND_API.G_FALSE
1151: );
1152:
1153: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
1154: wsh_debug_sv.dpop (c_sdebug);
1155: wsh_debug_sv.stop_debug;
1156:
1157: EXCEPTION
1150: , p_encoded => FND_API.G_FALSE
1151: );
1152:
1153: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
1154: wsh_debug_sv.dpop (c_sdebug);
1155: wsh_debug_sv.stop_debug;
1156:
1157: EXCEPTION
1158: WHEN no_trip_found THEN
1151: );
1152:
1153: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
1154: wsh_debug_sv.dpop (c_sdebug);
1155: wsh_debug_sv.stop_debug;
1156:
1157: EXCEPTION
1158: WHEN no_trip_found THEN
1159: FND_MESSAGE.SET_NAME('FTE','FTE_NO_TRIP_SEGMENT_ID');
1365: invalid_action EXCEPTION;
1366:
1367: BEGIN
1368:
1369: wsh_debug_sv.start_debug ('FteWshTrip-' || pp_fte_trip_id || '-' || pp_wsh_trip_id);
1370: wsh_debug_sv.dpush (c_sdebug, 'Create_Update_Trip_Wrapper');
1371:
1372: wsh_debug_sv.dlog (c_debug,'FteTripId ',pp_fte_trip_id);
1373: wsh_debug_sv.dlog (c_debug,'WshTripId ',pp_wsh_trip_id);
1366:
1367: BEGIN
1368:
1369: wsh_debug_sv.start_debug ('FteWshTrip-' || pp_fte_trip_id || '-' || pp_wsh_trip_id);
1370: wsh_debug_sv.dpush (c_sdebug, 'Create_Update_Trip_Wrapper');
1371:
1372: wsh_debug_sv.dlog (c_debug,'FteTripId ',pp_fte_trip_id);
1373: wsh_debug_sv.dlog (c_debug,'WshTripId ',pp_wsh_trip_id);
1374: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',pp_sequence_number);
1368:
1369: wsh_debug_sv.start_debug ('FteWshTrip-' || pp_fte_trip_id || '-' || pp_wsh_trip_id);
1370: wsh_debug_sv.dpush (c_sdebug, 'Create_Update_Trip_Wrapper');
1371:
1372: wsh_debug_sv.dlog (c_debug,'FteTripId ',pp_fte_trip_id);
1373: wsh_debug_sv.dlog (c_debug,'WshTripId ',pp_wsh_trip_id);
1374: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',pp_sequence_number);
1375: wsh_debug_sv.dlog (c_debug,'ActionCode ',p_action_code);
1376: wsh_debug_sv.dlog (c_debug,'ValidateFlag ',p_validate_flag);
1369: wsh_debug_sv.start_debug ('FteWshTrip-' || pp_fte_trip_id || '-' || pp_wsh_trip_id);
1370: wsh_debug_sv.dpush (c_sdebug, 'Create_Update_Trip_Wrapper');
1371:
1372: wsh_debug_sv.dlog (c_debug,'FteTripId ',pp_fte_trip_id);
1373: wsh_debug_sv.dlog (c_debug,'WshTripId ',pp_wsh_trip_id);
1374: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',pp_sequence_number);
1375: wsh_debug_sv.dlog (c_debug,'ActionCode ',p_action_code);
1376: wsh_debug_sv.dlog (c_debug,'ValidateFlag ',p_validate_flag);
1377: --
1370: wsh_debug_sv.dpush (c_sdebug, 'Create_Update_Trip_Wrapper');
1371:
1372: wsh_debug_sv.dlog (c_debug,'FteTripId ',pp_fte_trip_id);
1373: wsh_debug_sv.dlog (c_debug,'WshTripId ',pp_wsh_trip_id);
1374: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',pp_sequence_number);
1375: wsh_debug_sv.dlog (c_debug,'ActionCode ',p_action_code);
1376: wsh_debug_sv.dlog (c_debug,'ValidateFlag ',p_validate_flag);
1377: --
1378: --
1371:
1372: wsh_debug_sv.dlog (c_debug,'FteTripId ',pp_fte_trip_id);
1373: wsh_debug_sv.dlog (c_debug,'WshTripId ',pp_wsh_trip_id);
1374: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',pp_sequence_number);
1375: wsh_debug_sv.dlog (c_debug,'ActionCode ',p_action_code);
1376: wsh_debug_sv.dlog (c_debug,'ValidateFlag ',p_validate_flag);
1377: --
1378: --
1379: -- Initialize message list if p_init_msg_list is set to TRUE.
1372: wsh_debug_sv.dlog (c_debug,'FteTripId ',pp_fte_trip_id);
1373: wsh_debug_sv.dlog (c_debug,'WshTripId ',pp_wsh_trip_id);
1374: wsh_debug_sv.dlog (c_debug,'SequenceNumber ',pp_sequence_number);
1375: wsh_debug_sv.dlog (c_debug,'ActionCode ',p_action_code);
1376: wsh_debug_sv.dlog (c_debug,'ValidateFlag ',p_validate_flag);
1377: --
1378: --
1379: -- Initialize message list if p_init_msg_list is set to TRUE.
1380: --
1439: , p_data => x_msg_data
1440: , p_encoded => FND_API.G_FALSE
1441: );
1442:
1443: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
1444: wsh_debug_sv.dpop (c_sdebug);
1445: wsh_debug_sv.stop_debug;
1446:
1447: EXCEPTION
1440: , p_encoded => FND_API.G_FALSE
1441: );
1442:
1443: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
1444: wsh_debug_sv.dpop (c_sdebug);
1445: wsh_debug_sv.stop_debug;
1446:
1447: EXCEPTION
1448: WHEN invalid_action THEN
1441: );
1442:
1443: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
1444: wsh_debug_sv.dpop (c_sdebug);
1445: wsh_debug_sv.stop_debug;
1446:
1447: EXCEPTION
1448: WHEN invalid_action THEN
1449: FND_MESSAGE.SET_NAME('FTE','FTE_WSH_TRIPS_WRAPPER_ERR1');
1455: , p_data => x_msg_data
1456: , p_encoded => FND_API.G_FALSE
1457: );
1458:
1459: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
1460: wsh_debug_sv.dpop (c_sdebug);
1461: wsh_debug_sv.stop_debug;
1462:
1463: WHEN others THEN
1456: , p_encoded => FND_API.G_FALSE
1457: );
1458:
1459: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
1460: wsh_debug_sv.dpop (c_sdebug);
1461: wsh_debug_sv.stop_debug;
1462:
1463: WHEN others THEN
1464: wsh_util_core.default_handler('FTE_WSH_TRIPS_PUB.Create_Update_Trip_Wrapper');
1457: );
1458:
1459: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
1460: wsh_debug_sv.dpop (c_sdebug);
1461: wsh_debug_sv.stop_debug;
1462:
1463: WHEN others THEN
1464: wsh_util_core.default_handler('FTE_WSH_TRIPS_PUB.Create_Update_Trip_Wrapper');
1465: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1469: , p_data => x_msg_data
1470: , p_encoded => FND_API.G_FALSE
1471: );
1472:
1473: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
1474: wsh_debug_sv.dpop (c_sdebug);
1475: wsh_debug_sv.stop_debug;
1476:
1477: END Create_Update_Trip_Wrapper;
1470: , p_encoded => FND_API.G_FALSE
1471: );
1472:
1473: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
1474: wsh_debug_sv.dpop (c_sdebug);
1475: wsh_debug_sv.stop_debug;
1476:
1477: END Create_Update_Trip_Wrapper;
1478:
1471: );
1472:
1473: wsh_debug_sv.dlog (c_debug,'Return Status',x_Return_Status);
1474: wsh_debug_sv.dpop (c_sdebug);
1475: wsh_debug_sv.stop_debug;
1476:
1477: END Create_Update_Trip_Wrapper;
1478:
1479: END FTE_WSH_TRIPS_PVT;