As an EDI Gateway Service,
I want to orchestrate and execute all GCX111 EDI data mapping and validation logic,
So that I can ensure strict compliance with US Customs (P140) automated payload constraints in a single consolidated service.
I want to orchestrate and execute all GCX111 EDI data mapping and validation logic,
So that I can ensure strict compliance with US Customs (P140) automated payload constraints in a single consolidated service.
Prerequisites & Setup
- [Initialize Search Parameters]
The M12 search process is initiated → All search parameters are initialized, M12 found flag is set to false, and search counters are reset to starting values - [Initialize Search Parameters]
The system initializes search parameters → Search counters are set to initial values and flags are reset for segment processing - [Initialize EBSBCCX Counter to 1]
The search process begins → The EBSBCCX counter is set to 1 to start from the first segment - [Initialize Sequence Counter to 001]
The EBSBCCR search process begins → The sequence counter is set to 001 to start searching from the first segment - [Initialize A2 Segment Cleanup]
The cleanup process begins → The system initializes A2 segment search parameters and sets counters to zero - [Initialize B1 Segment Search]
The system begins B1 segment cleanup → The system initializes B1 segment search parameters for the current CCN - [Initialize Search Parameters]
The system begins EDI CCN extraction process → Search parameters are initialized with starting values and segment counters are reset - [Initialize Sequence Counter to 1]
The system begins searching for EBSBCCR segments → The sequence counter is initialized to 1 to start sequential segment processing - [Initialize Sequence Counter]
The system prepares to process multiple segments sequentially → The sequence counter WS-SUB-CX is initialized to control iteration through segments - [Initialize Search Parameters]
The system begins CCN extraction from EDI segments → Search parameters are initialized and CCN found flag is set to false - [Initialize Sequence Counter to 001]
The EBSBCCR search process begins → The sequence counter is initialized to 001 to start searching from the first segment - [Initialize Search Parameters]
The EDI reference number extraction process begins → All search parameters are initialized and flags are set to not found status - [Initialize Sequence Counter]
The EBSBCCR search process is initiated → The sequence counter is set to 1 to start sequential processing
Core Acceptance Criteria
- [11:EDI BOL CCN Extraction]
Searching EBSBCCX segments up to 98 iterations or EBSBCCR segments up to 998 iterations → Extract N9 CUB reference numbers with qualifiers 'CUB', 'ZZZ', or 'ZZ ' and store for CCN validation - [CCN Already Exists?]
If the lookup results to determine CCN existence → If CCN exists, proceed to port validation exception check, otherwise allow CCN creation - [Extract SCAC from EDI BOL CCN Positions 1-4]
The system processes the EDI BOL CCN for SCAC validation → The SCAC code is extracted from positions 1-4 of the EDI BOL CCN - [Extract Equipment Number from Fastway Waybill]
The system needs to validate EDI BOL equipment data → The equipment number is extracted from the Fastway waybill record - [Extract Equipment Number from EDI BOL]
The system needs to validate equipment data consistency → The equipment number is extracted from the EDI BOL record - [Call GCJSTNUM Utility to Standardize EDI Equipment Number]
The system needs to prepare the equipment number for comparison → The GCJSTNUM utility is called to standardize the EDI equipment number format - [Set Valid EDI BOL Flag]
The equipment validation check is performed → The system sets the valid EDI BOL flag to indicate successful validation - [Set Invalid EDI BOL Flag]
The equipment validation check is performed → The system sets the invalid EDI BOL flag to indicate validation failure - [Equipment Validation Successful]
The complete equipment validation process is performed → The system confirms equipment validation is successful - [Equipment Validation Failed]
The equipment validation process is performed → The system indicates equipment validation has failed - [Call GCJSTNUM Utility for EDI Equipment]
The system processes the EDI equipment number for validation → The GCJSTNUM utility is called to standardize the EDI equipment number format - [Equipment Validation Successful]
The equipment numbers match exactly → Equipment validation is marked as successful and processing continues - [Equipment Validation Failed]
The equipment numbers do not match → Equipment validation is marked as failed and an error flag is set - [Retrieve SE Table Segment]
The system attempts to retrieve the SE table segment → The SE table segment is accessed from GCSTBRT table - [Extract Automation Status from SE Table]
The system processes the SE table data → The automation status indicator is extracted from the SE table segment - [Check CCN Against Existing Records]
The system queries existing US Customs records → Search GCSUSRT segments to identify any existing CCN matches - [Search EDI BOL Segments for M12 In-Bond Type]
The system searches for M12 in-bond type segments in the EDI BOL → The system should locate and retrieve all M12 segments from EBSBCCR or EBSBCCX segments - [Search EBSBCCR Segments]
The system performs EBSBCCR segment retrieval with sequential counter → Each EBSBCCR segment is retrieved and checked for M12 in-bond information until found or all segments are processed - [Extract M12 Segment Data]
The system processes the segment content for M12 information → M12 in-bond data elements are extracted and stored in working storage for validation - [Location Valid?]
If location validity → If locations are valid, proceed to EBSBCCX search, otherwise set M12 not found flag - [Search EBSBCCX Segments]
The system performs EBSBCCX segment retrieval → EBSBCCX segments are searched for supplementary M12 in-bond data using sequential access - [EBSBCCX Found?]
The system checks EBSBCCX retrieval status → If EBSBCCX segment is found, extract additional M12 data, otherwise proceed to set validation flag - [Extract Additional M12 Data]
The system processes EBSBCCX content for additional M12 data → Supplementary M12 information is extracted and combined with existing M12 data - [Mark Sequence 01 Found]
The system processes this sequence identification → The system sets an indicator flag to record that sequence 01 has been found - [Mark Sequence 02 Found]
The system processes this sequence identification → The system sets an indicator flag to record that sequence 02 has been found - [More Segments?]
The system checks if there are more segments to process in the EDI BOL → The system either continues reading additional segments or proceeds to final validation - [Set M12 Valid Flag]
The system completes the M12 sequence validation process → The system sets the M12 valid flag to indicate successful validation - [Set M12 Validation Success Flag]
All M12 segment validations are complete and successful → Set M12 validation success flag and continue M12 processing - [Search EBSBCCX Segments]
The system searches for reference numbers up to 98 iterations → Each EBSBCCX segment is retrieved and checked for N9 reference data - [EBSBCCX Found?]
The segment retrieval is attempted → The system determines if the segment exists and sets appropriate processing flags - [Extract N9 Reference Qualifier]
The system extracts the reference qualifier → The qualifier code is captured for validation against expected values - [Extract CCN from Reference Number]
The system extracts the reference number value → The CCN value is captured for format validation - [Valid CCN?]
The validation results are evaluated → The system determines if the CCN should be stored for manifest processing - [Store CCN for Processing]
The CCN is stored for processing → The CCN is available for manifest creation and N9-CUB found flag is set - [Search EBSBCCR Segments]
The system searches EBSBCCR segments up to 998 iterations → Each EBSBCCR segment is retrieved and checked for N9 reference data - [EBSBCCR Found?]
The segment retrieval is attempted → The system determines if the segment exists and continues processing or concludes search - [More Segments?]
The system checks for more segments to process → Processing continues with next segment or concludes the search based on iteration limits - [CCN Extraction Complete]
The extraction process completes → The system proceeds with manifest processing using the extracted CCN - [No CCN Found]
The search concludes unsuccessfully → The system continues manifest processing without EDI-derived CCN - [Retrieve EBSBCCX Segment]
The system attempts to retrieve the EBSBCCX segment at the counter position → The system calls the database access routine to get the segment data - [Extract Reference Qualifier]
The system processes the segment data → The reference qualifier field is extracted and made available for comparison - [Extract Reference Number as CCN]
The system processes the CUB reference → The reference number is extracted and stored as the Customs Control Number - [Increment Counter]
The system needs to continue searching additional segments → The counter is incremented by 1 to access the next segment - [Continue to Next Segment]
The system continues the search process → The system proceeds to retrieve the next EBSBCCX segment - [CCN Found?]
If the search results → The system determines if a CCN was successfully found or not found - [Return CCN for Validation]
The search process completes successfully → The CCN is returned to the calling process for additional validation steps - [Return No CCN Found]
The search process ends unsuccessfully → The system returns an indicator that no CCN was found - [Build EDI BOL Key with Sequence]
The system needs to retrieve a specific EBSBCCR segment → The EDI BOL key is constructed by appending 'CR' and the formatted sequence number to create the segment identifier - [Retrieve EBSBCCR Segment]
The system attempts to retrieve the EBSBCCR segment → The system calls the database access routine to fetch the segment data and sets appropriate found/not found indicators - [Segment Found?]
The system checks the retrieval result → If the segment exists, continue with data extraction; otherwise, set not found flag and terminate search - [Extract N9 Reference Qualifier]
The system processes the segment data → The N9 reference qualifier is extracted and stored in working storage for evaluation - [Extract N9 Reference Number]
The system continues processing the segment data → The N9 reference number is extracted and stored in working storage for potential CCN validation - [Set CCN Found Flag]
The system completes the CCN storage process → The CCN found flag is set to indicate successful CCN retrieval - [Increment Sequence Counter]
The system prepares to search the next segment → The sequence counter is incremented by 1 to target the next sequential segment - [Sequence <= 998?]
The system checks if more segments can be searched → If the sequence counter is less than or equal to 998, continue searching; otherwise, terminate the search process - [Set Not Found Flag]
The system finalizes the search results → The not found flag is set to indicate that no valid CCN was discovered in the available EBSBCCR segments - [Search EDI BOL for N9*CUB Segments]
The system searches EBSBCCX and EBSBCCR segments for N9 reference numbers → Look for qualifiers 'CUB', 'ZZZ', or 'ZZ ' and extract the corresponding reference number as the CCN - [Read SS Table Segment from GCSTBRT]
The system performs SCAC validation → The system reads the corresponding SS table segment from GCSTBRT database - [CCN Override Provided?]
The system checks for CCN override provision → If GCM111-CCN-OVERRIDE is true, use override CCN path, otherwise proceed to EDI BOL extraction - [Search N9*CUB Qualifiers in EBSBCCR]
The system searches EBSBCCR segments for N9 CUB qualifiers up to 998 iterations → If N9 CUB qualifier is found, extract the reference number for CCN validation, otherwise continue to EBSBCCX search - [Search N9*CUB Qualifiers in EBSBCCX]
The system searches EBSBCCX segments for N9 CUB qualifiers up to 98 iterations → If N9 CUB qualifier is found, extract the reference number for CCN validation, otherwise proceed without EDI CCN - [Set Final CCN for Processing]
The system determines the final CCN for processing → Use override CCN if both sources match, or use EDI CCN if only EDI source is valid, or use override CCN if only override is valid - [Waybill Corrector Route]
The waybill update has skip flag set to true → The system logs a skip message and exits processing without performing the update - [Retrieve Existing Manifest Data]
The system attempts to retrieve existing manifest data using the US CCN key → The current manifest record is loaded from GCSUSRT segments for processing - [Clean Up A2 Segments]
The system performs cleanup operations → Old GCUSRT record is deleted and A2 cleanup is performed before creating the new record - [Send EDI 417 Status Message]
The system sends status notification → An EDI 417 status message is transmitted to notify relevant parties of the update completion - [Clean Up A2 Segments]
The system cleans up A2 segments → Obsolete A2 segments are removed from the system - [Remove Related B1 Segments]
The system removes related B1 segments → Invalid B1 segments are removed from the manifest record - [Send EDI 417 Status Message]
The system sends EDI 417 status message → EDI 417 message is transmitted to notify stakeholders of the correction - [Update Special Manifest Data]
The system updates special manifest data → Special manifest information is updated to reflect the waybill corrections - [Broker Entry Filed?]
The broker entry status indicates it has been officially filed → The update request is rejected and an error message is generated indicating updates not allowed after broker entry filing - [Is Cargo Released?]
The cargo status indicates the shipment has been released by customs → The update request is rejected and an error message is generated indicating released cargo cannot be modified - [Is Cargo on Hold?]
The cargo status indicates the shipment is currently on hold → The update request is rejected and an error message is generated indicating cargo on hold cannot be modified - [Is Manifest Exported?]
The manifest status indicates it has been exported or transmitted to customs → The update request is rejected and an error message is generated indicating exported manifests cannot be modified - [Update Waybill Keys Across Segments]
The system updates waybill key references → All related manifest segments are updated with corrected waybill keys - [Process CCN Key Changes]
The system processes CCN key changes → CCN key changes are applied and related data is updated accordingly - [Clean Up A2 Segments]
The system performs cleanup operations → Obsolete A2 segments are removed to maintain data integrity - [Send EDI 417 Status Message]
The system sends status notifications → EDI 417 message is transmitted to notify external systems of the correction - [Complete Waybill Correction]
The system finalizes the correction process → Waybill correction is marked as complete and process terminates successfully - [Read Current Manifest Segments]
The system begins the backup process → All current manifest segments (GCSUSRT, GCSA2RT, GCSB1RT) are read from the database - [Save GCSUSRT Segment Data]
The backup process saves US manifest data → GCSUSRT segment data is copied to working storage backup area - [Save GCSA2RT Segment Data]
The backup process saves A2 segment data → GCSA2RT segment data is copied to working storage backup area - [Save GCSB1RT Segment Data]
The backup process saves B1 segment data → GCSB1RT segment data is copied to working storage backup area - [Store Backup in Working Storage]
The system consolidates backup data → All backup data is stored in the working storage backup area for potential restoration - [Set Backup Complete Flag]
The backup process completes → A backup complete flag is set to indicate successful backup completion - [Retrieve GCSUSRT Segment]
The system attempts to retrieve the GCSUSRT segment using the manifest key → The system should successfully locate and load the US Customs manifest record or set appropriate not found indicator - [Retrieve GCSA2RT Segments]
The system attempts to retrieve GCSA2RT segments using the manifest key → The system should successfully locate and load all related A2 segments or set appropriate not found indicator - [Retrieve GCSB1RT Segments]
The system attempts to retrieve GCSB1RT segments using the manifest key → The system should successfully locate and load all related B1 segments or set appropriate not found indicator - [All Segments Valid?]
If the validation results → If all segments are valid, proceed to backup current manifest data, otherwise set validation error flag - [Backup Current Manifest Data]
The system prepares to process manifest changes → The system should create a complete backup of the current manifest data for recovery purposes - [Set Segments Available Flag]
The system completes the segment retrieval and validation process → The system should set the segments available flag to indicate readiness for manifest processing - [Update Broker Information]
Broker information changes are processed during cargo status updates → The system updates broker fields in GCSA2RT segments with new broker information - [Update Bond Data]
Bond data changes are processed during cargo status updates → The system updates bond fields in SHIPMINU segments with new bond information - [Reject - Broker Entry Already Filed]
The broker entry is already filed → Reject the broker change request and generate 'Broker Entry Already Filed' error message - [Reject - Unauthorized Broker Change]
The user or process is not authorized to change broker information → Reject the broker change request and generate 'Unauthorized Broker Change' error message - [Check Broker B1 Table Segments]
The system needs to check notification preferences → The system accesses the broker B1 table segments for preference data - [Read B1 Table Segments for Preferences]
The system needs to determine notification channel preferences → The system reads the B1 table segments to obtain detailed preference settings for Merlin, Internet, and Fax channels - [Retrieve Bond Information from GCSUSS99]
The system needs bond configuration information → Bond information is retrieved from GCSUSS99 segment - [Set Rail Bond Qualifier]
The system sets bond qualifiers → Rail bond qualifier is set for the bond segment - [Set Shipper Bond Qualifier]
The system sets bond qualifiers → Shipper bond qualifier is set for the bond segment - [Create SHIPMINU Bond Segment]
The system creates bond segments → A SHIPMINU bond segment is created with the appropriate bond information - [Create U2 Broker Information Segment]
The system processes broker information → A U2 broker information segment is created with broker details - [Update Bond Control Numbers]
The system finalizes bond processing → Bond control numbers and related bond information are updated - [Backup Current Manifest Data]
The system initiates the CCN update process → Current manifest data including primary segments, A2 segments, and B1 segments are backed up before modification - [Update CCN in Primary Segments]
The system updates the primary manifest segments → The CCN is updated in GCSUSRT primary segments and the old record is deleted - [Update CCN in Related A2 Segments]
The system processes related A2 segments → All A2 segment records referencing the old CCN are updated with the new CCN - [Update CCN in Related B1 Segments]
The system processes related B1 segments → All B1 segment records referencing the old CCN are updated with the new CCN - [Call GCX105 Transfer Logging]
The system needs to log the CCN transfer → GCX105 transfer logging service is called with old CCN, new CCN, and manifest details - [Log CCN Transfer Message]
The system creates the transfer log message → A log entry is created with transfer details including old CCN, new CCN, waybill information, and timestamp - [Preserve Segment Types 07, 09, 15]
The system processes A2 segments during cleanup and encounters segments with record types 07, 09, or 15 → The system must preserve these segments without deletion and continue processing other segments - [Remove Other A2 Segments]
The system processes these segments during A2 cleanup → The system must remove these non-critical segments from the database - [Extract N9*2K Reference from Type 02 Segments]
The system processes these type 02 segments during cleanup → The system must extract the N9*2K reference information from these segments for use in B1 segment processing - [Locate Related B1 Segments]
The system searches for related B1 segments using this reference → The system must locate all B1 segments that are related to the extracted N9*2K reference - [Delete B1 Segment]
A B1 segment is determined to be related to the current CCN being processed → The system must delete this B1 segment from the database - [Preserve B1 Segment]
A B1 segment is determined to be not related to the current CCN being processed → The system must preserve this B1 segment without deletion - [Continue Processing Remaining Segments]
The processing of the current segment is complete → The system must continue processing the next available segment in the cleanup sequence - [A2 Cleanup Complete]
There are no more segments remaining to be processed → The system must mark the A2 cleanup process as complete and proceed to the next phase of processing - [Backup Current CCN Data]
The system initiates the CCN transfer process → The system backs up all current CCN-related data from primary and related segments before making any modifications - [Update CCN in Primary Segments]
The system processes CCN updates for primary manifest segments → The system updates the CCN field in all primary US manifest segments with the new CCN value - [Update CCN in Related A2 Segments]
The system processes CCN updates for A2 segments → The system updates the CCN field in all related A2 segments to match the new CCN value - [Update CCN in Related B1 Segments]
The system processes CCN updates for B1 segments → The system updates the CCN field in all related B1 segments to match the new CCN value - [Update CCN in Bond Segments]
The system processes CCN updates for bond segments → The system updates the CCN field in all related bond segments to match the new CCN value - [Update CCN in Communication Segments]
The system processes CCN updates for communication segments → The system updates the CCN field in all related communication segments to match the new CCN value - [Update Successful?]
If the overall success of the CCN update operation → The system determines if all updates were successful or if any errors occurred during the process - [Log CCN Transfer Completion]
The system finalizes the CCN transfer process → The system logs the successful completion of the CCN transfer with timestamp and confirmation details - [Read Current Manifest Status]
The system processes the update request → The current manifest status must be read from the manifest segments to determine cargo state - [Log Train Status Violation]
The system processes the violation → The train status violation must be logged to the error records for audit tracking - [Allow Update to Proceed]
The system checks the cargo status and finds that the cargo is neither released nor on hold → The system allows the manifest update to proceed without setting any error flags - [Block Update Operation]
The update operation is evaluated → The update operation is blocked from proceeding - [Is Manifest Released?]
The manifest status is 'Released' → The deletion request should be rejected with message that released manifests cannot be deleted - [Are Broker Entries Filed?]
Broker entries have been filed for this manifest → The deletion request should be rejected with message that manifests with filed broker entries cannot be deleted - [Remove Manifest Segments from Database]
The manifest segments need to be removed → All manifest segments should be deleted from the database - [Send EDI 309 Delete Transaction]
EDI notification is required → An EDI 309 delete transaction should be sent to external systems - [Update Manifest Status to Deleted]
Status update is required → The manifest status should be updated to 'Deleted' - [Log Deletion Result Message]
Logging is required → A deletion result message should be logged for audit purposes - [Extract N9*2K Reference Numbers]
The system processes record type '02' segments containing N9*2K reference data → All N9*2K reference numbers are extracted and stored for use in subsequent segment removal operations - [Remove A2 Segments]
The system processes A2 segment removal → All A2 segments are removed except those with record types '07', '09', and '15' which must be preserved - [Remove Related B1 Segments]
The system processes B1 segment removal → Only B1 segments associated with the specific CCN are removed while preserving B1 segments for other CCNs - [Delete GCSUSRT Manifest Segments]
The system performs the final deletion of GCSUSRT segments → The primary GCSUSRT manifest segments are completely removed from the database - [Deletion Not Allowed - Exit]
Any validation check fails (cargo status, broker entry status, or train status) → The deletion process is immediately terminated and no segments are removed from the database - [Extract Current Broker Key]
The system needs to validate broker entry status → The system extracts the broker key from the manifest segments for table lookup - [Lead Manifest Exists?]
The system checks for an existing lead manifest record → Processing branches to either update existing lead manifest or create new background processing message - [Prepare Background Processing Message]
The system prepares to spawn background processing → A background processing message is prepared with appropriate bunch bill parameters and coordination data - [Spawn GCT1131E Message]
The system needs to initiate background bunch bill processing → GCT1131E transaction is spawned to handle the bunch bill processing in the background - [Coordinate with Car-Specific Updates]
Individual cars within the bunch bill require manifest updates → Car-specific updates are coordinated through the bunch bill framework to maintain consistency - [Set Up GCT1131E Message Structure]
The system prepares to create a GCT1131E message → The system should initialize the message structure with default values and prepare for data population - [Populate Waybill Key Data]
The system populates waybill key data → The system should copy waybill key information from the source record to the message structure - [Populate CCN Information]
The system populates CCN information → The system should copy CCN data from the lead manifest record to the message structure - [Set Background Processing Indicators]
The system sets background processing indicators → The system should set flags to indicate this message is for background processing - [Set Bunch Bill Processing Flag]
The system sets the bunch bill processing flag → The system should set the flag to indicate this message is for bunch bill processing - [Spawn GCT1131E Message]
The system spawns the GCT1131E message → The system should initiate the GCT1131E transaction for background processing - [Set Success Indicator]
The system processes the successful spawn result → The system should set the success indicator to indicate successful completion - [Classify as Order Entry 404]
The creation signon equals 'ORD EDI ' → The error record is classified as Order Entry 404 origin - [Classify as Fastway 404]
The creation signon does not equal 'ORD ENT ', 'ORD EDI ', or CC-ACF2-USERID → The error record is classified as Fastway 404 origin with value 'EDI ' - [Set User Identification Fields]
The system sets user identification fields → Error record contains user identification information from retrieved user data - [Call GCCUSIO to Replace A2 Segments]
The system calls GCCUSIO to replace A2 segments → A2 segments are updated with the new error record information - [Classify Data Origin - Determine origin based on creation signon (Order Entry, Fastway, EDI)]
If the creation signon value from CCCOM → The system classifies the data origin as Order Entry Manual for 'ORD ENT ', Order Entry 404 for 'ORD EDI ', Fastway Manual for CC-ACF2-USERID, or Fastway 404 for 'EDI ' - [Set Origin: Order Entry 404]
The system processes the signon classification → The system sets the data origin to Order Entry 404 - [Set Origin: Fastway 404]
The system processes the signon classification → The system sets the data origin to Fastway 404 - [Set Origin as 'ORD EDI' - Order Entry 404]
The creation signon equals 'ORD EDI ' → Data origin is classified as 'ORD EDI ' indicating Order Entry 404 source - [Set Origin as 'EDI' - Fastway 404]
The creation signon does not match 'ORD ENT ', 'ORD EDI ', or CC-ACF2-USERID → Data origin is classified as 'EDI ' indicating Fastway 404 source - [Set User Identification Data]
The system sets user identification data → User identification information is assigned to the error record for proper audit trail - [Call GCCUSIO to Replace A2 Segments]
The system calls GCCUSIO to replace A2 segments → A2 segments are updated with the error record data through GCCUSIO program - [Database Cleanup]
The system performs database cleanup → The system deletes the old GCUSRT record, performs A2 segment cleanup, and creates new manifest records - [EDI 417 Transmission]
The system needs to communicate update status → The system sends appropriate EDI 417 error transmission if validation failed, otherwise confirms successful update - [Read Current Manifest Segments]
The system needs to backup existing manifest data before updates → The system reads current GCSUSRT, GCSA2RT, and GCSB1RT segment data from their respective database tables - [Save GCSUSRT Segment Data]
The backup process is executed for US manifest segments → The system copies all GCSUSRT segment fields to designated backup working storage areas - [Save GCSA2RT Segment Data]
The backup process is executed for A2 segments → The system copies all GCSA2RT segment fields to designated backup working storage areas - [Save GCSB1RT Segment Data]
The backup process is executed for B1 segments → The system copies all GCSB1RT segment fields to designated backup working storage areas - [Store Backup in Working Storage]
The consolidation of backup data is performed → The system organizes all backup data into structured working storage areas for easy access during update operations - [Update Bond Data]
The system processes bond data updates → The bond information is updated in the appropriate manifest segments - [Update Manifest Segments]
The system applies the changes to manifest segments → The manifest segments are updated with new information - [Replace GCSUSRT Segments?]
If whether segment replacement is needed → If GCSUSRT segments need replacement, proceed to replace manifest segments, otherwise proceed to log status changes - [Replace Manifest Segments]
The system replaces manifest segments → The GCSUSRT manifest segments should be replaced with the updated cargo status and manifest information - [Log Status Changes]
The system logs status changes → All cargo status changes should be logged with appropriate audit information for tracking and compliance purposes - [Replace GCSUSRT Segment]
Status changes have been made to the manifest data → The GCSUSRT segment should be replaced to save the changes - [Skip Segment Replacement]
No status changes have been made to the manifest data → Segment replacement should be skipped to avoid unnecessary operations - [Extract New Broker Data from Waybill]
The system processes broker updates → The new broker key, broker name, and broker contact information are extracted from the waybill SHIPROOT and SHIPCOMM segments - [Update Manifest Broker Segments]
The system updates manifest broker segments → The broker key, broker name, and broker contact details are updated in the GCSUSRT manifest record and related broker segments - [Empty Bond Type?]
The bond type field is empty or contains spaces → The system should skip bond creation and proceed without creating SHIPMINU segments - [Map In-Bond Type Codes]
The system needs to create bond segments → The bond type should be mapped to the corresponding in-bond type code using predefined mappings - [Create SHIPMINU Segment]
The system needs to store bond information → A new SHIPMINU segment should be created with the appropriate bond data structure - [Set Bond Qualifier]
The system needs to classify the bond type → The appropriate bond qualifier should be set in the segment based on whether it is a shipper bond or rail bond - [Set Shipper Bond Qualifier]
The system sets the bond qualifier → The shipper bond qualifier should be assigned to the SHIPMINU segment - [Set Rail Bond Qualifier]
The system sets the bond qualifier → The rail bond qualifier should be assigned to the SHIPMINU segment - [Update Bond Control Numbers]
The system processes bond control information → The bond control numbers should be updated in the segment for proper tracking and identification - [Create Broker Information Segments]
Broker data exists for the shipment → Additional broker information segments should be created to store broker-related bond data - [Write U2 Segments]
The system needs to persist broker data → U2 segments containing broker information should be written to the appropriate data store - [Complete Bond Update]
The bond update process reaches completion → The system should finalize all bond data updates and mark the process as complete - [Backup Existing Manifest Data]
The system is ready to apply changes to the manifest → The system backs up the current manifest data from GCSUSRT segments before making modifications - [Update Bond Data]
The system processes bond data updates → The system updates bond data fields in the manifest using information from SHIPMINU bond data segments - [Clean Up A2 Segments]
The system performs A2 segment cleanup → The system removes or updates A2 segments in GCSA2RT as required for the manifest update - [Preserve Record Types 07, 09, 15]
The system encounters record types 07, 09, or 15 → The system preserves these record types and does not delete them during the cleanup process - [Remove Related B1 Segments]
The system processes B1 segment removal → The system removes related B1 segments from GCSB1RT that are associated with the manifest update - [Update Special Manifest Data]
The system processes special manifest data updates → The system updates special manifest data fields in the manifest record - [Complete Segment Updates]
The system finalizes the update process → The system completes all segment updates, commits changes to GCSUSRT and related segments, and finalizes the manifest update process - [Backup Current CCN Data]
The system prepares to transfer data to the new CCN → The system backs up all current CCN-related data including manifest segments and historical references - [Update Manifest Segments]
The system updates manifest-specific segments → All manifest segments including A2, B1, and other related segments are updated with the new CCN key - [Preserve Historical Links]
The system preserves historical connections → A historical link is maintained between old and new CCN for audit trail and future reference while ensuring data integrity - [Spawn GCT1081E Message]
The system initiates the broker notification process → The system spawns GCT1081E transaction with appropriate parameters to handle the broker notification delivery - [More A2 Segments to Process?]
The system checks for remaining A2 segments to process → The system continues processing if more segments exist or proceeds to B1 segment cleanup if no more A2 segments remain - [Record Type is '07', '09', or '15'?]
The A2 segment has a record type of '07', '09', or '15' → The system preserves the A2 segment and does not delete it - [Extract N9*2K Reference Numbers]
The system processes the A2 segment for deletion → The system extracts any N9*2K reference numbers from the segment before proceeding with deletion - [Delete A2 Segment]
The system processes the segment for cleanup → The system deletes the A2 segment from the database - [More B1 Segments Related to CCN?]
The system checks for remaining B1 segments related to the CCN → The system continues processing if more related segments exist or completes cleanup if no more segments remain - [Delete B1 Segment]
The system processes the B1 segment for cleanup → The system deletes the B1 segment from the database - [Preserve B1 Segment]
The system processes the B1 segment for cleanup → The system preserves the B1 segment and does not delete it - [Set Up Communication Parameters]
Communication parameters need to be established → System sets up communication parameters using CCISCOM/ISCCCOM data sources - [Call GCCCS417 Program]
EDI 417 transmission is required → System calls GCCCS417 program to process the EDI 417 message - [Set SW-417-SENT Flag]
Transmission validation confirms success → System sets SW-417-SENT flag to indicate successful transmission - [EDI 417 Message Sent to External Systems]
EDI 417 transmission is complete → System confirms EDI 417 message has been sent to external systems - [Bond Data Creation - SHIPMINU Segments]
Bond data creation is triggered → The system should create SHIPMINU segments with appropriate bond information for the shipment - [EDI Transmission Processing]
EDI transmission processing is initiated AND idler indicator is not present AND M12 does not exist → The system should route export cargo, US-Canada-US transit, and multi-transit to GCCS309E, while routing all other cargo types to standard GCCS309 - [Extract EDI CCN]
The manifest creation process requires a CCN → The system should extract and use the CCN from the N9 CUB EDI data - [Reject Override Invalid Format]
The system processes the format validation failure → The CCN override is rejected with an invalid format error message - [Reject Override Invalid SCAC]
The system processes the SCAC validation failure → The CCN override is rejected with an invalid SCAC error message - [Reject Override Duplicate CCN]
The system processes the duplicate CCN detection → The CCN override is rejected with a duplicate CCN error message - [Reject Override CPRS Not Allowed]
The system processes the CPRS CCN restriction → The CCN override is rejected with a CPRS not allowed error message - [Search EBSBCCR Segments]
The system searches EBSBCCR segments up to 998 iterations → Each segment is retrieved and checked for N9 reference data - [Extract N9 Reference Qualifier]
The system extracts N9 reference data → The reference qualifier is copied to working storage for evaluation - [Qualifier = CUB?]
If the qualifier value → Processing continues only if qualifier equals 'CUB', 'ZZZ', or 'ZZ ' - [Search EBSBCCX Segments]
The system searches EBSBCCX segments up to 98 iterations → Each EBSBCCX segment is retrieved and checked for REF reference data - [Extract REF Reference Qualifier]
The system extracts REF reference data → The reference qualifier is copied to working storage for CUB evaluation - [Continue Search Next Segment]
The system continues segment iteration → Segment counter is incremented and next segment is accessed - [More Segments?]
The system checks for more segments → Search continues if within iteration limits (998 for EBSBCCR, 98 for EBSBCCX) - [CCN Extraction Complete]
The system completes CCN extraction process → Extraction status is set and control returns to calling process - [No CCN Found]
No valid CUB qualifier or CCN is found → No CCN found flag is set and processing continues without EDI CCN - [Build Search Key with EDI BOL Key + CR + Sequence]
The system needs to retrieve a specific EBSBCCR segment → The search key is constructed by concatenating the EDI BOL key with 'CR' and the current sequence number - [Retrieve EBSBCCR Segment]
The system performs a segment retrieval operation → The system attempts to read the EBSBCCR segment from the EDI BOL data source - [Extract N9 Reference Qualifier]
The system processes the segment data → The N9 reference qualifier is extracted from the segment for further validation - [Extract Reference Number]
The system processes the CUB-qualified segment → The reference number is extracted from the segment for CCN processing - [Set CCN Found Flag]
The system completes the reference number extraction → The CCN found flag is set to indicate successful CUB discovery and the search process terminates - [Increment Sequence Counter]
The system needs to continue searching additional segments → The sequence counter is incremented by 1 to target the next sequential segment - [Set CCN Not Found Flag]
The system concludes the search process → The CCN not found flag is set to indicate unsuccessful CUB discovery - [Set Search Key CR001+RF]
The system needs to search for extension segments containing reference numbers → The search key is constructed using the EDI BOL key with CR001 dependent key and RF type identifier - [Execute Database Get]
The system executes database retrieval for EBSBCCX segment → Database access is performed using the complete search key to locate extension segment - [EBSBCCX Found?]
If the retrieval result → If segment exists, processing continues to extract reference data; if not found, search termination flag is set - [Extract REF Qualifier]
The system processes the segment data to extract reference information → The REF qualifier is copied from the segment to working storage for further processing - [Extract Reference Number]
The system continues processing the segment data → The reference number is copied from the segment to working storage for CCN validation - [Set Found Flag]
The system completes processing of the current segment → The found status flag WS-EBSBCCX-FOUND is set to indicate successful retrieval - [Increment Sequence]
The system prepares to search for additional segments → The sequence counter WS-SUB-CX is incremented to access the next segment in sequence - [More Segments?]
The system determines whether to continue searching for more segments → If sequence counter is within the limit of 98 iterations, search continues; otherwise search terminates - [Set Not Found Flag]
The system processes the unsuccessful retrieval result → The not found status flag WS-EBSBCCX-NOT-FOUND is set to indicate no segment was located - [Retrieve M12 In-Bond Segments from EDI]
The system retrieves M12 in-bond segments from EDI BOL data → M12 segments should be successfully retrieved from the EDI data source - [M12 Segments Found?]
The system checks for the presence of M12 segments → If M12 segments are found, proceed with entry number validation, otherwise set M12 creation flag to NO - [Set M12 Creation Flag = YES]
All M12 validation criteria are met → The M12 creation flag should be set to YES to enable M12 manifest creation - [Set M12 Creation Flag = NO]
Any M12 validation criteria fails → The M12 creation flag should be set to NO to prevent M12 manifest creation - [Car Matches EDI?]
The matching results are evaluated → The system determines if the car matches EDI records or represents a mismatch requiring error handling - [Add Car to Associated List]
The car is confirmed as valid for the shipment → The car is added to the associated car list for the bunch bill processing - [Retrieve Equipment Number from EDI BOL]
Equipment validation process is initiated → Equipment number is retrieved from EDI BOL data source - [Call GCJSTNUM Utility for Standardization]
Equipment standardization is required for validation → GCJSTNUM utility is invoked to standardize equipment number formats - [Check if Canadian Container Equipment]
Equipment type classification is performed → System determines if equipment is Canadian container based on equipment characteristics - [Retrieve Waybill Equipment Number]
The system needs to validate equipment against EDI BOL data → The waybill equipment number is retrieved from SHIPROOT for comparison - [Retrieve EDI BOL Equipment Number]
The system needs to validate equipment against waybill data → The EDI BOL equipment number is retrieved from the appropriate EDI segment for comparison - [Standardize Waybill Equipment Number using GCJSTNUM]
The equipment number needs to be compared with EDI BOL data → The waybill equipment number is standardized using GCJSTNUM formatting rules - [Standardize EDI Equipment Number using GCJSTNUM]
The equipment number needs to be compared with waybill data → The EDI equipment number is standardized using GCJSTNUM formatting rules - [Equipment Numbers Match?]
The system performs equipment validation → If the standardized equipment numbers match exactly, proceed to car initial validation, otherwise mark EDI BOL as invalid - [Extract Car Initials from Both Sources]
Additional validation is required → Car initials are extracted from both waybill and EDI BOL equipment data for comparison - [Car Initials Match?]
Final equipment validation is performed → If car initials match, set valid EDI BOL flag, otherwise log equipment mismatch and set invalid EDI BOL flag - [Set Valid EDI BOL Flag]
Equipment validation is completed successfully → The valid EDI BOL flag is set to indicate successful equipment validation - [Log Equipment Mismatch]
Equipment validation detects a mismatch → An equipment mismatch is logged for audit and troubleshooting purposes - [Set Invalid EDI BOL Flag]
Equipment validation fails → The invalid EDI BOL flag is set to prevent further processing with mismatched equipment data - [Spawn GCT1131E Message]
The system is ready to initiate bunch bill creation → The system spawns the GCT1131E message to process the bunch bill for the multi-car shipment - [Reject - Duplicate EDI CCN]
If the duplicate EDI CCN for manifest creation → The system rejects the manifest creation and returns an error indicating the duplicate EDI CCN cannot be used - [Set CCN for Manifest]
The manifest record is being finalized for creation → The validated CCN is stored in the GCSUSRT manifest segment as the official CCN for the shipment - [Empty Bond Type?]
The bond type field is empty or contains spaces → The system skips SHIPMINU segment creation and proceeds to end processing - [Automated US-Canada-US Crossing?]
The crossing is identified as an automated US-Canada-US transit → The system skips SHIPMINU segment creation and proceeds to end processing - [Map In-Bond Type Codes]
The system processes the bond type for SHIPMINU segment creation → The bond type code is mapped using GCSUSS99 in-bond type arrays to determine the appropriate internal code - [Create SHIPMINU Segment]
The system needs to store bond information → A new SHIPMINU segment is created with the mapped bond type and related shipment data - [Set Bond Information]
The system sets bond information fields → The segment is populated with bond type, shipment identifiers, and other required bond processing data - [Broker Data Exists?]
Valid broker data exists for the shipment → Additional broker information segments are created using broker table configuration data - [Write SHIPMINU to Fastway System]
The system needs to persist the bond data → The SHIPMINU segment is written to the Fastway system database for downstream processing - [Access GCSUSS99 Array Structure]
The system processes bond segment creation → The system accesses the GCSUSS99 array to retrieve the mapping structure for in-bond type conversion - [Set Mapped In-Bond Type for Bond Segment]
The system creates the bond segment data → The system sets the final in-bond type code in the bond segment structure for further processing - [Map Broker Data to U2 Segment Format]
The system maps the broker data to U2 segment format → Broker fields are formatted according to U2 segment specifications with proper field positioning and data types - [Create U2 Segment with Broker Information]
The system creates the U2 segment → A new U2 segment record is generated with all broker information properly populated - [Store U2 Segment in SHIPMINU]
The system stores the U2 segment in SHIPMINU → The U2 segment is successfully written to the SHIPMINU database and associated with the correct waybill - [Set Broker Information Created Flag]
The system sets the broker information created flag → A flag is set to indicate broker information processing is complete and prevent duplicate processing - [Process CCN Override]
The system checks for CCN override availability → The system uses the provided override CCN and skips EDI BOL CCN extraction - [Extract CCN from EDI BOL]
The system processes EDI BOL segments for N9 CUB reference numbers → The system extracts and validates the CCN from the EDI BOL data - [Set Master-Follower Relationship]
The system establishes CCN relationships → The system links follower CCNs to the master CCN and updates the manifest segments - [M12 Segments Found?]
No M12 segments are found in the EDI data → The system skips M12 processing and continues with standard manifest creation - [Create Bond Information Segments]
The system creates bond information segments → The system generates appropriate bond segments containing validated shipper or rail bond information - [Skip M12 Processing]
The system determines M12 processing is not applicable → The system skips all M12-specific validation and processing steps - [Create Detour Manifest Segments]
The system creates manifest segments → All required detour manifest segments are created with appropriate detour data - [Update Manifest Status]
The system updates manifest status → Manifest status is updated to indicate successful detour processing - [Send EDI Notifications]
The system sends EDI notifications → EDI notifications are sent to relevant parties about the detour manifest processing - [Log Detour Processing Results]
The system logs processing results → Detour processing results are logged with appropriate details for audit trail - [Retrieve Broker Configuration from BK Table]
The system needs broker configuration data → The BK table segment is retrieved using the broker key to obtain notification preferences - [Read B1 Table Segments for Preferences]
The system needs to determine notification method preferences → B1 table segments are read to identify Merlin, Internet, and Fax notification preferences - [Spawn GCT1081E Message for Merlin]
The system processes Merlin notification → GCT1081E transaction is spawned with Merlin-specific parameters to deliver the broker notification - [Spawn GCT1081E Message for Internet]
The system processes Internet notification → GCT1081E transaction is spawned with Internet-specific parameters to deliver the broker notification - [Spawn GCT1081E Message for Fax]
The system processes Fax notification → GCT1081E transaction is spawned with Fax-specific parameters to deliver the broker notification - [Read BK Table Segment for Broker]
The system attempts to read the BK table segment for the specified broker → The broker's basic information is retrieved from the BK table if the broker exists - [Extract Broker Basic Information]
The system processes the BK segment data → The broker's basic information is extracted and made available for further processing - [Read B1 Table Segment for Notification Preferences]
The system attempts to read the B1 table segment for notification preferences → The broker's notification preferences are retrieved from the B1 table if available - [Extract Notification Method Preferences]
The system processes the B1 segment data → The broker's notification method preferences are extracted and made available for evaluation - [Merlin Notification Enabled?]
If the Merlin notification setting → The system determines if Merlin notification is enabled for this broker - [Internet Notification Enabled?]
If the Internet notification setting → The system determines if Internet notification is enabled for this broker - [Fax Notification Enabled?]
If the Fax notification setting → The system determines if Fax notification is enabled for this broker - [Use Default Notification Settings]
The system needs to determine notification methods for the broker → Default notification settings are applied to ensure the broker can still receive notifications - [Log Broker Not Found]
The BK table segment cannot be found for the specified broker → An error is logged indicating that the broker was not found in the system - [Read Broker Configuration from BK Table Segments]
The system needs to retrieve broker configuration information → The system reads broker configuration from BK table segments and sets broker data availability flags - [Retrieve Broker Contact Information from B1 Table Segments]
The system needs broker contact details for notifications → The system retrieves broker contact information from B1 table segments - [Retrieve Waybill Special Handling Instructions]
The system needs to parse broker information → Special handling instructions are retrieved from SHIPROOT waybill data - [Parse Broker Name Components]
The system parses the broker information → Individual broker name components are identified and separated - [Standardize Broker Name Format]
The system standardizes the broker name format → Broker name is formatted according to system standards - [Read Broker Configuration from BK Table Segment]
The system attempts to read the BK table segment for the broker → The broker configuration data is retrieved and made available for processing - [Read B1 Table Segment for Additional Settings]
The system attempts to read the B1 table segment for additional notification settings → The B1 table segment data is retrieved for notification preference extraction - [Extract Merlin Notification Setting]
The system extracts the Merlin notification setting → The Merlin notification preference is captured and stored for use in notification processing - [Set Default Notification Methods]
The system needs to establish notification preferences → Default notification methods are set to ensure notification processing can continue - [Store Notification Preferences]
The system stores the notification preferences → The notification preferences are available for use in determining how to notify the broker - [Spawn GCT1081E Message for Merlin Channel]
The system processes Merlin channel notifications → The system spawns a GCT1081E message specifically configured for Merlin channel delivery - [Spawn GCT1081E Message for Internet Channel]
The system processes Internet channel notifications → The system spawns a GCT1081E message specifically configured for Internet channel delivery - [Spawn GCT1081E Message for Fax Channel]
The system processes Fax channel notifications → The system spawns a GCT1081E message specifically configured for Fax channel delivery - [Retrieve Broker Preferences from B1 Table]
The system needs specific notification method preferences → The system retrieves broker preferences from B1 table segment to determine available notification methods - [Read B1 Table Segments for Preferences]
The system processes broker notification requirements → The system reads B1 table segments to retrieve notification preferences - [Broker Change Detected?]
If broker change status → If a broker change is detected, handle broker deletion notification, otherwise proceed to spawn messages - [Spawn GCT1081E Message for Each Channel]
The system finalizes notification processing → The system spawns GCT1081E messages for each enabled notification channel - [Complete Multi-Channel Notification]
The multi-channel notification process reaches completion → The system completes the multi-channel notification process - [Set Success Status]
The processing completed successfully without any errors or validation failures → The system sets the message status to 'SUCCESS' to indicate successful completion - [Include CCN Information]
The system is assembling the log message content → The system includes the CCN information in the log message for identification and traceability purposes - [Include Bond Type Information]
The system is assembling the log message content and bond type information is available → The system includes the bond type information in the log message to provide complete processing context - [Include Transfer Log Details]
The system is preparing the log message for the transfer event → The system includes detailed transfer information including source CCN, target CCN, and transfer reason in the log message - [Spawn GCT1051E Message]
The system needs to record the processing event → The system spawns the GCT1051E transaction with the prepared log message to record the event in the system log - [Spawn GCT0111E Message]
The system needs to transmit the manifest information → A GCT0111E message should be spawned to communicate the Canada return manifest data - [Set Canada Manifest Indicators]
The system finalizes the Canada manifest processing → Canada manifest indicators should be set to prevent duplicate processing and track completion status - [Spawn Canada Manifest Creation Message]
The system initiates Canada manifest creation → GCT0111E transaction is spawned with the Canada CCN for manifest creation - [Set Canada Processing Complete Flag]
The system completes Canada processing → Canada processing complete flag is set to prevent duplicate processing - [Check Manifest Type]
If the manifest type (Export M1109, US-Canada-US M1201, Multi-Transit, or other) → The system routes to the specialized GCCS309E handler for export/transit manifests or standard GCCS309 handler for all other manifest types - [Route to GCCS309E Specialized Export Handler]
The EDI 309 transmission is initiated → The system calls the GCCS309E program for specialized export manifest processing - [Route to GCCS309 Standard Handler]
The EDI 309 transmission is initiated → The system calls the GCCS309 program for standard manifest processing - [Retrieve CW Control Table]
The control table management process is initiated → The CW control table segment is retrieved to access current sequence and date information - [Replace CW Table Segment]
The control table needs to be updated with current values → The CW table segment is replaced with the updated sequence and date information - [Retrieve CW Control Table]
The workstation database ID update process is initiated → The system retrieves the current CW control table values containing existing sequence and date information - [Return to Summary Screen]
The processing originated from EDI billing (COMING-FROM-EDI-BILLING flag is set) → The system should set the output selection code to return to the summary screen interface - [Return to Fastway Screen]
The processing type is not diversion, more processing, or EDI billing → The system should set the output selection code to return to the standard Fastway screen interface - [Log FEN Status Information]
The system processes Laredo location manifest with valid despacho data → FEN message is logged using 'ZZZ' log code via GCT1051E transaction - [Log KCM Status Information]
The system processes Laredo location manifest with valid Mexican CCN → KCM message is logged using 'ZZZ' log code via GCT1051E transaction - [Check Transaction Code]
The transaction code is GCT1111E → The system identifies the message as spawned from Fastway and sets the Fastway spawned indicator - [Set FC Driver Type Fastway Create]
The action code indicates a create operation (FC) → The system sets the FC driver type indicator for Fastway create processing - [Set FU Driver Type Fastway Update]
The action code indicates an update operation (FU) → The system sets the FU driver type indicator for Fastway update processing - [Set ZC Driver Type Fastway Background Create]
The action code indicates a background create operation (ZC) → The system sets the ZC driver type indicator for Fastway background create processing - [Set ZD Driver Type Fastway Background Delete]
The action code indicates a background delete operation (ZD) → The system sets the ZD driver type indicator for Fastway background delete processing - [Extract Diversion Parameters]
The system processes the diversion message parameters → Waybill key, new location codes, and diversion action type are extracted and stored for processing - [Call GCJSTNUM Utility for EDI Equipment]
The system calls GCJSTNUM utility to standardize the EDI equipment number → The EDI equipment number is converted to standardized format for comparison purposes - [Set Equipment Validation Success Flag]
The equipment numbers match exactly → The system sets the equipment validation success flag to indicate valid equipment match - [Set Equipment Validation Failure Flag]
Either standardization fails:- the standardized equipment numbers do not match
- [Search EDI BOL for M12 Segments]
The system searches for M12 segment data in EBSBCCR and EBSBCCX → All M12 segments are identified and retrieved for validation - [Retrieve CW Control Table]
The CW control table retrieval is initiated → The system should successfully retrieve the CW table segment containing Julian date and sequence information - [Get System Julian Date]
System Julian date retrieval is performed → The system should obtain the current Julian date and convert it to the required format for message sequencing - [Date Changed?]
The system compares the Julian dates → The system should identify if the Julian date has changed since the last message processing - [Increment Sequence Number]
Sequence increment processing is performed → The system should increment the existing sequence number by 1 to maintain sequential message numbering - [Generate Workstation Database ID]
Workstation database ID generation is performed → The system should create a unique identifier by combining the Julian date and sequence number for message tracking - [Update CW Control Table]
CW control table update is performed → The system should replace the existing CW table segment with updated Julian date and sequence information - [Store Message with Database ID]
Message storage is performed → The system should store the Fastway I/O message with the unique database identifier for later foreground processing access - [Access EDI BOL Segments]
The system needs to access M12 in-bond segments → The system retrieves EDI BOL segments from EBSBCCR and EBSBCCX data sources - [Search for M12 In-Bond Type Segments]
The system searches for M12 in-bond type segments → The system identifies and extracts M12 segments from the EDI data - [Extract Sequence Number]
The system processes M12 segments → The system extracts the sequence number from each M12 segment - [Sequence Number = 01?]
The sequence number equals 01 → The system proceeds to validate entry number and location identifier for sequence 01 - [Sequence Number = 02?]
The sequence number equals 02 → The system proceeds to validate entry number and location identifier for sequence 02 - [More M12 Segments?]
There are more M12 segments to process → The system continues processing the next M12 segment - [Both Sequences 01 and 02 Valid?]
Both sequence 01 and sequence 02 are marked as valid → The system sets M12 in-bond validation as complete - [Set M12 In-Bond Validation Failed]
Either no M12 segments are found or both sequences 01 and 02 are not valid → The system sets M12 in-bond validation status as failed - [Retrieve CW Control Table]
The system needs to retrieve current control information → The CW control table is accessed to get current sequence number and date information - [Store Message with Database ID]
The system stores the message → The message is stored in the workstation database with the assigned unique database ID - [Database Cleanup]
The system processes the update successfully → The system removes A2 segments selectively and removes related B1 segments to maintain data integrity - [EDI 417 Transmission]
The system determines the update cannot be processed → The system sends EDI 417 error transmission to notify external systems of the failed update - [Send EDI 417 Status Message]
Recreation processing is complete → An EDI 417 status message is sent to notify relevant parties of the recreation result - [Log Recreation Result]
Recreation processing concludes → The recreation result is logged with appropriate details for audit trail - [Update Waybill Key in All Segments]
The system updates the waybill key → The system should update the waybill key in all related manifest segments including main record and dependent segments - [Transfer CCN Logs to New Key]
The system processes CCN log transfer → The system should transfer all existing CCN logs and audit records to reference the new waybill key - [Update Related B1 Segments]
The system updates B1 segments → The system should update all B1 customs segments to reference the new waybill key - [Update SHIPMINU Bond Segments]
The system updates bond segments → The system should update all SHIPMINU bond segments to reference the new waybill key - [Check Broker Information Changes]
The system checks for broker changes → The system should compare old and new broker information to determine if notification is required - [Send EDI 417 Status Message]
The system sends EDI status message → The system should send EDI 417 message to notify external systems of the permanent waybill key change - [Log Permanent Change Result]
The system logs the permanent change → The system should create a comprehensive audit log entry documenting all aspects of the permanent waybill key change - [Retrieve Current Waybill Data]
The system retrieves current waybill data → The system accesses SHIPROOT and SHIPCOMM segments to get current location and routing information - [Generate Diversion Notifications]
The system generates diversion notifications → The system sends EDI 309 messages for valid ports and sends broker notifications if broker information has changed - [Backup Existing Manifest Data]
The system begins the update process → The system creates a backup copy of all existing manifest data including primary segments, A2 segments, B1 segments, and bond data before making any modifications - [Identify Related Manifest Segments]
The system searches for related manifest data → The system identifies and retrieves all related manifest segments including US manifest segments (GCSUSRT), A2 segments (GCSA2RT), B1 segments (GCSB1RT), bond data (SHIPMINU), and communication data (SHIPCOMM) - [Update Primary Manifest Segment]
The system updates the primary manifest segment → The system replaces the old waybill key with the new waybill key in the GCSUSRT segment while maintaining all other manifest information intact - [Update A2 Segments]
The system processes A2 segment updates → The system updates all related A2 segments (GCSA2RT) with the new waybill key reference while preserving segment-specific data - [Update B1 Segments]
The system processes B1 segment updates → The system updates all related B1 segments (GCSB1RT) with the new waybill key reference while maintaining segment-specific information - [Update Bond Data Segments]
The system processes bond data updates → The system updates the bond data segments (SHIPMINU) with the new waybill key information while preserving bond-specific details - [Delete Lead Manifest Segments]
The system processes the deletion of lead manifest data → All lead manifest segments are removed from the database including primary records and related data segments - [Delete Related Car Manifests]
The system processes deletion of each related car manifest → All related car manifest segments are removed from the database maintaining referential integrity - [Update Manifest Status]
The system updates status tracking records → Manifest status is updated to reflect deletion and any dependent systems are notified of the status change - [Send EDI Delete Transactions]
The system prepares EDI delete transactions for each deleted manifest → EDI delete messages are transmitted to customs authorities and other relevant external systems - [Remove A2 Segments]
The system identifies A2 segments linked to the deleted manifests → All A2 segments are removed from the database as part of the cleanup process - [Remove B1 Segments]
The system identifies B1 segments linked to the deleted manifests → All B1 segments are removed from the database as part of the cleanup process - [Update GCSUSRT Status]
The system updates the GCSUSRT primary record → The GCSUSRT record status is updated to indicate deletion or the record is removed entirely - [Retrieve Related Car Manifests]
The system retrieves related car manifests → All associated car manifests linked to the lead manifest are retrieved from GCSUSRT segments - [Delete Lead Manifest]
The system deletes the lead manifest → The lead manifest record is removed from GCSUSRT segments - [Delete Related Car Manifests]
The system deletes related car manifests → All associated car manifest records are removed from GCSUSRT segments - [Update Multi-Car Relationships]
The system updates multi-car relationships → Related A2 and B1 segments are deleted from GCSA2RT and GCSB1RT to maintain data integrity - [Send EDI Delete Transactions]
The system sends EDI delete transactions → EDI delete notifications are transmitted to inform external systems of the manifest deletions - [Export Manifest M1109/M1201/Multi-Transit]
The manifest type is export (M1109):- US-Canada-US transit (M1201)
- multi-transit (M1201)
- [Standard Manifest Other Types]
The manifest type is NOT export (M1109) AND NOT US-Canada-US transit (M1201) AND NOT multi-transit (M1201) → The system uses standard GCCS309 program for processing - [Send EDI 309 Delete Transaction]
The EDI 309 delete transmission is executed → The system calls the selected EDI program (GCCS309E or GCCS309) to send the delete transaction - [Backup Current Manifest Data]
The system prepares to modify manifest data → The system creates a backup copy of current manifest segments for recovery purposes - [Update Manifest with New Car Information]
The system processes new car information for duplication → The system updates manifest segments with new car details while preserving original manifest structure - [Send EDI Transmissions]
The system processes EDI transmission requirements → The system sends appropriate EDI messages for the duplicated manifest entries - [Log Processing Results]
The system finalizes MORE duplication processing → The system creates audit logs documenting the duplication results and processing status - [Parse Broker Name and Details]
The system processes broker notification requirements → The system must check broker preferences for Merlin, Internet, or Fax delivery methods and send accordingly - [Skip EDI Transmission for Idler]
The system reaches the EDI transmission step → EDI transmission is skipped for idler car records to prevent standard manifest transmission - [Spawn GCT1131E Message for Car]
The system spawns the car update message → A GCT1131E message is queued for background processing of the car update - [Log Car Update Success]
The system logs the success → A success entry is recorded for the car update operation - [Retrieve Related Car Manifests]
The system processes the deletion coordination → The system retrieves all related car manifest records from GCSUSRT manifest segments - [Delete Lead Manifest]
The system processes the lead manifest deletion → The system deletes the lead manifest record from GCSUSRT manifest segments - [Delete Related Car Manifests]
The system processes related car manifest deletions → The system deletes all related car manifest records from GCSUSRT manifest segments - [Update Manifest Status]
The system updates the manifest status → The system updates status information in GCSA2RT A2 segments and GCSB1RT B1 segments - [Send EDI Delete Transactions]
The system processes EDI notifications → The system sends EDI delete transactions for all deleted car manifests - [Log Deletion Results]
The system completes the deletion process → The system logs the deletion results for all processed car manifests - [Is Manifest Released?]
The manifest status indicates it has been released to customs authorities → The deletion request must be rejected with an appropriate business error message - [Are Broker Entries Filed?]
Broker entries have been filed with customs authorities for this manifest → The deletion request must be rejected with an appropriate business error message - [Send EDI 309 Delete Transactions]
The system needs to notify external systems of the deletion → EDI 309 delete transactions must be sent to appropriate trading partners and customs systems - [Update Manifest Status]
The system finalizes the deletion process → The manifest status must be updated to indicate successful deletion and prevent future processing - [Delete Lead Manifest Segments]
The system processes the lead manifest deletion → The lead manifest segments must be deleted from the system - [Delete Related Car Manifest Segments]
The system continues processing the deletion → All related car manifest segments must be deleted from the system - [Remove GCSUSRT Segments]
The system processes database cleanup → All GCSUSRT (US Customs manifest) segments must be removed from the database - [Remove GCSA2RT Segments]
The system continues database cleanup → All GCSA2RT (A2 type) segments must be removed from the database - [Remove GCSB1RT Segments]
The system continues database cleanup → All GCSB1RT (B1 type) segments must be removed from the database - [Send EDI 309 Delete Transaction]
The system processes external notifications → An EDI 309 delete transaction must be sent to notify external systems of the manifest deletion - [Update Manifest Status]
The system finalizes the deletion process → The manifest status must be updated to indicate successful deletion - [Search for Multi-Car Shipment Records]
The system searches for related multi-car shipment records → All manifest records with matching shipment identifiers are retrieved from GCSUSRT segments - [Query Manifest Database]
The system queries the manifest database → Database is searched using GCSUSRT manifest segments for related car sequences - [Retrieve Related Car Sequences]
The system retrieves related car sequences → All associated car records are retrieved from GCSUSRT manifest segments - [Retrieve Lead Manifest CCN]
The system needs to identify the lead manifest → The system should retrieve the CCN of the lead manifest from the manifest segments - [Lead Manifest Exists?]
The system checks for lead manifest existence → The system should confirm the lead manifest record exists in the manifest segments - [Delete GCSUSRT Root Segment]
A manifest deletion request is processed → The GCSUSRT root segment is removed from the database - [Delete All GCSA2RT Segments]
A manifest deletion request is processed → All GCSA2RT detail segments related to the manifest are removed from the database - [Delete All GCSB1RT Segments]
A manifest deletion request is processed → All GCSB1RT additional information segments related to the manifest are removed from the database - [Update Deletion Status]
The deletion process is completed → The system updates the deletion status to reflect successful completion - [Manifest Type Check]
If the manifest type (Export M1109, US-Canada-US M1201, Multi-Transit, or Standard) → The system routes Export, US-Canada-US, and Multi-Transit manifests to GCCS309E handler and Standard manifests to GCCS309 handler - [Set EDI Action Code to DELETE]
The system prepares the EDI 309 message → The system sets the EDI action code to DELETE to indicate the type of operation - [Route to GCCS309E Export Handler]
The system needs to process the EDI 309 delete transaction → The system calls the GCCS309E specialized export handler program - [Route to GCCS309 Standard Handler]
The system needs to process the EDI 309 delete transaction → The system calls the standard GCCS309 handler program - [Send EDI 309 Delete Transaction]
The system processes the delete transaction → The system sends the EDI 309 delete transaction to external systems through the appropriate handler - [Log Transmission Status]
The transmission attempt is completed → The system logs the transmission status for audit and tracking purposes - [Update Manifest Status]
The delete operation is completing → The system updates the manifest status to indicate the delete operation has been processed - [Update Manifest Status to Recreation Mode]
The system begins recreation processing → The manifest status is updated to recreation mode in GCSUSS01 status segments to lock the record for recreation processing - [Process Manifest Recreation]
The system processes the recreation by performing waybill corrector logic → The manifest is recreated using current waybill data while preserving essential customs information and updating segments as needed - [Update Manifest Status to Active]
The recreation process completes successfully → The manifest status is updated to active in GCSUSS01 status segments to make it available for normal processing - [Send Status Confirmation to US Customs]
The recreation process is complete and status is updated → A confirmation message is sent to US Customs with recreation success status and updated manifest information - [Update GCSUSRT Segments]
The system finalizes the detour processing → The GCSUSRT segments are updated with detour manifest information and current status - [Update Manifest Segments]
Manifest segments need to be updated → The system updates all relevant manifest segments with the CCN relationship data - [Search EBSBCCR Segments]
The system searches for N9 reference numbers in EBSBCCR segments up to 998 iterations → The system should find and extract N9 reference numbers with CUB qualifier if they exist - [Extract CCN from Segment]
The system extracts the reference number value → The CCN should be copied to working storage for further validation - [Search EBSBCCX Segments]
The system searches EBSBCCX segments up to 98 iterations using 'RF' type and sequence numbers → The system should find and extract reference numbers with CUB qualifier if they exist - [Is CPRS CCN?]
The system determines the SCAC code is 'CPRS' → The system should set CCN extraction as failed because CPRS CCNs cannot be processed through EDI - [Set CCN Extraction Failed]
The system encounters a validation failure → The system should set the CCN extraction failed flag and continue manifest creation without EDI CCN - [Search EBSBCCR Segments]
The system searches for EBSBCCR segments using the EDI BOL key with CR sequence numbers → EBSBCCR segments are retrieved if they exist in the database - [Extract N9 Reference Qualifier]
The system extracts the N9 reference qualifier from the segment → The qualifier value is available for CUB validation - [Search EBSBCCX Segments]
The system searches EBSBCCX segments using EDI BOL key with CR001 dependent key and RF type → EBSBCCX segments are retrieved if they exist in the database - [Extract REF Reference Qualifier]
The system extracts the REF reference qualifier from the segment → The qualifier value is available for CUB validation - [Set CCN Found Flag]
The CCN passes all format and SCAC validations → The CCN found flag is set to true and the CCN value is stored for further processing - [Continue Search Loop]
More segments are available for processing → The search continues with the next available segment - [No CCN Found]
No valid CUB reference or CCN is found in any segment → The process completes without a CCN and customs processing continues without EDI BOL CCN data - [Retrieve EBSBCCR Segment with Current Sequence]
The system attempts to retrieve an EBSBCCR segment using the current sequence number → The system accesses the EBSBCCR segment data from the EDI BOL source - [Extract N9 Reference Qualifier]
The system processes the segment data → The N9 reference qualifier is extracted from the segment for further evaluation - [Qualifier = 'CUB'?]
If the qualifier value → The system proceeds with CCN extraction if the qualifier equals 'CUB', otherwise continues to the next segment - [Extract Reference Number as CCN]
The system processes the CUB-qualified reference → The reference number is extracted and treated as the Customs Control Number (CCN) - [Set EBSBCCR Found Flag]
The extraction process completes successfully → The EBSBCCR found flag is set to indicate successful completion of the search - [Increment Sequence Counter]
The system needs to continue searching → The sequence counter is incremented by 1 to search the next segment - [Set EBSBCCR Not Found Flag]
The sequence counter exceeds the maximum limit of 998 → The EBSBCCR not found flag is set to indicate that no valid CUB reference was located - [Set Initial Search Key CR001 + RF Type]
The system begins searching for EBSBCCX extension segments → The search key is constructed with CR001 segment identifier and RF reference type - [Execute Database Get for EBSBCCX Segment]
The system executes a database retrieval operation → The system attempts to locate and retrieve the corresponding EBSBCCX segment - [Extract Reference Number Qualifier from Segment]
The system processes the segment data → The reference number and qualifier fields are extracted and made available for further processing - [Extract Reference Number as CCN Candidate]
The system processes the reference number field → The reference number is extracted and treated as a CCN candidate for customs processing - [Set Found Flag SW-EBSBCCX-FOUND]
The system completes the extraction process → The SW-EBSBCCX-FOUND flag is set to indicate successful CCN extraction - [Set Not Found Flag SW-EBSBCCX-NOT-FOUND]
The system determines no segment exists for the search key → The SW-EBSBCCX-NOT-FOUND flag is set to indicate unsuccessful retrieval - [Increment Sequence Number for Next Search]
The system prepares for the next iteration → The sequence number is incremented to construct the next search key - [More Segments to Process?]
If continuation criteria → The system determines if more segments exist within the allowable search range - [Read SS Table Segment]
The system performs SCAC validation → The SS table segment is accessed using the SCAC code as the key - [Set Origin as 'ORD EDI ' - Order Entry 404]
The creation signon is 'ORD EDI ' → The system sets the origin classification as 'ORD EDI ' for Order Entry 404 - [Set Origin as 'EDI ' - Fastway 404]
The origin is from other EDI sources not matching previous categories → The system sets the origin classification as 'EDI ' for Fastway 404 - [Call GCCUSIO to Replace A2 Segments]
The system needs to persist the error information → The system calls GCCUSIO to replace A2 segments with the error data - [Search EBSBCCR Segments for N9*CUB Qualifier]
The system searches EBSBCCR segments for N9 reference numbers with CUB, ZZZ, or ZZ qualifiers → The system iterates through up to 998 EBSBCCR segments and sets found flag when N9*CUB qualifier is located - [Search EBSBCCX Segments for N9*CUB Qualifier]
The system searches EBSBCCX segments for REF reference numbers with CUB, ZZZ, or ZZ qualifiers → The system iterates through up to 98 EBSBCCX segments and sets found flag when N9*CUB qualifier is located - [Extract CCN from EDI Segment]
The system processes the reference number from the EDI segment → The CCN value is extracted from the reference number field for further validation - [Set Valid EDI CCN Flag]
All EDI CCN validation steps have completed successfully → The system sets the valid EDI CCN flag to indicate successful validation and allow continued processing - [Start M12 Flag Processing]
The M12 flag processing starts → Initialize M12 creation flag to default state and prepare for EDI BOL segment validation - [M12 Segments Found?]
M12 segments are not found in the EDI BOL → Set M12 creation flag to NO and skip further M12 validation processing - [Set M12 Creation Flag = NO]
The system sets the M12 creation flag → Set M12 creation flag to NO to indicate M12 manifest should not be created - [Replace GCSUSRT Manifest Segment]
Any status changes have been made to the manifest data → The GCSUSRT manifest segment should be replaced with the updated manifest information - [Status Changes Made?]
If any status changes were made to the manifest → If status changes were made, the GCSUSRT manifest segment should be replaced, otherwise end the status change processing - [Skip EDI for Idler Cars or M12 Manifests?]
The idler indicator is present in the manifest data → EDI transmission processing should be bypassed and the process should end - [Skip EDI for Idler Cars or M12 Manifests?]
M12 manifest data exists for the shipment → EDI transmission processing should be bypassed and the process should end - [Set Preliminary Action Code]
The manifest is new and has not been previously transmitted → The EDI action code should be set to preliminary status - [Set Update Action Code]
The manifest has been previously transmitted and requires modification → The EDI action code should be set to update status - [Send EDI 417 Status Message]
The EDI type determination indicates a 417 message is required → An EDI 417 status message should be transmitted to the appropriate recipients - [Use GCCS309E for Export/Transit Manifests]
The manifest type is export (M1109) → The EDI transmission should be routed to GCCS309E module for specialized export processing - [Use GCCS309E for Export/Transit Manifests]
The manifest type is US-Canada-US transit (M1201) → The EDI transmission should be routed to GCCS309E module for specialized transit processing - [Use GCCS309E for Export/Transit Manifests]
The manifest type is multi-transit (M1201) → The EDI transmission should be routed to GCCS309E module for specialized multi-transit processing - [Use GCCS309 for Standard Manifests]
The manifest type is not export, US-Canada-US transit, or multi-transit → The EDI transmission should be routed to the standard GCCS309 module - [Update GCSUSS01 Electronic Transmission Segments]
The transmission is initiated or completed → The GCSUSS01 electronic transmission segments should be updated with current status and transmission details - [Set EDI Transmission Complete Flag]
The EDI message has been sent to the appropriate module → The EDI transmission complete flag should be set to indicate successful completion - [Determine Data Origin Classification]
If the transaction creation signon to determine data origin → The data origin is classified as Order Entry Manual, Order Entry EDI, Fastway Manual, or Fastway EDI based on the creation signon value - [Set Origin as Order Entry EDI]
The system sets the data origin classification → The data origin is set to Order Entry EDI for the error record - [Set Origin as Fastway EDI]
The system sets the data origin classification → The data origin is set to Fastway EDI for the error record - [Call GCCUSIO to Replace A2 Segments]
The system saves the error information → GCCUSIO is called to replace A2 segments with the collected error data in the database - [Status Changes Made?]
Status changes have been made to the manifest → The GCSUSRT manifest segment should be replaced in the database - [Skip Segment Update]
No status changes have been made to the manifest → The manifest segment update should be skipped - [Map In-Bond Type Codes]
The system begins bond information creation → The system should map the appropriate in-bond type codes from the GCSUSS99 segment arrays based on the shipment's bond requirements - [Create SHIPMINU Segment]
The system proceeds with bond segment creation → The system should create a new SHIPMINU segment with customs shipment values and bond control numbers - [Set Bond Qualifier]
The system sets bond qualifiers for the segment → The system should assign the appropriate bond qualifier codes based on the bond type and processing requirements - [Shipper Bond Required?]
If shipper bond requirements → The system should set shipper bond qualifier if shipper bond is required, otherwise set rail bond qualifier - [Set Rail Bond Qualifier]
The system sets the bond qualifier type → The system should assign rail bond qualifier codes to the SHIPMINU segment - [Set Shipper Bond Qualifier]
The system sets the bond qualifier type → The system should assign shipper bond qualifier codes to the SHIPMINU segment - [Broker Data Exists?]
The system checks for broker data availability → The system should create a broker information segment U2 if valid broker data exists, otherwise proceed to write the bond segment - [Create Broker Information Segment U2]
The system creates broker information segments → The system should create a U2 segment with broker information retrieved from broker tables - [Write Bond Segment to Fastway]
The system finalizes bond information creation → The system should write the bond segment to the Fastway system and complete the bond information creation process - [Read B1 Table Segments for Preferences]
The system processes broker notification requirements → The system reads B1 table segments to determine notification channel preferences - [Determine Notification Channels]
The system processes notification requirements → The system determines which notification channels are required based on broker preferences in B1 segments - [Set Up GCT1131E Message Parameters]
The system prepares to spawn the bunch bill processing message → The system should set up all required GCT1131E message parameters with appropriate values - [Include Waybill Key Information]
The system includes waybill information → The system should include all necessary waybill key information for proper bunch bill processing - [Include CCN Information]
The system includes CCN information → The system should include all necessary CCN information for proper bunch bill coordination - [Set Background Processing Flag]
The system sets processing flags → The system should set the background processing flag to ensure bunch bill processing runs in background mode - [Spawn GCT1131E Message]
The system spawns the GCT1131E message → The system should successfully initiate the bunch bill processing message - [Update Bunch Bill Status]
The system updates bunch bill status → The system should update the bunch bill status to indicate successful processing initiation - [Determine Message Action Code]
The system needs to determine the message action code for logging → The system evaluates the processing context and sets the corresponding message action code - [Log CCN Transfer Information]
The system processes the CCN transfer logging → The system includes both the old CCN and new CCN information in the log message - [Include Bond Type Information]
The system includes additional context information → The system adds bond type information and other relevant manifest details to the log message - [Spawn GCT1051E Message]
The system is ready to log the processing results → The system spawns the GCT1051E transaction with the prepared log message information - [Set Result Message Flags]
The system completes the logging process → The system sets the result message flags to indicate successful logging completion - [Send GCT0111E Message]
The system sends the transaction message → GCT0111E message should be transmitted with the Canada manifest details - [Complete Canada Return Processing]
The system completes Canada return processing → The Canada return manifest processing should be marked as complete - [Retrieve CW Control Table]
The control table sequence management process is initiated → The CW control table segment is retrieved to access current sequence and date information - [Convert Current Date to Julian Format]
The system needs to establish a Julian date for comparison → The current system date is converted to Julian format and stored in the working storage Julian date field - [Update Workstation Database ID]
The workstation database ID needs to be updated → The next Fastway I/O message workstation database ID is updated with the current Julian date and new sequence number - [Replace CW Table Segment with New Values]
The control table needs to be updated with new values → The CW table segment is replaced with the modified control table data containing the new sequence information - [EDI Billing]
The processing is coming from EDI billing → The system should set the return to summary screen - [Other Processing]
The processing type is not diversion, more, or EDI billing → The system should set the return to Fastway screen - [Retrieve CW Control Table]
The CW control table retrieval is initiated → The system should retrieve the CW control table segment containing current sequence information - [Set New Sequence Number]
The sequence management finalization is performed → The new sequence number should be set for subsequent Fastway message processing - [Search EBSBCCR Segments]
The system searches for EBSBCCR segments using EDI BOL key plus CR prefix and sequence number → The system attempts to retrieve the corresponding EBSBCCR segment from the database - [EBSBCCR Segment Found?]
The system checks if the EBSBCCR segment was found → If segment is found, proceed to extract N9 reference data, otherwise set not found flags - [Extract N9 Reference Qualifier]
The system extracts the N9 reference qualifier from the segment → The N9 reference qualifier is copied to working storage for further processing - [Extract N9 Reference Number]
The system extracts the N9 reference number from the segment → The N9 reference number is copied to working storage for customs processing - [Set EBSBCCR Found Flag]
The extraction process completes successfully → The EBSBCCR found flag is set to indicate successful retrieval - [Search EBSBCCX Segments]
The system searches for EBSBCCX segments using CR001 dependent key with RF type and sequence number → The system attempts to retrieve the corresponding EBSBCCX extension segment - [EBSBCCX Segment Found?]
The system checks if the EBSBCCX segment was found → If segment is found, proceed to extract REF reference data, otherwise set not found flags - [Extract REF Reference Qualifier]
The system extracts the REF reference qualifier from the segment → The REF reference qualifier is copied to working storage for processing - [Extract REF Reference Number]
The system extracts the REF reference number from the segment → The REF reference number is copied to working storage for customs processing - [Set EBSBCCX Found Flag]
The extraction process completes successfully → The EBSBCCX found flag is set to indicate successful retrieval - [Process Multiple Reference Segments]
The system processes multiple reference segments → All relevant reference segments are processed in sequence - [More Segments to Process?]
The system checks if more segments need processing → If more segments exist, continue processing, otherwise complete the extraction - [Increment Sequence Number]
The system increments the sequence number → The sequence number is increased to access the next segment in the series - [Set Not Found Flags]
The system sets not found flags → Both EBSBCCR and EBSBCCX not found flags are set to indicate missing data - [Complete Reference Extraction]
The reference extraction process completes → All extracted reference numbers and qualifiers are available for subsequent customs processing - [Build Search Key with CR + Sequence]
The system needs to build a search key for EBSBCCR segment retrieval → The search key is constructed as 'CR' concatenated with the sequence number - [Retrieve EBSBCCR Segment]
The system performs the segment retrieval operation → The EBSBCCR segment is retrieved from the EDI BOL control records database - [Segment Found?]
If the retrieval result → The system determines if the segment was found and sets appropriate processing flags - [Extract N9 Reference Qualifier]
The system processes the segment data → The N9 reference qualifier is extracted and stored for validation - [Extract N9 Reference Number]
The system continues processing the segment data → The N9 reference number is extracted and stored for validation - [Set Found Flag]
The system completes the data extraction process → The found flag is set to indicate successful retrieval of EDI BOL control record data - [Increment Sequence Counter]
The system needs to continue searching for additional segments → The sequence counter is incremented by 1 to target the next record - [More Sequences to Process?]
If continuation criteria → The system determines if more sequences remain to be processed within the allowed limit of 998 iterations - [Set Not Found Flag]
The system determines that no segment exists for the current search key → The not found flag is set to indicate unsuccessful retrieval - [Search EBSBCCX Segments for Reference Data - Extract REF qualifiers and numbers from extension records]
The system searches EBSBCCX segments using CR001 dependent key with RF type and sequence number → The system should retrieve the segment and set the found flag if successful, or set not found flag if unsuccessful - [Set Search Key with CR001 and RF Type]
The system prepares to search EBSBCCX segments → The system should set the dependent key to 'CR001', type to 'RF', and use the current sequence number for the search - [Execute Database Get Function]
The system executes the database get function for EBSBCCX segment → The system should attempt to retrieve the segment and return success or failure status - [EBSBCCX Segment Found?]
The system checks the result of the database retrieval operation → The system should determine if the segment was found and proceed with data extraction or set not found status accordingly - [Extract REF Qualifier from Segment]
The system processes the segment data to extract reference information → The system should extract the REF qualifier field from the segment and store it in working storage - [Extract Reference Number from Segment]
The system continues processing the segment data → The system should extract the reference number field from the segment and store it in working storage - [Set Found Flag to True]
The system completes the data extraction process → The system should set the EBSBCCX found flag to true to indicate successful processing - [Process Next Sequence Number]
The system prepares to search for additional EBSBCCX segments → The system should increment the sequence number for the next search iteration - [More Sequences to Process?]
If whether to continue searching for more EBSBCCX segments → The system should check if the sequence number is within the maximum limit (98 iterations) and continue or terminate accordingly - [Set Not Found Flag]
The system determines that no EBSBCCX segment exists for the current search parameters → The system should set the EBSBCCX not found flag to indicate unsuccessful retrieval - [Check Port Validity]
The system checks the port validity status → The system routes to appropriate handler based on port validity - valid ports proceed to manifest type checking while invalid ports route directly to standard handler - [Export Manifest M1109?]
If the manifest type is M1109 export → Export manifests (M1109) are routed to the specialized export handler GCCS309E - [US-Canada-US M1201?]
If the manifest type is M1201 US-Canada-US transit → US-Canada-US transit manifests (M1201) are routed to the specialized export handler GCCS309E - [Multi-Transit Manifest?]
If the manifest is multi-transit type → Multi-transit manifests are routed to the specialized export handler GCCS309E - [Route to Export Handler GCCS309E]
The system routes the EDI 309 transmission → The system calls the specialized export handler program GCCS309E - [Route to Standard Handler GCCS309]
The system routes the EDI 309 transmission → The system calls the standard handler program GCCS309 - [Set Next Workstation Database ID]
The system needs to set the next workstation database ID for message processing → The next workstation database ID is set using the updated sequence number from the control table - [Get Dispatch Data via GCCDSPIO]
The system calls GCCDSPIO service to retrieve dispatch data → Dispatch information including pedimento numbers, Mexican CCN, and despacho status is retrieved if available - [Log FEN Status Information]
The system processes FEN status information → A log entry is created with FEN message type using ZZZ log code and spawns GCT1051E transaction - [Log KCM Status Information]
The system processes KCM status information → A log entry is created with KCM message type using ZZZ log code and spawns GCT1051E transaction
Structural Validations
- [5:EDI BOL Validation]
Equipment numbers between EDI BOL and Fastway waybill do not match → Set EDI BOL as invalid and continue processing without EDI data - [9:M12 In-Bond Validation]
M12 segment data is present and valid → Set M12 manifest flag and include in-bond information in manifest processing - [12:CCN Format Validation]
The CCN is 12 characters, alphanumeric, contains no spaces, and has a valid SCAC code → Accept the CCN for processing and validate SCAC code against SS table - [26:Error Record Creation]
Invalid conditions are detected during processing → Create appropriate error records with business-relevant error messages and terminate processing - [Query System for Existing CCN]
The system queries the GCSUSRT US Customs segments database using the CCN as the key → The system determines whether the CCN already exists and sets appropriate flags - [Look up SCAC in SS Table GCSTBRT segments]
The system validates the SCAC code against the SS table → The system performs a lookup in the GCSTBRT SS table segments to verify SCAC authorization - [Equipment Numbers Match?]
The system compares the two standardized equipment numbers → The equipment numbers must match exactly for validation to pass - [Compare Car Initials]
The system performs comprehensive equipment validation → Car initials from both Fastway and EDI BOL are compared for consistency - [Car Initials Match?]
The system compares the car initials → The car initials must match exactly for validation to pass - [Compare Standardized Equipment Numbers]
The system performs equipment validation → The standardized equipment numbers are compared for exact match - [SE Table Found?]
The system checks if the SE table segment was successfully found → The system determines if automation status can be extracted or if manual processing should be assumed - [Query GCSUSRT Segment with CCN Key]
The system queries GCSUSRT segments using the CCN as the key → The system determines if the CCN already exists in the database - [Accept CCN - No Duplicate Found]
No duplicate CCN is found in the GCSUSRT segments → The system accepts the CCN for usage - [M12 Segments Found?]
If any M12 segments were found → If M12 segments are found, proceed with sequence validation; if not found, set M12 validation error flag - [Validate M12 Sequence Numbers]
The system validates M12 sequence numbers → The system should verify that sequence numbers are present and properly formatted - [Validate Entry Numbers]
The system validates entry numbers in M12 segments → The system should verify that entry numbers are present, properly formatted, and meet customs requirements - [Valid Entry Numbers?]
If entry number validity → If entry numbers are valid, proceed with location identifier validation; otherwise set M12 validation error flag - [Validate Location Identifiers]
The system validates location identifiers in M12 segments → The system should verify that location identifiers are present, properly formatted, and correspond to valid customs locations - [Valid Location Identifiers?]
If location identifier validity → If location identifiers are valid, proceed with M12 manifest creation flag setting; otherwise set M12 validation error flag - [EBSBCCR Found?]
The system checks the retrieval status → If EBSBCCR segment is found, proceed to extract M12 data, otherwise continue to EBSBCCX search - [Validate M12 In-Bond Type]
The system validates the M12 in-bond type format → If M12 format is valid, continue with sequence validation, otherwise set M12 not found flag - [Found M12 Segment?]
The system reads each segment to check for M12 segment type → The system identifies whether an M12 segment exists and proceeds to extract sequence information - [Sequence = 01?]
The system extracts and evaluates the sequence number from the M12 segment → The system determines if the sequence number equals 01 and marks this sequence as found - [Sequence = 02?]
If the sequence number equals 02 → The system determines if the sequence number equals 02 and marks this sequence as found - [Both 01 and 02 Found?]
If whether both sequence 01 and sequence 02 flags are set → The system determines if the M12 validation is complete and successful - [M12 Segment Found?]
The system searches for M12 segment in the EDI data → If M12 segment is not found, set M12 location identifier error and continue processing - [Entry Number Valid Format?]
The system validates the entry number format → If the entry number format is invalid, set M12 entry number validation error and continue processing - [Location Identifier Valid?]
The system validates the location identifier format → If the location identifier format is invalid, set M12 location identifier error and continue processing - [Qualifier = CUB?]
The qualifier is compared against 'CUB' → The system determines if this reference contains a US Customs Control Number - [Validate CCN Format]
The CCN format is validated → The system confirms the CCN is 12 characters alphanumeric with valid SCAC code - [Segment Found?]
The database access is completed → The system determines if the segment was found or not found - [Qualifier = 'CUB'?]
If the qualifier value → The system determines if the qualifier equals 'CUB' for customs bond processing - [Counter ≤ 98?]
The system checks the counter value → The system determines if the counter is less than or equal to 98 to continue searching - [Is CCN Qualifier?]
If the qualifier value → If the qualifier is 'CUB', 'ZZZ', or 'ZZ ', treat as CCN information; otherwise, continue to next segment - [Validate EDI CCN Format]
The system validates the EDI-sourced CCN format → The CCN must be 12 characters, alphanumeric, contain no spaces, and have a valid SCAC code, otherwise create an EDI format error - [Compare CCN Sources]
The system compares the CCN values from different sources → The CCN values must match between sources, otherwise create a source mismatch error - [Create Format Error Message]
The system creates an error message → Generate a descriptive error message indicating the specific CCN format validation failure - [Validate EDI CCN Format]
The system validates the EDI CCN format → CCN must be 12-character alphanumeric with no spaces and contain a valid SCAC code - [Both CCNs Match?]
The system compares the two CCN sources → If CCNs match, use the override CCN, otherwise generate a CCN mismatch error - [Validate SCAC Codes]
The system validates the SCAC code within the CCN → SCAC code must exist in the SS table and be an authorized carrier code - [Generate CCN Mismatch Error]
The system detects a mismatch between CCN sources → Generate a CCN mismatch error and halt processing - [Generate Invalid Format Error]
The CCN format validation fails → Generate an invalid format error and halt processing - [Create Error Record]
The system encounters a validation failure → An error record is created in GCSUSS15 error segments with appropriate error information - [Is Cargo on Train?]
The cargo status indicates the shipment is currently on a train → The update request is rejected and an error message is generated indicating cargo cannot be modified while on train - [Broker Information Consistent?]
The broker details in the update do not match the existing broker information in related segments → The update request is rejected and an error message is generated indicating broker information inconsistency - [GCSUSRT Found?]
The retrieval operation completes → If the GCSUSRT record is found, continue to retrieve A2 segments, otherwise log segment not found error - [GCSA2RT Found?]
The retrieval operation completes → If GCSA2RT segments are found, continue to retrieve B1 segments, otherwise log segment not found error - [GCSB1RT Found?]
The retrieval operation completes → If GCSB1RT segments are found, proceed to validate segment data integrity, otherwise log segment not found error - [Validate Segment Data Integrity]
The system validates the integrity and consistency of the segment data → The system should verify data completeness, format compliance, and cross-segment consistency - [Log Segment Not Found Error]
The segment retrieval operation fails → The system should log an appropriate error indicating which segment was not found - [Set Validation Error Flag]
The system cannot proceed with normal manifest processing → The system should set the validation error flag to indicate processing cannot continue normally - [Read GCSUSRT Manifest Segment]
The system attempts to read the GCSUSRT manifest segment → The system should verify the segment exists and is accessible - [Cargo On Train?]
The system checks if cargo is currently on a train → The system should create a validation error if cargo is on train and stop processing - [A2 Segments Consistent?]
The system validates GCSA2RT segment data against GCSUSRT manifest data → The system should create a validation error if A2 segments are inconsistent and stop processing - [B1 References Valid?]
The system validates GCSB1RT segment references → The system should create a validation error if B1 references are invalid and stop processing - [Equipment Numbers Match?]
The system compares equipment numbers across GCSUSRT, GCSA2RT, and GCSB1RT segments → The system should create a validation error if equipment numbers do not match and stop processing - [Bond Data Complete?]
The system checks bond data completeness in the manifest segments → The system should create a validation error if bond data is incomplete and stop processing - [Check Broker Entry Filing Status]
The system checks the broker entry filing status → If broker entry is already filed, reject any broker changes and generate error message - [Merlin Preference Available?]
If Merlin notification preference → The system determines if Merlin channel is available based on broker configuration - [Internet Preference Available?]
If Internet notification preference → The system determines if Internet channel is available based on broker configuration - [Fax Preference Available?]
If Fax notification preference → The system determines if Fax channel is available based on broker configuration - [Broker Data Exists?]
The system checks for broker information → The system determines if broker data exists for U2 segment creation - [Check for Duplicate CCN]
The system searches existing manifest records for the CCN → The system checks GCSUSRT segments to determine if the CCN already exists - [Validate CCN Update Success]
The system validates the CCN update operation → The system confirms that all segments now contain the new CCN value and no update errors occurred - [Handle CCN Update Error]
The system detects the CCN update failure → The system handles the error by logging the failure, potentially rolling back changes, and setting appropriate error indicators - [Create Error Message]
The system processes the error condition → An error message must be created explaining that updates are not allowed for cargo on trains - [Is Cargo Released?]
The system checks the cargo release status and finds that the cargo has been released from customs → The system sets a cargo released error flag and prevents any updates to the manifest record - [Is Cargo On Hold?]
The system checks the cargo hold status and finds that the cargo is currently on hold → The system sets a cargo on hold error flag and prevents any updates to the manifest record - [Prevent Update - Return Error]
Either cargo released error flag or cargo on hold error flag has been set during validation → The system prevents the update from proceeding and returns an error indicating the cargo status violation - [Validate Export Status Fields]
Detailed export status validation is required → Export status fields from GCSUSS01 segments are validated for processing completion - [Is Cargo on Train?]
The cargo associated with the manifest is currently on a train → The deletion request should be rejected with message that cargo cannot be deleted while on train - [Create Error Message: Broker Entry Filed]
An update operation is attempted on the manifest → The system creates an error message indicating that broker entry has been filed and updates are not allowed - [Lead CCN Found?]
The system checks if the lead CCN record was found → If lead CCN is found, proceed with message setup; otherwise log error and terminate process - [Message Spawned Successfully?]
The system checks the spawn result → If spawn was successful, set success indicator; otherwise log error information - [Log Error Information]
The system encounters an error condition → The system should log appropriate error information for troubleshooting purposes - [Create GCSUSS15 Error Segment]
The system creates GCSUSS15 error segment → Error segment structure is established for data population - [Populate Error Message Numbers]
The system populates error message numbers → Error segment contains appropriate message numbers for error identification - [Populate GCSUSS15 Error Segment]
The system populates the GCSUSS15 error segment → Error segment is populated with the determined data origin classification and associated user data - [Set Error Message Information]
The system sets error message information → Specific error message details are assigned to the error record for documentation purposes - [Set Backup Complete Flag]
The backup process completion needs to be indicated → The system sets a backup complete flag to true to indicate successful completion of the backup operation - [Return Error - Invalid CCN]
The system processes the validation failure → An error message is returned indicating invalid CCN format, transfer process is halted, and no changes are made to existing data - [B1 Segment Related to Current CCN?]
The system checks the relationship between the B1 segment and current CCN → The system determines if the B1 segment is related to the current CCN and processes accordingly - [EDI 417 Transmission Successful?]
EDI 417 transmission attempt is completed → System evaluates transmission result and determines if successful or failed - [Handle Transmission Error]
Transmission validation indicates failure → System handles transmission error appropriately - [EDI CCN Extraction and Validation]
EDI CCN extraction is performed → The system should extract the CCN from the N9 CUB reference, validate its format, and use it for manifest creation if valid - [Error Collection and Processing]
Error processing is triggered → The system should collect creation errors, log appropriate error messages, and set error flags for downstream processing - [EBSBCCR Found?, EBSBCCX Found?]
The system attempts to retrieve the segment → The segment availability flag is set based on successful retrieval - [Validate SCAC Code]
The system validates the SCAC code portion against SS table → SCAC code must exist in SS table and cannot be 'CPRS' for EDI processing - [Segment Found?]
The system checks the retrieval result → The system sets a found flag if the segment exists or proceeds to set not found status if the segment does not exist - [Qualifier = CUB?]
If the qualifier value → If the qualifier equals 'CUB', the system proceeds to extract the reference number, otherwise it continues to the next segment - [Sequence <= 998?]
The system checks the counter value against the maximum limit → If the sequence counter is less than or equal to 998, the system continues searching, otherwise it terminates the search with CCN not found status - [Validate M12 Entry Numbers]
The system validates M12 entry numbers → Entry numbers must meet specified format requirements and business validation criteria - [Validate Location Identifiers]
The system validates location identifiers in M12 segments → Location identifiers must be valid and authorized for M12 manifest processing - [Check Car Against EDI BOL]
The system validates car consistency between waybill and EDI → The car equipment number is compared against EDI BOL records for matching - [Flag Equipment Mismatch Error]
An equipment error condition is detected → The system flags the equipment mismatch error for reporting and continues processing remaining cars - [Equipment Numbers Match?]
Equipment validation comparison is performed → Equipment numbers must match exactly or validation fails with equipment mismatch error - [Set Equipment Validation Error Flag]
Equipment validation failure is processed → Equipment validation error flag is set to indicate validation failure - [Check EDI Extracted CCN]
The system searches for existing records with the same EDI-extracted CCN → The system determines if the EDI CCN already exists and applies appropriate duplicate handling logic - [Validate Business Rules for EDI CCN]
The system validates the CCN format, SCAC code, and compliance with customs business rules → The system determines if the EDI CCN is valid for manifest creation based on format requirements and business rule compliance - [Check System for Existing CCN]
The system checks the manifest database for existing CCN records → The system determines whether the CCN already exists in the GCSUSRT manifest segments - [CCN Already Exists?]
The CCN is found to already exist in the GCSUSRT manifest segments → The system rejects the manifest creation and returns a duplicate CCN error - [Check for M12 In-Bond Type in EDI BOL]
The system examines the EDI BOL segments for M12 in-bond type indicators → The system identifies whether M12 segments exist and sets appropriate processing flags - [Validate M12 Sequence Numbers 01 and 02]
The system validates the M12 sequence numbers → The system verifies that sequence numbers 01 and 02 are present and properly formatted - [Validate Entry Numbers and Location Identifiers]
The system validates entry numbers and location identifiers → The system verifies that entry data meets customs requirements and format specifications - [IRS Number Present?]
The system extracts IRS number from EDI data → The system determines if IRS number is present or absent - [Valid Format?]
The system validates the IRS number format → The system determines if the format is valid or invalid according to IRS standards - [Log Validation Error]
The system processes the invalid entry → The system writes an error record to GCSUSS15 error segments - [Retrieve Broker Configuration from BK Table]
The broker identifier is 'UNKNOWN' or 'NOT-REQ' → The notification process is terminated without sending any messages - [Broker Data Exists?]
The system checks for broker data availability → Processing continues if broker data exists, otherwise notification process is completed without sending messages - [BK Segment Found?]
The system checks the result of the BK table read operation → The system determines if the broker exists based on whether the BK segment was found - [B1 Segment Found?]
The system checks the result of the B1 table read operation → The system determines if notification preferences exist based on whether the B1 segment was found - [Validate Parsed Broker Name]
The system validates the parsed broker name → Broker name is confirmed as valid or invalid based on business rules - [BK Table Found?]
The system checks if the BK table segment was found → If found, proceed to read B1 table segment; if not found, set default notification methods - [B1 Table Found?]
The system checks if the B1 table segment was found → If found, proceed to extract Merlin notification setting; if not found, set default notification methods - [Set Error Status]
The processing failed or encountered errors during execution → The system sets the message status to 'ERROR' to indicate processing failure - [Is Port Valid?]
The system checks if the port is valid (SW-VALID-PORT is true) → If port is valid, route to GCCS309E specialized handler; if port is invalid, route to GCCS309 standard handler - [Get Current Julian Date]
The system checks if the ID is numeric → If the ID is not numeric, it defaults to 1, otherwise the existing numeric value is used - [Is Equipment Number Numeric?]
The system validates the equipment number format → The system confirms the equipment number is entirely numeric before proceeding with check digit processing - [Validate Environment Settings]
The system validates the US Customs processing flags → The system checks and sets appropriate background/foreground indicators and origination/cancelation/diversion flags based on the message content - [Valid Fastway Message?]
The system performs final validation of the message → The system determines if the message is valid and complete for further processing or if an error should be generated - [Validate Current Manifest Status]
The system checks for existing manifest record using the waybill key → The manifest record is retrieved and its current status is validated for diversion eligibility - [Compare Standardized Equipment Numbers]
The system compares the standardized equipment numbers → Equipment validation succeeds if numbers match, otherwise equipment validation fails - [Validate M12 Segment Structure]
The system validates the segment structure format → M12 segments must have proper EDI format with required fields populated - [Check Sequence Numbers 01 and 02]
The system checks for sequence numbers 01 and 02 → Both sequence numbers 01 and 02 must be present and in correct sequential order - [Validate Entry Numbers]
The system validates entry numbers within the M12 segments → Entry numbers must be numeric, properly formatted, and valid for customs entry processing - [Validate Location Identifiers]
The system validates location identifiers within the M12 segments → Location identifiers must correspond to valid customs port codes and processing locations - [M12 Segment Found?]
M12 segments are not found in the EDI BOL data → The system sets M12 in-bond validation as failed - [Validate Entry Number]
The system validates the entry number → The system checks if the entry number meets required format and content criteria - [Validate Location Identifier]
The system validates the location identifier → The system checks if the location identifier meets required format and content criteria - [Set M12 Validation Error]
Either entry number or location identifier validation fails → The system sets M12 validation error flag - [Log Error Message]
Error processing continues → Detailed error information is logged explaining why the recreation was not allowed - [Validate Current Manifest Status]
The system validates the current manifest status → The system should confirm the manifest exists in the US Customs records before proceeding - [Create Diversion Error Record]
The system creates diversion error records → The system sends 417 error messages and creates error segments with appropriate error codes for the failed diversion - [Validate All Updates Complete]
The system performs final validation → The system verifies that all manifest segments, A2 segments, B1 segments, bond data, and broker information have been successfully updated with the new waybill key and no errors occurred during the update process - [Validate Manifest Not Released]
The system checks the manifest release status and customs transmission status → Deletion is only permitted if the manifest has not been officially released or transmitted to customs authorities - [Is Cargo On Train?]
User attempts to delete the manifest and the cargo is currently on a train → System should reject the deletion request and display error message 'Cannot Delete - Cargo On Train' - [Is Cargo Released?]
User attempts to delete the manifest and the cargo status is 'Released' → System should reject the deletion request and display error message 'Cannot Delete - Cargo Released' - [Is Cargo On Hold?]
User attempts to delete the manifest and the cargo status is 'On Hold' → System should reject the deletion request and display error message 'Cannot Delete - Cargo On Hold' - [Are Broker Entries Filed?]
User attempts to delete the manifest and broker entries have been filed for this cargo → System should reject the deletion request and display error message 'Cannot Delete - Broker Entries Filed' - [Is Manifest Exported?]
User attempts to delete the manifest and the manifest has been exported to customs → System should reject the deletion request and display error message 'Cannot Delete - Manifest Exported' - [Valid Port Check]
The port validation check is performed → The transmission proceeds only if the port is valid, otherwise the transmission is skipped - [Spawning Successful?]
The system checks spawning results → Success or error logging is triggered based on spawning outcome - [Log Car Update Error]
The system logs the error → An error entry is recorded with details of the car update failure - [Is Cargo on Train?]
The cargo associated with the manifest is currently on a train (cargo status indicates train loading) → The deletion request must be rejected with an appropriate business error message - [Deletion Rejected - Create Error]
The system determines deletion is not allowed due to cargo on train, broker entries filed, manifest released, or invalid status → An appropriate error message must be created and the deletion request must be rejected - [Validate Each Related Manifest]
The system validates each CCN in the list → Each manifest record is verified to exist in GCSUSRT segments and is accessible for processing - [Create Car Relationship Error]
The system processes the validation failure → The system should create an error record in the error segments with appropriate error details - [GCSUSRT Segment Exists?]
The system checks for the existence of the GCSUSRT root segment → The system determines whether the manifest root segment exists and proceeds accordingly - [GCSA2RT Segments Exist?]
The system checks for the existence of GCSA2RT detail segments → The system determines whether manifest detail segments exist and proceeds with deletion if found - [GCSB1RT Segments Exist?]
The system checks for the existence of GCSB1RT additional information segments → The system determines whether additional information segments exist and proceeds with deletion if found - [Verify All Segments Removed]
The system verifies the deletion results → All manifest segments (GCSUSRT, GCSA2RT, and GCSB1RT) are confirmed as removed from the database - [Port Valid?]
The system validates the port information → If port is valid, the system sends the EDI 309 delete transaction; if port is invalid, the system skips transmission and proceeds to logging - [Recreation Successful?]
The system validates the recreation results for data integrity and business rule compliance → Recreation is marked as successful if all manifest segments are properly updated and no validation errors exist, otherwise it is marked as failed - [Create Error Record]
Any step in the recreation process encounters an error or validation failure → An error record is created in GCSUSS15 error segments with specific error details and failure reason - [Send Error Response to US Customs]
Recreation processing fails and error records are created → An error response message is sent to US Customs with failure status and specific error details to inform them of the recreation failure - [Found N9*CUB Qualifier?]
The system checks if the qualifier equals 'CUB', 'ZZZ', or 'ZZ ' → The system should proceed with CCN extraction if qualifier matches, otherwise search EBSBCCX segments - [Found N9*CUB Qualifier?]
The system checks if the qualifier equals 'CUB', 'ZZZ', or 'ZZ ' → The system should proceed with CCN extraction if qualifier matches, otherwise set extraction as failed - [Validate CCN Format]
The system validates the CCN format → The CCN must be 12 characters long, alphanumeric, and contain no spaces to be considered valid - [12-Character Format Valid?]
The system checks if the CCN is exactly 12 characters, alphanumeric, and contains no spaces → The system should proceed with SCAC validation if format is valid, otherwise set extraction as failed - [Qualifier = CUB?]
The qualifier is evaluated for CUB identification → Processing continues to CCN extraction if qualifier equals 'CUB', otherwise search continues - [Validate CCN Format]
The CCN format is validated → CCN is accepted if it meets 12-character alphanumeric format with valid SCAC code, otherwise search continues - [Validate SCAC Code]
The SCAC code portion of the CCN is validated against the SS table → CCN is accepted if SCAC code is valid and not 'CPRS', otherwise search continues - [Sequence ≤ 998?]
The current sequence counter is evaluated against the maximum limit → The search continues if sequence counter is less than or equal to 998, otherwise the search terminates - [Segment Found?]
The retrieval operation completes → The system determines if the segment exists and proceeds with data extraction if found, or increments the counter if not found - [Segment Found?]
If the retrieval result → The system sets appropriate found or not found indicators based on segment availability - [Qualifier = CUB US Customs?]
If the qualifier value → The system determines if the qualifier equals CUB indicating US Customs bond reference - [Create GCSUSS15 Error Segment]
The system processes the SCAC validation error → The system creates a GCSUSS15 error segment - [Set SCAC Validation Error Code]
The system records the SCAC validation error → The system sets the specific SCAC validation error code - [Error Record Successfully Logged]
The error logging process completes → The system confirms the error record has been successfully logged - [Validate 12-Character CCN Format]
The system validates the CCN format requirements → The CCN must be exactly 12 characters in length to be considered valid - [Set Invalid CCN Format Error]
The CCN fails either the 12-character length requirement or the alphanumeric position validation → The system sets an invalid CCN format error status and continues processing with error condition - [Check EDI BOL for M12 Segments]
The system searches for M12 segments in the EDI BOL data → Set appropriate flag indicating whether M12 segments are found in the EDI data - [Validate M12 Sequence Numbers]
The system validates M12 sequence numbers → Check that required sequence numbers are present and properly formatted for manifest creation - [Validate Entry Numbers]
The system validates entry numbers in M12 segments → Verify that entry numbers are properly formatted and contain valid customs entry data - [Entry Numbers Valid?]
Entry numbers are invalid or do not meet customs requirements → Set M12 creation flag to NO and stop M12 processing - [Validate Location Identifiers]
The system validates location identifiers in M12 segments → Verify that location identifiers correspond to valid customs processing locations - [Location IDs Valid?]
Location identifiers are invalid or do not reference valid customs locations → Set M12 creation flag to NO and terminate M12 processing - [Perform Bond Validation]
The system performs bond validation for M12 manifest creation → Validate bond information against customs requirements and bonding regulations - [Extract Error Message Number]
The system processes each individual error → The error message number and details are extracted for segment creation - [Populate GCSUSS15 Error Segment]
The system creates an error segment → The GCSUSS15 error segment is populated with the extracted error message number and details - [Increment Error Counter]
The system updates the error tracking counter → The error counter is incremented by one to reflect the processed error - [IRS Number Validation Processing - Validate IRS numbers from EDI data and flag invalid entries for manifest creation]
IRS number validation is required → The validation processing is not available as the source code for IRS Number Validation Processing is not present in the provided code analysis - [Process Creation Validation]
The system completes the manifest creation process → The system validates creation success before proceeding with detour flag setting - [Validate Bunch Bill Requirements]
The system validates bunch bill processing requirements → The system should verify all required data elements and conditions are met before proceeding - [Spawn Successful?]
The system checks the spawn result → The system should determine if the spawn was successful or if an error occurred - [Handle Spawn Error]
The system handles the spawn error → The system should process the error appropriately and take corrective action or log the failure - [Extract Error Message Number from GCWERRS]
The system processes the current error entry → The error message number is extracted from the GCWERRS structure for further processing - [Populate GCSUSS15 Error Segment]
The system creates an error record for the manifest operation → The GCSUSS15 error segment is populated with the extracted error information - [Increment Error Counter]
The system completes processing of the current error → The error counter is incremented by one to track the total number of processed errors - [Current Julian Date Available?]
If the next Fastway I/O message workstation database ID field → If the field contains a valid Julian date, processing continues with date comparison, otherwise the current date is converted to Julian format