This report presents the exact business rules dynamically extracted from the legacy system. Rules are formatted in an Agile/BDD Given/When/Then structure, offering a bridge between business requirements and technical implementation constraints. Component rules have been logically grouped into feature sets.
Business Justification: Ensures correct system behavior and process compliance when system is starting message processing.
Trigger Criteria:
Context: The system is starting message processing
Applied to: Initialize System Configuration
Action: Administrative configuration is being initialized
Logic Flow:
IF The system is starting message processing
AND Administrative configuration is being initialized
THEN:
• The system should retrieve admin segment with table ID 'AD' and sequence ID 'ADMINID', andif not found, set default Merlin ID to 'OM01247'
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when system has initialized configuration.
Trigger Criteria:
Context: The system has initialized configuration
Applied to: Load Incoming Messages
Action: Loading messages from the queue
Logic Flow:
IF The system has initialized configuration
AND Loading messages from the queue
THEN:
• The system should connect to MQ manager, open the queue, and get messages with conversion options enabled
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when message retrieval attempt has been made.
Trigger Criteria:
Context: A message retrieval attempt has been made
Applied to: Message Available?
Action: The completion code is MQCC-OK and message entries are greater than 1 and backout count equals 0
Logic Flow:
IF A message retrieval attempt has been made
AND The completion code is MQCC-OK and message entries are greater than 1 and backout count equals 0
THEN:
• The message should be marked as good for processing, otherwise skip or terminate based on specific conditions
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when valid message is being processed.
Trigger Criteria:
Context: A valid message is being processed
Applied to: Determine Message Type
Action: M10 segment reference number starts with 'TRAIN'
Logic Flow:
IF A valid message is being processed
AND M10 segment reference number starts with 'TRAIN'
THEN:
• The message should be classified as Train type, orif M10 reference number starts with 'CARGO' then classify as Cargo type, orif neither but M11 segment exists then extract cargo information from M11
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when m10 segment is being processed.
Trigger Criteria:
Context: An M10 segment is being processed
Applied to: Test Message?
Action: The table reference number equals 'TRAINCPRSTESTTRAIN0000000000' or 'CARGOCPRS940000000000'
Logic Flow:
IF An M10 segment is being processed
AND The table reference number equals 'TRAINCPRSTESTTRAIN0000000000' or 'CARGOCPRS940000000000'
THEN:
• The message should be processed as a special test case with timestamp updates to T1 table segment
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when message has been classified as train or cargo.
Trigger Criteria:
Context: A message has been classified as Train or Cargo
Applied to: Train or Cargo?
Action: M10 manifest type code is 'P', 'X', 'Y', 'T', or 'S'
Logic Flow:
IF A message has been classified as Train or Cargo
AND M10 manifest type code is 'P', 'X', 'Y', 'T', or 'S'
THEN:
• The system should set status update flag to true, andif manifest type code is 'H' for trains, set delete status flag to true
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message has been classified as train type. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A message has been classified as Train type
Applied to: Retrieve Train Records
Action: Retrieving train records using the train ID from M10 data
Logic Flow:
IF A message has been classified as Train type
AND Retrieving train records using the train ID from M10 data
THEN:
• The system should call train I/O module with GET function for root record only, andif not found, log error message indicating train ID was not found
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message has been classified as cargo type. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A message has been classified as Cargo type
Applied to: Retrieve Cargo Records
Action: Retrieving cargo records using the cargo control number from M10 data
Logic Flow:
IF A message has been classified as Cargo type
AND Retrieving cargo records using the cargo control number from M10 data
THEN:
• The system should call cargo I/O module with GET function for cargo segment, andif not found, log error message indicating cargo control number was not found
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when message segments are available for processing.
Trigger Criteria:
Context: Message segments are available for processing
Applied to: Process Message Segments
Action: Processing segments by type where M10 contains manifest data, P4 contains additional data, N10 contains line release number, K1 contains message text, and K3 contains acceptance data
Logic Flow:
IF Message segments are available for processing
AND Processing segments by type where M10 contains manifest data, P4 contains additional data, N10 contains line release number, K1 contains message text, and K3 contains acceptance data
THEN:
• The system should process each segment type appropriately and continue until end marker or spaces are encountered
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when message segments have been processed.
Trigger Criteria:
Context: Message segments have been processed
Applied to: Validate Required Segments
Action: Checking for required segments
Logic Flow:
IF Message segments have been processed
AND Checking for required segments
THEN:
• The system should log error if M10 segment not found, orif P4 segment not found, orif K3 segment not found and create default K3 segment
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when k3 segment is being processed.
Trigger Criteria:
Context: A K3 segment is being processed
Applied to: Process Rejection Information
Action: K3 total reject count equals zero and total accept count is greater than zero
Logic Flow:
IF A K3 segment is being processed
AND K3 total reject count equals zero and total accept count is greater than zero
THEN:
• The system should set ACK status, but if total reject count is greater than zero, set ERROR status, andif both counts are zero, set ACK status with warning message
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when k3 acceptance data has been processed with zero rejections and positive acceptances.
Trigger Criteria:
Context: K3 acceptance data has been processed with zero rejections and positive acceptances
Applied to: Determine Final Status
Action: Train is in pre-arrived status
Logic Flow:
IF K3 acceptance data has been processed with zero rejections and positive acceptances
AND Train is in pre-arrived status
THEN:
• The system should set pre-arrival status, orif train review is complete, set review-completed status, otherwise set standard ACK status
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when error status has been determined.
Trigger Criteria:
Context: An error status has been determined
Applied to: Send Error Messages
Action: Error status flag is set
Logic Flow:
IF An error status has been determined
AND Error status flag is set
THEN:
• The system should send error notification message via EMCSEND to configured Merlin recipients
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train processing requires status update.
Trigger Criteria:
Context: Train processing requires status update
Applied to: Update Train Status
Action: Train is deleted and status is ACK, or train is delete-pending and status is ACK
Logic Flow:
IF Train processing requires status update
AND Train is deleted and status is ACK, or train is delete-pending and status is ACK
THEN:
• The system should set status to 'DELETED', orif train is not deleted or delete-pending, update with current status
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when cargo processing requires status update.
Trigger Criteria:
Context: Cargo processing requires status update
Applied to: Update Cargo Status
Action: Status is ACK and saved status description is spaces
Logic Flow:
IF Cargo processing requires status update
AND Status is ACK and saved status description is spaces
THEN:
• The system should set cargo ACK flags, orif saved status exists, restore saved status and description, orif status is error, save current status and set error flags
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train status has been updated.
Trigger Criteria:
Context: Train status has been updated
Applied to: Check AEI Train Qualification
Action: Train has ACK status and AEI-SEND flag and ENROUTE-NOT-REPORTED flag and train ID position 23 equals 'T'
Logic Flow:
IF Train status has been updated
AND Train has ACK status and AEI-SEND flag and ENROUTE-NOT-REPORTED flag and train ID position 23 equals 'T'
THEN:
• The system should qualify train for AEI processing and prepare customs transaction data
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train status has been updated.
Trigger Criteria:
Context: Train status has been updated
Applied to: Process Automatic Train Arrival
Action: Train has ACK status and ARRIVED-PENDING flag
Logic Flow:
IF Train status has been updated
AND Train has ACK status and ARRIVED-PENDING flag
THEN:
• The system should trigger automatic train arrival processing with current date and time
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train qualifies for aei processing.
Trigger Criteria:
Context: Train qualifies for AEI processing
Applied to: Load Train Car Information
Action: Loading car information where container indicator is not 'C'
Logic Flow:
IF Train qualifies for AEI processing
AND Loading car information where container indicator is not 'C'
THEN:
• The system should load car initials, numbers, and equipment types, and determine loaded/empty status based on next car's container indicator
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train has aei-send flag set.
Trigger Criteria:
Context: Train has AEI-SEND flag set
Applied to: Send AEI Status Messages
Action: Sending AEI status messages
Logic Flow:
IF Train has AEI-SEND flag set
AND Sending AEI status messages
THEN:
• The system should retrieve AEI Merlin recipients from database, format train and status information, and send via EMCSEND3
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train status processing is complete.
Trigger Criteria:
Context: Train status processing is complete
Applied to: Send Terminal Status Messages
Action: Train has ACK status and AEI-SEND flag and ENROUTE-REPORTED flag
Logic Flow:
IF Train status processing is complete
AND Train has ACK status and AEI-SEND flag and ENROUTE-REPORTED flag
THEN:
• The system should send enroute message to AEI Merlin recipients
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when message processing activities need to be logged.
Trigger Criteria:
Context: Message processing activities need to be logged
Applied to: Log Message Processing
Action: Creating log entries
Logic Flow:
IF Message processing activities need to be logged
AND Creating log entries
THEN:
• The system should format different log messages for cargo versus train operations, and use special format when status should not be updated
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when processing activities require reporting. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Processing activities require reporting
Applied to: Send Merlin Reports
Action: Sending Merlin reports
Logic Flow:
IF Processing activities require reporting
AND Sending Merlin reports
THEN:
• The system should send reports to primary recipients and copy to administrative recipients with appropriate error handling
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when special test message is being processed.
Trigger Criteria:
Context: Special test message is being processed
Applied to: Update Administrative Tables
Action: Manifest type is 'P'
Logic Flow:
IF Special test message is being processed
AND Manifest type is 'P'
THEN:
• The system should update T1-309-ACK timestamp, orif manifest type is 'H', update T1-353-ACK timestamp, orif manifest type is 'S', update T1-358-ACK timestamp
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when message processing is complete or terminated.
Trigger Criteria:
Context: Message processing is complete or terminated
Applied to: Close MQ Connections
Action: Closing MQ resources
Logic Flow:
IF Message processing is complete or terminated
AND Closing MQ resources
THEN:
• The system should close queue handle and disconnect from MQ manager with appropriate error handling
R-GCX015-cbl-00025 (+11)File: GCX015.cblBusiness Rule: Initialize System Configuration
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when system is starting message processing initialization.
Trigger Criteria:
Context: The system is starting message processing initialization
Applied to: Clear Working Storage Fields
Action: The initialization process begins
Logic Flow:
IF The system is starting message processing initialization
AND The initialization process begins
THEN:
• All working storage fields including train/cargo switches, message counters, key tables, and processing flags are cleared to spaces or initial values
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when working storage fields have been cleared.
Trigger Criteria:
Context: Working storage fields have been cleared
Applied to: Initialize Message Counters and Tables
Action: Counter and table initialization is performed
Logic Flow:
IF Working storage fields have been cleared
AND Counter and table initialization is performed
THEN:
• K1 counter is set to 1, K1 table is initialized, message line counter is set to 1, and all segment found flags are set to not found status
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when message counters and tables are initialized.
Trigger Criteria:
Context: Message counters and tables are initialized
Applied to: Set Administrative Table Parameters
Action: Administrative table parameters are configured
Logic Flow:
IF Message counters and tables are initialized
AND Administrative table parameters are configured
THEN:
• Function code is set to 'GU', table ID is set to 'AD', sequence ID is set to 'ADMINID', and accept status is set to 'GE'
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when administrative table parameters are configured.
Trigger Criteria:
Context: Administrative table parameters are configured
Applied to: Get Administrative Configuration
Action: Table segment retrieval is performed
Logic Flow:
IF Administrative table parameters are configured
AND Table segment retrieval is performed
THEN:
• System calls table I/O function to get administrative segment data
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when administrative configuration retrieval has been attempted.
Trigger Criteria:
Context: Administrative configuration retrieval has been attempted
Applied to: Admin Config Found?
Action: Return flag indicates successful retrieval (flag equals '0')
Logic Flow:
IF Administrative configuration retrieval has been attempted
AND Return flag indicates successful retrieval (flag equals '0')
THEN:
• Administrative segment data is loaded from table segment, otherwise default Merlin ID 'OM01247' is set
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when administrative configuration retrieval failed.
• Merlin ID is set to 'OM01247' as the default value
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when administrative configuration is complete.
Trigger Criteria:
Context: Administrative configuration is complete
Applied to: Initialize Message Queue Parameters
Action: Message queue parameters are initialized
Logic Flow:
IF Administrative configuration is complete
AND Message queue parameters are initialized
THEN:
• Header length, unused entry length, and single entry length are calculated and stored for message processing
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when message queue parameters are initialized.
Trigger Criteria:
Context: Message queue parameters are initialized
Applied to: Connect to MQ Manager
Action: MQ connection is attempted
Logic Flow:
IF Message queue parameters are initialized
AND MQ connection is attempted
THEN:
• System calls MQCONNC to establish connection with MQ manager
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when mq connection attempt has been made.
Trigger Criteria:
Context: MQ connection attempt has been made
Applied to: MQ Connection OK?
Action: Connection completion code is evaluated
Logic Flow:
IF MQ connection attempt has been made
AND Connection completion code is evaluated
THEN:
• If completion code equals MQCC-OK then connection is successful, otherwise connection failed and error handling is triggered
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when mq manager connection is successful.
Trigger Criteria:
Context: MQ manager connection is successful
Applied to: Open Message Queue for Input
Action: Queue open operation is performed
Logic Flow:
IF MQ manager connection is successful
AND Queue open operation is performed
THEN:
• System calls MQOPEN with object type set to queue, object name from configuration, and input options
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when message queue open attempt has been made.
Trigger Criteria:
Context: Message queue open attempt has been made
Applied to: Queue Open OK?
Action: Queue open completion code is evaluated
Logic Flow:
IF Message queue open attempt has been made
AND Queue open completion code is evaluated
THEN:
• If completion code equals MQCC-OK then queue is ready for processing, if reason code is 2085 then program exits, otherwise error handling is triggered
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message queue is successfully opened.
Trigger Criteria:
Context: Message queue is successfully opened
Applied to: System Ready for Processing
Action: All initialization steps are validated
Logic Flow:
IF Message queue is successfully opened
AND All initialization steps are validated
THEN:
• System is ready to begin processing messages from the queue
Business Justification: Defines the strict business conditions required to proceed when system needs to process us customs messages from message queue.
Trigger Criteria:
Context: System needs to process US Customs messages from message queue
Applied to: Connect to MQ Manager
Action: Connection to MQ manager is attempted
Logic Flow:
IF System needs to process US Customs messages from message queue
AND Connection to MQ manager is attempted
THEN:
• If connection fails, system generates error message and terminates processing with MQ connection failure
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when mq manager connection is established.
Trigger Criteria:
Context: MQ manager connection is established
Applied to: Open Message Queue
Action: System attempts to open the message queue
Logic Flow:
IF MQ manager connection is established
AND System attempts to open the message queue
THEN:
• If queue opening fails, system generates error message and terminates processing with MQ open failure
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when system attempts to open message queue.
Trigger Criteria:
Context: System attempts to open message queue
Applied to: Queue Available?
Action: Queue open operation returns reason code 2085
Logic Flow:
IF System attempts to open message queue
AND Queue open operation returns reason code 2085
THEN:
• System exits processing normally without error
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message queue is open and available.
Trigger Criteria:
Context: Message queue is open and available
Applied to: Get Message from Queue
Action: System attempts to get message from queue
Logic Flow:
IF Message queue is open and available
AND System attempts to get message from queue
THEN:
• Message is retrieved and completion code is set based on operation result
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message retrieval operation is completed.
Trigger Criteria:
Context: Message retrieval operation is completed
Applied to: Message Retrieved Successfully?
Action: Completion code equals MQCC-OK
Logic Flow:
IF Message retrieval operation is completed
AND Completion code equals MQCC-OK
THEN:
• Message is considered successfully retrieved for further processing
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when message is successfully retrieved from queue.
Trigger Criteria:
Context: Message is successfully retrieved from queue
Applied to: Message Too Short?
Action: Completion code is MQCC-OK and calculated message entries count is less than 1
Logic Flow:
IF Message is successfully retrieved from queue
AND Completion code is MQCC-OK and calculated message entries count is less than 1
THEN:
• System terminates processing with user error 355 indicating message is too short
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when message is successfully retrieved from queue.
Trigger Criteria:
Context: Message is successfully retrieved from queue
Applied to: Calculate Message Entries Count
Action: Message data length is available
Logic Flow:
IF Message is successfully retrieved from queue
AND Message data length is available
THEN:
• Maximum message entries count is calculated by subtracting header and unused data length from total data length and dividing by single entry length
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when message is successfully retrieved and has valid length.
Trigger Criteria:
Context: Message is successfully retrieved and has valid length
Applied to: Check Message Backout Count
Action: Message backout count is evaluated
Logic Flow:
IF Message is successfully retrieved and has valid length
AND Message backout count is evaluated
THEN:
• Message processing eligibility is determined based on backout count value
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when message is successfully retrieved with valid length.
Trigger Criteria:
Context: Message is successfully retrieved with valid length
Applied to: Mark as Good Message
Action: Completion code is MQCC-OK and message backout count equals 0
Logic Flow:
IF Message is successfully retrieved with valid length
AND Completion code is MQCC-OK and message backout count equals 0
THEN:
• Message is marked as good message for processing
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when message is successfully retrieved with valid length.
Trigger Criteria:
Context: Message is successfully retrieved with valid length
Applied to: Mark as Skip Message
Action: Completion code is MQCC-OK and message backout count is not equal to 0
Logic Flow:
IF Message is successfully retrieved with valid length
AND Completion code is MQCC-OK and message backout count is not equal to 0
THEN:
• Message is marked as skip message and not processed further
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when message retrieval operation fails.
Trigger Criteria:
Context: Message retrieval operation fails
Applied to: No Messages Available?
Action: Completion code is MQCC-FAILED and reason code is MQRC-NO-MSG-AVAILABLE
Logic Flow:
IF Message retrieval operation fails
AND Completion code is MQCC-FAILED and reason code is MQRC-NO-MSG-AVAILABLE
THEN:
• System generates MQ error message and terminates processing with error code 355
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when message retrieval operation fails.
Trigger Criteria:
Context: Message retrieval operation fails
Applied to: Set End of Queue Flag
Action: Completion code and reason code indicate other MQ failure conditions
Logic Flow:
IF Message retrieval operation fails
AND Completion code and reason code indicate other MQ failure conditions
THEN:
• System sets end of message queue flag and generates error message before terminating with error code 355
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when mq operation fails with specific reason code.
Trigger Criteria:
Context: MQ operation fails with specific reason code
Applied to: Generate MQ Error Message
Action: Error condition is detected
Logic Flow:
IF MQ operation fails with specific reason code
AND Error condition is detected
THEN:
• System calls error message routine to generate descriptive error text and formats complete error message with reason code
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when critical mq error condition is detected.
Trigger Criteria:
Context: Critical MQ error condition is detected
Applied to: Abend with Error Code 355
Action: Error message is generated and transaction code 355 is set
Logic Flow:
IF Critical MQ error condition is detected
AND Error message is generated and transaction code 355 is set
THEN:
• System calls error handling routine to terminate processing abnormally
R-GCX015-cbl-00051 (+7)File: GCX015.cblBusiness Rule: Determine Message Type
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when message is being processed and contains message segments.
Trigger Criteria:
Context: A message is being processed and contains message segments
Applied to: Extract M10 Segment Data
Action: An M10 segment is found in the message
Logic Flow:
IF A message is being processed and contains message segments
AND An M10 segment is found in the message
THEN:
• The system extracts the M10 segment data and marks M10 segment as found
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when m10 segment has been extracted from the message.
Trigger Criteria:
Context: An M10 segment has been extracted from the message
Applied to: Reference Number Prefix = 'TRAIN'?
Action: The reference number (M10-12-REF-NUM) starts with 'TRAIN'
Logic Flow:
IF An M10 segment has been extracted from the message
AND The reference number (M10-12-REF-NUM) starts with 'TRAIN'
THEN:
• The system sets the message type as TRAIN for processing
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when m10 segment has been extracted and the reference number does not start with 'train'.
Trigger Criteria:
Context: An M10 segment has been extracted and the reference number does not start with 'TRAIN'
Applied to: Reference Number Prefix = 'CARGO'?
Action: The reference number (M10-12-REF-NUM) starts with 'CARGO'
Logic Flow:
IF An M10 segment has been extracted and the reference number does not start with 'TRAIN'
AND The reference number (M10-12-REF-NUM) starts with 'CARGO'
THEN:
• The system sets the message type as CARGO for processing
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when message type is unknown after checking m10 segment and an m11 segment is available.
Trigger Criteria:
Context: The message type is unknown after checking M10 segment and an M11 segment is available
Applied to: Extract SCAC and Bill Number from M11
Action: The system processes the M11 segment
Logic Flow:
IF The message type is unknown after checking M10 segment and an M11 segment is available
AND The system processes the M11 segment
THEN:
• The system extracts SCAC code and bill number from M11 segment to build cargo identification key
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when scac code and bill number have been extracted from m11 segment.
Trigger Criteria:
Context: SCAC code and bill number have been extracted from M11 segment
Applied to: Build Cargo Key from M11 Data
Action: The system needs to create a cargo identification key
Logic Flow:
IF SCAC code and bill number have been extracted from M11 segment
AND The system needs to create a cargo identification key
THEN:
• The system combines the SCAC code and bill number into a work cargo key and sets message type as CARGO
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when message type has been determined (train or cargo).
Trigger Criteria:
Context: A message type has been determined (TRAIN or CARGO)
Applied to: Manifest Type = 'P', 'X', 'Y', 'T', 'S'?
Action: The manifest type code (M10-09-MANIFEST-TYP-CDE) is 'P', 'X', 'Y', 'T', or 'S'
Logic Flow:
IF A message type has been determined (TRAIN or CARGO)
AND The manifest type code (M10-09-MANIFEST-TYP-CDE) is 'P', 'X', 'Y', 'T', or 'S'
THEN:
• The system sets the flag to update status during processing
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when message type is train and manifest type is not 'p', 'x', 'y', 't', or 's'.
Trigger Criteria:
Context: The message type is TRAIN and manifest type is not 'P', 'X', 'Y', 'T', or 'S'
Applied to: Manifest Type = 'H' and TRAIN?
Action: The manifest type code (M10-09-MANIFEST-TYP-CDE) is 'H'
Logic Flow:
IF The message type is TRAIN and manifest type is not 'P', 'X', 'Y', 'T', or 'S'
AND The manifest type code (M10-09-MANIFEST-TYP-CDE) is 'H'
THEN:
• The system sets the flag to delete status during processing
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when message type has been determined.
Trigger Criteria:
Context: A message type has been determined
Applied to: Set Should Not Update Status
Action: The manifest type code is not 'P', 'X', 'Y', 'T', 'S' and is not 'H' for TRAIN messages
Logic Flow:
IF A message type has been determined
AND The manifest type code is not 'P', 'X', 'Y', 'T', 'S' and is not 'H' for TRAIN messages
THEN:
• The system sets the flag to not update status during processing
R-GCX015-cbl-00059 (+5)File: GCX015.cblBusiness Rule: Process Cargo Manifest Information
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when message is being processed for type identification.
Trigger Criteria:
Context: A message is being processed for type identification
Applied to: Message Type Unknown?
Action: The message type has not been determined as TRAIN or CARGO
Logic Flow:
IF A message is being processed for type identification
AND The message type has not been determined as TRAIN or CARGO
THEN:
• The system should proceed to check for M11 segment to identify cargo information
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when message with unknown type is being processed.
Trigger Criteria:
Context: A message with unknown type is being processed
Applied to: M11 Segment Found?
Action: The current message segment has table ID equal to 'M11'
Logic Flow:
IF A message with unknown type is being processed
AND The current message segment has table ID equal to 'M11'
THEN:
• The system should process the M11 segment to extract cargo information
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when m11 segment is being processed for cargo identification.
Trigger Criteria:
Context: An M11 segment is being processed for cargo identification
Applied to: Extract SCAC Code from M11-12-SCAC
Action: The M11 segment contains SCAC information in field M11-12-SCAC
Logic Flow:
IF An M11 segment is being processed for cargo identification
AND The M11 segment contains SCAC information in field M11-12-SCAC
THEN:
• The system should extract the SCAC code and store it in the work SCAC field
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when m11 segment is being processed for cargo identification.
Trigger Criteria:
Context: An M11 segment is being processed for cargo identification
Applied to: Extract Bill Number from M11-01-BOL-WB-NUM
Action: The M11 segment contains bill information in field M11-01-BOL-WB-NUM
Logic Flow:
IF An M11 segment is being processed for cargo identification
AND The M11 segment contains bill information in field M11-01-BOL-WB-NUM
THEN:
• The system should extract the bill number and store it in the work bill number field
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when scac code and bill number have been extracted from m11 segment.
Trigger Criteria:
Context: SCAC code and bill number have been extracted from M11 segment
Applied to: Build Cargo Key from SCAC and Bill Number
Action: Both SCAC and bill number values are available
Logic Flow:
IF SCAC code and bill number have been extracted from M11 segment
AND Both SCAC and bill number values are available
THEN:
• The system should combine the SCAC and bill number into a work cargo key and store it as the M10-12 data for processing
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when cargo key has been successfully built from m11 segment information.
Trigger Criteria:
Context: Cargo key has been successfully built from M11 segment information
Applied to: Set Message Type as Cargo
Action: The cargo identification process is complete
Logic Flow:
IF Cargo key has been successfully built from M11 segment information
AND The cargo identification process is complete
THEN:
• The system should set the message type indicator to CARGO for subsequent processing
R-GCX015-cbl-00065 (+3)File: GCX015.cblBusiness Rule: Set Status Update Actions
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when m10 segment is being processed with a manifest type code.
Trigger Criteria:
Context: An M10 segment is being processed with a manifest type code
Applied to: P, X, Y, T, S
Action: The manifest type code is P, X, Y, T, or S
Logic Flow:
IF An M10 segment is being processed with a manifest type code
AND The manifest type code is P, X, Y, T, or S
THEN:
• The system should set the status update action to allow status updates
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when m10 segment is being processed with a manifest type code.
Trigger Criteria:
Context: An M10 segment is being processed with a manifest type code
Applied to: Set NO UPDATE Status Action Other Types
Action: The manifest type code is not P, X, Y, T, or S
Logic Flow:
IF An M10 segment is being processed with a manifest type code
AND The manifest type code is not P, X, Y, T, or S
THEN:
• The system should set the status update action to prevent status updates
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train is being processed with an m10 segment containing manifest type code.
Trigger Criteria:
Context: A train is being processed with an M10 segment containing manifest type code
Applied to: H for Trains
Action: The manifest type code is H
Logic Flow:
IF A train is being processed with an M10 segment containing manifest type code
AND The manifest type code is H
THEN:
• The system should set the delete status action to allow status deletion
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train is being processed with an m10 segment containing manifest type code.
Trigger Criteria:
Context: A train is being processed with an M10 segment containing manifest type code
Applied to: Set NO DELETE Status Action Other Types for Trains
Action: The manifest type code is not H
Logic Flow:
IF A train is being processed with an M10 segment containing manifest type code
AND The manifest type code is not H
THEN:
• The system should set the delete status action to prevent status deletion
R-GCX015-cbl-00069 (+7)File: GCX015.cblBusiness Rule: Process Message Segments
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message segment with table id 'm10' is encountered during message processing.
Trigger Criteria:
Context: A message segment with table ID 'M10' is encountered during message processing
Applied to: Process M10 Segment
Action: The system processes the M10 segment
Logic Flow:
IF A message segment with table ID 'M10' is encountered during message processing
AND The system processes the M10 segment
THEN:
• The M10 segment data is stored and the M10 segment found flag is set to true
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message segment with table id 'p4 ' is encountered during message processing.
Trigger Criteria:
Context: A message segment with table ID 'P4 ' is encountered during message processing
Applied to: Process P4 Segment
Action: The system processes the P4 segment
Logic Flow:
IF A message segment with table ID 'P4 ' is encountered during message processing
AND The system processes the P4 segment
THEN:
• The P4 segment data is stored and the P4 segment found flag is set to true
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message segment with table id 'n10' is encountered during message processing.
Trigger Criteria:
Context: A message segment with table ID 'N10' is encountered during message processing
Applied to: Process N10 Segment
Action: The system processes the N10 segment
Logic Flow:
IF A message segment with table ID 'N10' is encountered during message processing
AND The system processes the N10 segment
THEN:
• The line release number from position 09 is extracted and stored in the hold area
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when k1 segment is being processed with a message number.
Trigger Criteria:
Context: A K1 segment is being processed with a message number
Applied to: Look Up Error Message Text
Action: The system looks up the message number in the MS table with prefix 'A'
Logic Flow:
IF A K1 segment is being processed with a message number
AND The system looks up the message number in the MS table with prefix 'A'
THEN:
• If found, the English text from the table is used; if not found, the free-form message from K1 segment is used
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when k1 segment with message number '242' is processed and n10 line release number data exists.
Trigger Criteria:
Context: A K1 segment with message number '242' is processed and N10 line release number data exists
Applied to: Build Error Description
Action: The system builds the error description
Logic Flow:
IF A K1 segment with message number '242' is processed and N10 line release number data exists
AND The system builds the error description
THEN:
• An additional message line with 'C4 CODE=' followed by the line release number is added to the processing log
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message segment with table id 'k3 ' is encountered during message processing.
Trigger Criteria:
Context: A message segment with table ID 'K3 ' is encountered during message processing
Applied to: Process K3 Segment
Action: The system processes the K3 segment
Logic Flow:
IF A message segment with table ID 'K3 ' is encountered during message processing
AND The system processes the K3 segment
THEN:
• The K3 segment data is stored and the K3 segment found flag is set to true
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when message segments are being processed sequentially.
Trigger Criteria:
Context: Message segments are being processed sequentially
Applied to: End of Message?
Action: A segment with table ID containing only spaces or low-values is encountered
Logic Flow:
IF Message segments are being processed sequentially
AND A segment with table ID containing only spaces or low-values is encountered
THEN:
• The end found flag is set to true and segment processing terminates
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message segment has been processed (except k1 segments which handle their own logging).
Trigger Criteria:
Context: A message segment has been processed (except K1 segments which handle their own logging)
Applied to: Add Segment to Processing Log
Action: The segment processing is complete
Logic Flow:
IF A message segment has been processed (except K1 segments which handle their own logging)
AND The segment processing is complete
THEN:
• The segment data from positions 1-69 is added to the processing log and the line counter is incremented
R-GCX015-cbl-00077 (+4)File: GCX015.cblBusiness Rule: Skip Test Messages
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when message queue entry contains an m10 segment with table id 'm10'.
Trigger Criteria:
Context: A message queue entry contains an M10 segment with table ID 'M10'
Applied to: Test Train Message TRAINCPRSTESTTRAIN0000000000
Action: The M10 table reference number equals 'TRAINCPRSTESTTRAIN0000000000'
Logic Flow:
IF A message queue entry contains an M10 segment with table ID 'M10'
AND The M10 table reference number equals 'TRAINCPRSTESTTRAIN0000000000'
THEN:
• The system performs special check processing, clears the message array, sets end processing flag, and terminates current message processing
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when message queue entry contains an m10 segment with table id 'm10'.
Trigger Criteria:
Context: A message queue entry contains an M10 segment with table ID 'M10'
Applied to: Test Cargo Message CARGOCPRS940000000000
Action: The M10 table reference number equals 'CARGOCPRS940000000000'
Logic Flow:
IF A message queue entry contains an M10 segment with table ID 'M10'
AND The M10 table reference number equals 'CARGOCPRS940000000000'
THEN:
• The system performs special check processing, clears the message array, sets end processing flag, and terminates current message processing
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when message queue entry contains an m10 segment with table id 'm10'.
Trigger Criteria:
Context: A message queue entry contains an M10 segment with table ID 'M10'
Applied to: Continue Normal Processing
Action: The M10 table reference number is not 'TRAINCPRSTESTTRAIN0000000000' and not 'CARGOCPRS940000000000'
Logic Flow:
IF A message queue entry contains an M10 segment with table ID 'M10'
AND The M10 table reference number is not 'TRAINCPRSTESTTRAIN0000000000' and not 'CARGOCPRS940000000000'
THEN:
• The system proceeds with normal M10 segment processing workflow
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when test message has been identified with manifest type code.
Trigger Criteria:
Context: A test message has been identified with manifest type code
Applied to: Update Administrative Timestamps
Action: The manifest type code is 'P', 'H', or 'S'
Logic Flow:
IF A test message has been identified with manifest type code
AND The manifest type code is 'P', 'H', or 'S'
THEN:
• The system updates the corresponding acknowledgment timestamp field in the T1 administrative table with current machine date, century, and time
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when test message has been processed and administrative timestamps updated.
Trigger Criteria:
Context: A test message has been processed and administrative timestamps updated
Applied to: Clear Message Array
Action: The special check processing is completed
Logic Flow:
IF A test message has been processed and administrative timestamps updated
AND The special check processing is completed
THEN:
• The system moves spaces to the message array and sets the end found flag to true
Business Justification: Dictates the expected operational logic and validation steps when message is being processed for segment validation.
Trigger Criteria:
Context: A message is being processed for segment validation
Applied to: M10 Segment Found?
Action: The system checks for M10 segment presence using the M10 segment found flag
Logic Flow:
IF A message is being processed for segment validation
AND The system checks for M10 segment presence using the M10 segment found flag
THEN:
• If M10 segment is not found, generate error message 'M10 SEGMENT NOT FOUND ON 355 TRANSACTION' and increment line counter
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when message is being processed for segment validation and m10 validation is complete.
Trigger Criteria:
Context: A message is being processed for segment validation and M10 validation is complete
Applied to: P4 Segment Found?
Action: The system checks for P4 segment presence using the P4 segment found flag
Logic Flow:
IF A message is being processed for segment validation and M10 validation is complete
AND The system checks for P4 segment presence using the P4 segment found flag
THEN:
• If P4 segment is not found, generate error message 'P4 SEGMENT NOT FOUND ON 355 TRANSACTION' and increment line counter
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message is being processed for segment validation and m10 and p4 validations are complete.
Trigger Criteria:
Context: A message is being processed for segment validation and M10 and P4 validations are complete
Applied to: K3 Segment Found?
Action: The system checks for K3 segment presence using the K3 segment found flag
Logic Flow:
IF A message is being processed for segment validation and M10 and P4 validations are complete
AND The system checks for K3 segment presence using the K3 segment found flag
THEN:
• If K3 segment is not found, generate error message 'K3 SEGMENT NOT FOUND ON 355 TRANSACTION' and increment line counter
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when k3 segment is not found in the message.
Trigger Criteria:
Context: K3 segment is not found in the message
Applied to: Create Default K3 Segment with Current Date/Time
Action: The system processes the missing K3 segment condition
Logic Flow:
IF K3 segment is not found in the message
AND The system processes the missing K3 segment condition
THEN:
• Create a default K3 segment by setting K3 segment found flag to true, populate K3-03-DATE with current machine date, populate K3-04-TIME with current machine time first 6 positions, and move the constructed K3 data to K3-SEGMENT
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when default k3 segment has been created with current date and time.
Trigger Criteria:
Context: A default K3 segment has been created with current date and time
Applied to: Set Final Status Based on Default K3
Action: The system processes the default K3 segment for status determination
Logic Flow:
IF A default K3 segment has been created with current date and time
AND The system processes the default K3 segment for status determination
THEN:
• If K3 total reject count equals zero and K3 total accept count is greater than zero, set ACK status, elseif both counts are zero, set ACK status and add warning message 'USCS K3 RECORD HAS ZERO COUNTS' to hold messages and increment K1 counter, else set ERROR status
R-GCX015-cbl-00087 (+6)File: GCX015.cblBusiness Rule: Process Rejection Information
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when k3 segment has been received with rejection and acceptance counts.
Trigger Criteria:
Context: A K3 segment has been received with rejection and acceptance counts
Applied to: Total Reject = 0?
Action: The total rejection count (K3-11-TOTAL-REJECT) is greater than zero
Logic Flow:
IF A K3 segment has been received with rejection and acceptance counts
AND The total rejection count (K3-11-TOTAL-REJECT) is greater than zero
THEN:
• Set the status to ERROR and generate error processing
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when k3 segment has zero rejection counts.
Trigger Criteria:
Context: A K3 segment has zero rejection counts
Applied to: Total Accept > 0?
Action: The total acceptance count (K3-12-TOTAL-ACCEPT) is greater than zero
Logic Flow:
IF A K3 segment has zero rejection counts
AND The total acceptance count (K3-12-TOTAL-ACCEPT) is greater than zero
THEN:
• Proceed to evaluate train-specific status conditions for final status determination
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when k3 segment has zero rejection counts.
Trigger Criteria:
Context: A K3 segment has zero rejection counts
Applied to: Log Zero Counts Message
Action: The total acceptance count (K3-12-TOTAL-ACCEPT) is also zero
Logic Flow:
IF A K3 segment has zero rejection counts
AND The total acceptance count (K3-12-TOTAL-ACCEPT) is also zero
THEN:
• Log warning message 'USCS K3 RECORD HAS ZERO COUNTS' and set ACK status
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train record exists with valid acceptance counts and zero rejections.
Trigger Criteria:
Context: A train record exists with valid acceptance counts and zero rejections
Applied to: Set PRE-ARRIVAL Status
Action: The train status indicates PRE-ARRIVED condition (GCWTL-PRE-ARRIVED is true)
Logic Flow:
IF A train record exists with valid acceptance counts and zero rejections
AND The train status indicates PRE-ARRIVED condition (GCWTL-PRE-ARRIVED is true)
THEN:
• Set the processing status to PRE-ARRIVAL
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train record exists with valid acceptance counts and zero rejections.
Trigger Criteria:
Context: A train record exists with valid acceptance counts and zero rejections
Applied to: Set REVIEW-COMPLETED Status
Action: The train status indicates REVIEW-CMPL condition (GCWTL-REVIEW-CMPL is true)
Logic Flow:
IF A train record exists with valid acceptance counts and zero rejections
AND The train status indicates REVIEW-CMPL condition (GCWTL-REVIEW-CMPL is true)
THEN:
• Set the processing status to REVIEW-COMPLETED
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train record exists with valid acceptance counts and zero rejections.
Trigger Criteria:
Context: A train record exists with valid acceptance counts and zero rejections
Applied to: Set ACK Status
Action: The train is neither in PRE-ARRIVED nor REVIEW-CMPL state
Logic Flow:
IF A train record exists with valid acceptance counts and zero rejections
AND The train is neither in PRE-ARRIVED nor REVIEW-CMPL state
THEN:
• Set the processing status to ACK (acknowledgment)
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when k3 segment has been processed.
Trigger Criteria:
Context: A K3 segment has been processed
Applied to: Set ERROR Status
Action: The total rejection count (K3-11-TOTAL-REJECT) is greater than zero
Logic Flow:
IF A K3 segment has been processed
AND The total rejection count (K3-11-TOTAL-REJECT) is greater than zero
THEN:
• Set the processing status to ERROR
R-GCX015-cbl-00094 (+7)File: GCX015.cblBusiness Rule: Determine Final Status
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when k3 segment has been processed with total reject and accept counts.
Trigger Criteria:
Context: A K3 segment has been processed with total reject and accept counts
Applied to: Total Rejects = 0?
Action: The system evaluates the total reject count
Logic Flow:
IF A K3 segment has been processed with total reject and accept counts
AND The system evaluates the total reject count
THEN:
• If total rejects equal zero, proceed to acceptance validation; otherwise set error status
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when k3 segment has zero total rejects.
Trigger Criteria:
Context: A K3 segment has zero total rejects
Applied to: Total Accepts > 0?
Action: The system evaluates the total accept count
Logic Flow:
IF A K3 segment has zero total rejects
AND The system evaluates the total accept count
THEN:
• If total accepts are greater than zero, proceed to train status evaluation; if total accepts equal zero, log zero counts message and set ACK status
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train transaction has zero rejects and positive accepts.
Trigger Criteria:
Context: A train transaction has zero rejects and positive accepts
Applied to: Train Status Check
Action: The system evaluates the current train status flags
Logic Flow:
IF A train transaction has zero rejects and positive accepts
AND The system evaluates the current train status flags
THEN:
• If train is in PRE-ARRIVED state, set PRE-ARRIVAL status; if train is in REVIEW-CMPL state, set REVIEW-COMPLETED status; otherwise set standard ACK status
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train transaction has zero rejects, positive accepts, and train is in pre-arrived state.
Trigger Criteria:
Context: A train transaction has zero rejects, positive accepts, and train is in PRE-ARRIVED state
Applied to: Set PRE-ARRIVAL Status
Action: The system sets the final processing status
Logic Flow:
IF A train transaction has zero rejects, positive accepts, and train is in PRE-ARRIVED state
AND The system sets the final processing status
THEN:
• The status is set to PRE-ARRIVAL to indicate successful pre-clearance processing
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train transaction has zero rejects, positive accepts, and train is in review-cmpl state.
Trigger Criteria:
Context: A train transaction has zero rejects, positive accepts, and train is in REVIEW-CMPL state
Applied to: Set REVIEW-COMPLETED Status
Action: The system sets the final processing status
Logic Flow:
IF A train transaction has zero rejects, positive accepts, and train is in REVIEW-CMPL state
AND The system sets the final processing status
THEN:
• The status is set to REVIEW-COMPLETED to indicate successful completion of review process
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when transaction has zero rejects and positive accepts, and is either cargo or train not in special states.
Trigger Criteria:
Context: A transaction has zero rejects and positive accepts, and is either cargo or train not in special states
Applied to: Set ACK Status
Action: The system sets the final processing status
Logic Flow:
IF A transaction has zero rejects and positive accepts, and is either cargo or train not in special states
AND The system sets the final processing status
THEN:
• The status is set to ACK to indicate successful transaction acknowledgment
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when k3 segment has zero total rejects and zero total accepts.
Trigger Criteria:
Context: A K3 segment has zero total rejects and zero total accepts
Applied to: Log Zero Counts Message
Action: The system processes the transaction
Logic Flow:
IF A K3 segment has zero total rejects and zero total accepts
AND The system processes the transaction
THEN:
• A warning message 'USCS K3 RECORD HAS ZERO COUNTS' is logged and ACK status is still assigned
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when k3 segment has total rejects greater than zero.
Trigger Criteria:
Context: A K3 segment has total rejects greater than zero
Applied to: Set ERROR Status
Action: The system evaluates the transaction results
Logic Flow:
IF A K3 segment has total rejects greater than zero
AND The system evaluates the transaction results
THEN:
• The status is set to ERROR to indicate transaction processing failures
R-GCX015-cbl-00102 (+7)File: GCX015.cblBusiness Rule: Handle Special Train Status
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when k3 segment is being processed for train or cargo status.
Trigger Criteria:
Context: A K3 segment is being processed for train or cargo status
Applied to: Total Rejects = 0?
Action: The K3 total reject count is greater than zero
Logic Flow:
IF A K3 segment is being processed for train or cargo status
AND The K3 total reject count is greater than zero
THEN:
• The system sets the status to ERROR and stops further acceptance processing
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when k3 segment has zero rejection records.
Trigger Criteria:
Context: A K3 segment has zero rejection records
Applied to: Total Accepts > 0?
Action: The K3 total accept count is greater than zero
Logic Flow:
IF A K3 segment has zero rejection records
AND The K3 total accept count is greater than zero
THEN:
• The system proceeds to evaluate train status conditions for appropriate status assignment
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when k3 segment has zero rejection records.
Trigger Criteria:
Context: A K3 segment has zero rejection records
Applied to: Log Zero Counts Message
Action: The K3 total accept count is also zero
Logic Flow:
IF A K3 segment has zero rejection records
AND The K3 total accept count is also zero
THEN:
• The system logs 'USCS K3 RECORD HAS ZERO COUNTS' message and sets status to ACK
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when k3 segment has zero rejections and positive acceptance count.
Trigger Criteria:
Context: A K3 segment has zero rejections and positive acceptance count
Applied to: Train Current Status?
Action: The system evaluates the current train status condition
Logic Flow:
IF A K3 segment has zero rejections and positive acceptance count
AND The system evaluates the current train status condition
THEN:
• The system branches to set PRE-ARRIVAL, REVIEW-COMPLETED, or ACK status based on current train state
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train has positive acceptance count and zero rejections.
Trigger Criteria:
Context: A train has positive acceptance count and zero rejections
Applied to: Set PRE-ARRIVAL Status
Action: The train current status is PRE-ARRIVED (GCWTL-PRE-ARRIVED is true)
Logic Flow:
IF A train has positive acceptance count and zero rejections
AND The train current status is PRE-ARRIVED (GCWTL-PRE-ARRIVED is true)
THEN:
• The system sets the working status to PRE-ARRIVAL-STATUS
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train has positive acceptance count and zero rejections.
Trigger Criteria:
Context: A train has positive acceptance count and zero rejections
Applied to: Set REVIEW-COMPLETED Status
Action: The train current status is REVIEW-CMPL (GCWTL-REVIEW-CMPL is true)
Logic Flow:
IF A train has positive acceptance count and zero rejections
AND The train current status is REVIEW-CMPL (GCWTL-REVIEW-CMPL is true)
THEN:
• The system sets the working status to REVIEW-COMPLETED-STATUS
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train has positive acceptance count and zero rejections.
Trigger Criteria:
Context: A train has positive acceptance count and zero rejections
Applied to: Set ACK Status
Action: The train is not in PRE-ARRIVED or REVIEW-CMPL status
Logic Flow:
IF A train has positive acceptance count and zero rejections
AND The train is not in PRE-ARRIVED or REVIEW-CMPL status
THEN:
• The system sets the working status to ACK-STATUS
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when k3 segment is being processed for status determination.
Trigger Criteria:
Context: A K3 segment is being processed for status determination
Applied to: Set ERROR Status
Action: The K3 total reject count is greater than zero
Logic Flow:
IF A K3 segment is being processed for status determination
AND The K3 total reject count is greater than zero
THEN:
• The system sets the working status to ERROR-STATUS
Business Justification: Establishes the required business protocol to be followed when error condition has been detected and requires notification.
Trigger Criteria:
Context: An error condition has been detected and requires notification
Applied to: Set Primary Recipients - OM01247 as FROM and TO
Action: Setting up primary error notification recipients
Logic Flow:
IF An error condition has been detected and requires notification
AND Setting up primary error notification recipients
THEN:
• The system sets OM01247 as both the sender (FROM) and primary recipient (TO) for error messages
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when primary error notification setup is complete. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Primary error notification setup is complete
Applied to: Set Secondary Recipients - From Admin Table Configuration
AND Configuring secondary error notification recipients
THEN:
• The system retrieves recipient identifiers from administrative table segment AD-DC-P-MERLIN-1 for TO recipient andAD-DC-P-MERLIN-5 for COPY recipient
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when error notification recipients are configured.
Trigger Criteria:
Context: Error notification recipients are configured
Applied to: Include Merlin Error Report with Message Details
Action: Preparing error message content for transmission
Logic Flow:
IF Error notification recipients are configured
AND Preparing error message content for transmission
THEN:
• The system includes the Merlin subject as the message subject and the complete Merlin error report as the message content
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when error message content is prepared with primary recipients configured. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Error message content is prepared with primary recipients configured
Applied to: Call EMCSEND2 for Primary Notification
Action: Transmitting the primary error notification
Logic Flow:
IF Error message content is prepared with primary recipients configured
AND Transmitting the primary error notification
THEN:
• The system calls EMCSEND2 service with sender, destination filename, recipients, subject, and error report content
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when primary error notification has been transmitted via emcsend2.
Trigger Criteria:
Context: Primary error notification has been transmitted via EMCSEND2
Applied to: Primary Send Successful?
Action: Checking the transmission result status
Logic Flow:
IF Primary error notification has been transmitted via EMCSEND2
AND Checking the transmission result status
THEN:
• The system evaluates if the notification was successful based on EMI-NO-ERRORS status and proceeds to secondary notification if successful
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when primary error notification was successful and secondary recipients are configured from administrative table. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Primary error notification was successful and secondary recipients are configured from administrative table
Applied to: Call EMCSEND2 for Secondary Notification
Action: Transmitting the secondary error notification
Logic Flow:
IF Primary error notification was successful and secondary recipients are configured from administrative table
AND Transmitting the secondary error notification
THEN:
• The system calls EMCSEND2 service with administrative table recipients and the same error message content
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when secondary error notification has been transmitted via emcsend2.
Trigger Criteria:
Context: Secondary error notification has been transmitted via EMCSEND2
Applied to: Secondary Send Successful?
Action: Checking the secondary transmission result status
Logic Flow:
IF Secondary error notification has been transmitted via EMCSEND2
AND Checking the secondary transmission result status
THEN:
• The system evaluates if the secondary notification was successful based on EMI-NO-ERRORS status and completes the error notification process if successful
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when primary error notification transmission has failed.
Trigger Criteria:
Context: Primary error notification transmission has failed
Applied to: Handle Primary Send Failure
Action: The EMCSEND2 service returns a failure status for primary notification
Logic Flow:
IF Primary error notification transmission has failed
AND The EMCSEND2 service returns a failure status for primary notification
THEN:
• The system triggers an abend process due to critical send failure for invalid sender, recipient, or filename conditions
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when secondary error notification transmission has failed.
Trigger Criteria:
Context: Secondary error notification transmission has failed
Applied to: Handle Secondary Send Failure
Action: The EMCSEND2 service returns a failure status for secondary notification
Logic Flow:
IF Secondary error notification transmission has failed
AND The EMCSEND2 service returns a failure status for secondary notification
THEN:
• The system triggers an abend process due to critical send failure for invalid sender, recipient, or filename conditions
Business Justification: Establishes the required business protocol to be followed when message processing operation has completed.
Trigger Criteria:
Context: A message processing operation has completed
Applied to: Send Error Message via EMCSEND
Action: The processing resulted in an error status condition
Logic Flow:
IF A message processing operation has completed
AND The processing resulted in an error status condition
THEN:
• The system sends an error notification message via EMCSEND service
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when message processing operation requires logging.
Trigger Criteria:
Context: A message processing operation requires logging
Applied to: Move Log Information to GCX105
Action: Log information needs to be recorded
Logic Flow:
IF A message processing operation requires logging
AND Log information needs to be recorded
THEN:
• The system populates GCX105 structure with security byte, sending transaction code, ACF2 user ID, processing date from machine century and K3 date, and processing time from K3 segment
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when shipment entity needs to be logged.
Trigger Criteria:
Context: A shipment entity needs to be logged
Applied to: Set Train or Cargo Identifier
Action: The entity type needs to be identified for logging purposes
Logic Flow:
IF A shipment entity needs to be logged
AND The entity type needs to be identified for logging purposes
THEN:
• The system sets the train or cargo identifier in the GCX105 structure using the work M10-12 data
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when entity being processed is identified as a train.
Trigger Criteria:
Context: The entity being processed is identified as a train
Applied to: Set US-TRAIN Flag
Action: The entity type flag needs to be set for logging
Logic Flow:
IF The entity being processed is identified as a train
AND The entity type flag needs to be set for logging
THEN:
• The system sets the GCX105-US-TRAIN flag to true
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when entity being processed is identified as cargo.
Trigger Criteria:
Context: The entity being processed is identified as cargo
Applied to: Set US-CARGO Flag
Action: The entity type flag needs to be set for logging
Logic Flow:
IF The entity being processed is identified as cargo
AND The entity type flag needs to be set for logging
THEN:
• The system sets the GCX105-US-CARGO flag to true
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when log entry is being prepared for transmission.
Trigger Criteria:
Context: A log entry is being prepared for transmission
Applied to: Set Action Code to 'ZZZ'
Action: The action code needs to be set
Logic Flow:
IF A log entry is being prepared for transmission
AND The action code needs to be set
THEN:
• The system sets the GCX105-ACTION-CODE to 'ZZZ'
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when status information needs to be included in log messages. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Status information needs to be included in log messages
Applied to: Move Status to Message Fields
Action: Message fields are being populated
Logic Flow:
IF Status information needs to be included in log messages
AND Message fields are being populated
THEN:
• The system moves the current WS-STATUS to USCS-MESSAGE1, USCS-MESSAGE2, andUSCS-MESSAGE3 fields
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when cargo entity is being processed and status should be updated.
Trigger Criteria:
Context: A cargo entity is being processed and status should be updated
Applied to: Use Manifest Reply Message Format
Action: The message format needs to be determined for logging
Logic Flow:
IF A cargo entity is being processed and status should be updated
AND The message format needs to be determined for logging
THEN:
• The system uses USCS-LOG-MESSAGE1 format and moves it to GCX105-MESSAGE
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train entity is being processed and status should be updated.
Trigger Criteria:
Context: A train entity is being processed and status should be updated
Applied to: Use Train Reply Message Format
Action: The message format needs to be determined for logging
Logic Flow:
IF A train entity is being processed and status should be updated
AND The message format needs to be determined for logging
THEN:
• The system uses USCS-LOG-MESSAGE2 format and moves it to GCX105-MESSAGE
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when entity is being processed but status should not be updated.
Trigger Criteria:
Context: An entity is being processed but status should not be updated
Applied to: Use Other Reply Message Format
Action: The message format needs to be determined for logging
Logic Flow:
IF An entity is being processed but status should not be updated
AND The message format needs to be determined for logging
THEN:
• The system uses USCS-LOG-MESSAGE3 format, moves it to GCX105-MESSAGE, andif the entity is a train with AEI-SEND flag, performs AEI status message processing
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when log entry has been prepared with all required information.
Trigger Criteria:
Context: A log entry has been prepared with all required information
Applied to: Send Log via GCT1051E Transaction
Action: The primary log needs to be transmitted
Logic Flow:
IF A log entry has been prepared with all required information
AND The primary log needs to be transmitted
THEN:
• The system calls Z300-SPAWN-GCT1051E to send the log entry using GCT1051E transaction
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when k1 error messages are present in the hold-k1-message table.
Trigger Criteria:
Context: K1 error messages are present in the HOLD-K1-MESSAGE table
Applied to: Process Each K1 Error Message
Action: Error messages need to be processed for logging
Logic Flow:
IF K1 error messages are present in the HOLD-K1-MESSAGE table
AND Error messages need to be processed for logging
THEN:
• The system performs A501-SEND-LOG for each K1-CNT from 1 by 1 until HOLD-K1-MESSAGE is spaces orK1-CNT exceeds 999
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when k1 error message exists and is not spaces.
Trigger Criteria:
Context: A K1 error message exists and is not spaces
Applied to: Set Message Details for K1 Entry
Action: An individual K1 log entry needs to be prepared
Logic Flow:
IF A K1 error message exists and is not spaces
AND An individual K1 log entry needs to be prepared
THEN:
• The system moves log information to GCX105, sets the train or cargo identifier, sets the appropriate entity type flag, sets action code to 'ZZZ', and moves the specific K1 message to GCX105-MESSAGE
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when k1 error log entry has been prepared.
Trigger Criteria:
Context: A K1 error log entry has been prepared
Applied to: Send K1 Log Entry via GCT1051E
Action: The K1 error log needs to be transmitted
Logic Flow:
IF A K1 error log entry has been prepared
AND The K1 error log needs to be transmitted
THEN:
• The system calls Z300-SPAWN-GCT1051E to send the K1 error log entry using GCT1051E transaction
R-GCX015-cbl-00133 (+14)File: GCX015.cblBusiness Rule: Process K1 Error Messages
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when k1 segment is detected in the message processing loop.
Trigger Criteria:
Context: A K1 segment is detected in the message processing loop
Applied to: K1 Segment Detected
Action: The system processes the K1 segment entry
Logic Flow:
IF A K1 segment is detected in the message processing loop
AND The system processes the K1 segment entry
THEN:
• The K1 segment data should be extracted and prepared for message lookup processing
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when k1 segment contains message data in mqs-table-entry format.
Trigger Criteria:
Context: A K1 segment contains message data in MQS-TABLE-ENTRY format
Applied to: Extract Message Number from K1-02-MSG-NUMBER
Action: The system processes the K1 segment
Logic Flow:
IF A K1 segment contains message data in MQS-TABLE-ENTRY format
AND The system processes the K1 segment
THEN:
• The message number should be extracted from K1-02-MSG-NUMBER field
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message number has been extracted from k1-02-msg-number.
Trigger Criteria:
Context: A message number has been extracted from K1-02-MSG-NUMBER
Applied to: 'A' + Message Number
Action: The system needs to look up the message in the MS table
Logic Flow:
IF A message number has been extracted from K1-02-MSG-NUMBER
AND The system needs to look up the message in the MS table
THEN:
• The table key should be constructed by concatenating 'A' with the message number and stored in GCSTBRT-KEY-SEQID
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when table key has been constructed for message lookup. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A table key has been constructed for message lookup
Applied to: Look Up Message in MS Table
Action: The system performs the table lookup
Logic Flow:
IF A table key has been constructed for message lookup
AND The system performs the table lookup
THEN:
• The system should set table ID to 'MS', function code to 'GU', accept status to 'GE', clear return flags, and call the table lookup service
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when table lookup has been performed for the message number.
Trigger Criteria:
Context: A table lookup has been performed for the message number
Applied to: Message Found in Table?
Action: The lookup return flag is evaluated
Logic Flow:
IF A table lookup has been performed for the message number
AND The lookup return flag is evaluated
THEN:
• If return flag equals '0' then use English text from table, otherwise use free-form message from K1 segment
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when table lookup was successful with return flag '0'.
Trigger Criteria:
Context: The table lookup was successful with return flag '0'
Applied to: Use English Text from GCSTBRT-MS-ENG-TEXT
Action: The system processes the message text
Logic Flow:
IF The table lookup was successful with return flag '0'
AND The system processes the message text
THEN:
• The English text from GCSTBRT-MS-ENG-TEXT should be moved to both report lines and work message fields
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when table lookup failed with return flag not equal to '0'.
Trigger Criteria:
Context: The table lookup failed with return flag not equal to '0'
Applied to: Use Free-Form Message from K1-02-FREE-FORM-MESSAGE
Action: The system processes the message text
Logic Flow:
IF The table lookup failed with return flag not equal to '0'
AND The system processes the message text
THEN:
• The free-form message from K1-02-FREE-FORM-MESSAGE should be moved to both report lines and work message fields
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message text has been determined from either table lookup or free-form source.
Trigger Criteria:
Context: Message text has been determined from either table lookup or free-form source
Applied to: Add Message to Report Lines
Action: The system adds the message to the report
Logic Flow:
IF Message text has been determined from either table lookup or free-form source
AND The system adds the message to the report
THEN:
• The message should be added to MRLN-LINES at the current line count position and the line counter should be incremented by 1
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when work log message has been formatted from the processed message text.
Trigger Criteria:
Context: A work log message has been formatted from the processed message text
Applied to: Store Message in K1 Message Array
Action: The system stores the message for logging
Logic Flow:
IF A work log message has been formatted from the processed message text
AND The system stores the message for logging
THEN:
• The work log message should be moved to HOLD-K1-MESSAGE array at the current K1-CNT position
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when k1 message has been processed and stored.
Trigger Criteria:
Context: A K1 message has been processed and stored
Applied to: Message Number = '242'?
Action: The system checks for special message processing requirements
Logic Flow:
IF A K1 message has been processed and stored
AND The system checks for special message processing requirements
THEN:
• IfK1-02-MSG-NUMBER equals '242' then proceed with C4 code processing, otherwise increment K1 counter and end processing
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when message number '242' has been detected. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Message number '242' has been detected
Applied to: C4 Code Available?
Action: The system checks for C4 code availability
Logic Flow:
IF Message number '242' has been detected
AND The system checks for C4 code availability
THEN:
• IfWS-HOLD-N1009 is not spaces and not low-values then proceed with C4 code message building, otherwise skip C4 processing
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when c4 code is available in ws-hold-n1009 for message 242. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: C4 code is available in WS-HOLD-N1009 for message 242
Applied to: Build C4 Code Message
Action: The system builds the C4 code message
Logic Flow:
IF C4 code is available in WS-HOLD-N1009 for message 242
AND The system builds the C4 code message
THEN:
• The message should be constructed by concatenating 'C4 CODE=' with WS-HOLD-N1009 value and stored in WORK-MESSAGE
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when c4 code message has been constructed.
Trigger Criteria:
Context: A C4 code message has been constructed
Applied to: Add C4 Code to Report
Action: The system adds the C4 message to the report
Logic Flow:
IF A C4 code message has been constructed
AND The system adds the C4 message to the report
THEN:
• The C4 message should be moved to MRLN-LINES at the current line count position and the line counter should be incremented by 1
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when c4 code message has been added to the report. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A C4 code message has been added to the report
Applied to: Store C4 Message in Array
Action: The system stores the C4 message for logging
Logic Flow:
IF A C4 code message has been added to the report
AND The system stores the C4 message for logging
THEN:
• The work log message should be moved to HOLD-K1-MESSAGE array at the current K1-CNT position, K1-CNT should be incremented, andWS-HOLD-N1009 should be cleared to spaces
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when k1 message processing has been completed.
Trigger Criteria:
Context: K1 message processing has been completed
Applied to: Increment K1 Counter
Action: The system finalizes the K1 processing
Logic Flow:
IF K1 message processing has been completed
AND The system finalizes the K1 processing
THEN:
• The K1-CNT counter should be incremented by 1
R-GCX015-cbl-00148 (+8)File: GCX015.cblBusiness Rule: Retrieve Cargo Records
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when system is starting cargo record retrieval process.
Trigger Criteria:
Context: The system is starting cargo record retrieval process
Applied to: Set Cargo Found Flag
Action: The cargo retrieval operation begins
Logic Flow:
IF The system is starting cargo record retrieval process
AND The cargo retrieval operation begins
THEN:
• The cargo found flag (88-USCARGO-TRAIN-FOUND) should be set to true
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when system needs to retrieve cargo records from the database.
Trigger Criteria:
Context: The system needs to retrieve cargo records from the database
Applied to: Initialize Cargo Segment
Action: The cargo retrieval process is initiated
Logic Flow:
IF The system needs to retrieve cargo records from the database
AND The cargo retrieval process is initiated
THEN:
• The cargo segment (GCSUSRT-SEGMENT) should be initialized with spaces
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when system needs to retrieve cargo records from the database.
Trigger Criteria:
Context: The system needs to retrieve cargo records from the database
Applied to: Set Database Function to GET
Action: Setting up the database operation parameters
Logic Flow:
IF The system needs to retrieve cargo records from the database
AND Setting up the database operation parameters
THEN:
• The database function should be set to GET (GCWUSIO-FUNC-GU) and segment type should be set to cargo segment (GCWUSIO-SEG-GCSUSRT) and index usage should be set to not used (GCWUSIO-INDEX-NOT-USED)
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when system has processed message data containing cargo identification information.
Trigger Criteria:
Context: The system has processed message data containing cargo identification information
Applied to: Set US-CCN-KEY from Message Data
Action: Preparing to search for cargo records in the database
Logic Flow:
IF The system has processed message data containing cargo identification information
AND Preparing to search for cargo records in the database
THEN:
• The cargo search key (GCUSRT-US-CCN-KEY) should be set to the message data value (WORK-M10-12-DATA)
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when database operation parameters are configured and the search key is set. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: The database operation parameters are configured and the search key is set
Applied to: Call Database to Get Cargo Record
Action: Executing the cargo record retrieval
Logic Flow:
IF The database operation parameters are configured and the search key is set
AND Executing the cargo record retrieval
THEN:
• The system should call the database interface (GCCUSIO) with the communication control block, operation parameters, and cargo segment
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when database retrieval operation has been executed.
Trigger Criteria:
Context: The database retrieval operation has been executed
Applied to: Cargo Record Found?
Action: Checking the result of the cargo record retrieval
Logic Flow:
IF The database retrieval operation has been executed
AND Checking the result of the cargo record retrieval
THEN:
• If the status code (CC-STATUS-CODE) is not spaces, the cargo record was not found, otherwise the cargo record was found successfully
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when cargo record retrieval operation returned a non-space status code indicating record not found.
Trigger Criteria:
Context: The cargo record retrieval operation returned a non-space status code indicating record not found
Applied to: Set Cargo Not Found Flag
Action: Processing the failed cargo record lookup
Logic Flow:
IF The cargo record retrieval operation returned a non-space status code indicating record not found
AND Processing the failed cargo record lookup
THEN:
• The cargo not found flag (88-USCARGO-TRAIN-NOTFND) should be set to true
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when cargo record was not found in the database.
Trigger Criteria:
Context: The cargo record was not found in the database
Applied to: Add Error Message to Report
Action: Handling the cargo record not found condition
Logic Flow:
IF The cargo record was not found in the database
AND Handling the cargo record not found condition
THEN:
• An error message 'THIS US-CCN-KEY WAS NOT FOUND: ' should be added to the report lines and the line count should be incremented by 1
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when cargo record has been successfully retrieved from the database.
Trigger Criteria:
Context: The cargo record has been successfully retrieved from the database
Applied to: Set Merlin Keys for Reporting
Action: Setting up reporting keys for the found cargo record
Logic Flow:
IF The cargo record has been successfully retrieved from the database
AND Setting up reporting keys for the found cargo record
THEN:
• The Merlin key should be set to the message data value (WORK-M10-12-DATA) and the Merlin sub-key should be set to the cargo equipment car number (GCUSRT-RT081-EQUIPMENT-CAR)
R-GCX015-cbl-00157 (+8)File: GCX015.cblBusiness Rule: Retrieve Train Records
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train record retrieval process needs to be started.
Trigger Criteria:
Context: A train record retrieval process needs to be started
Applied to: Start Train Record Retrieval
Action: The train record retrieval section is invoked
Logic Flow:
IF A train record retrieval process needs to be started
AND The train record retrieval section is invoked
THEN:
• The system should set the train found flag to true and initialize database access parameters
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train record lookup is about to be performed.
Trigger Criteria:
Context: A train record lookup is about to be performed
Applied to: Set Train Found Flag
Action: The train retrieval process begins
Logic Flow:
IF A train record lookup is about to be performed
AND The train retrieval process begins
THEN:
• The system should set the train found flag to true as the default state
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train record needs to be retrieved from the database.
Trigger Criteria:
Context: A train record needs to be retrieved from the database
Applied to: Configure Database Access Parameters
Action: Database access parameters are being configured
Logic Flow:
IF A train record needs to be retrieved from the database
AND Database access parameters are being configured
THEN:
• The system should set the function code to GET, set root-only access, set equal search criteria, and assign the appropriate PCB
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message data contains a train identifier.
Trigger Criteria:
Context: Message data contains a train identifier
Applied to: Set US-CUST-TRAIN-ID from Message Data
Action: Setting up the database search criteria
Logic Flow:
IF Message data contains a train identifier
AND Setting up the database search criteria
THEN:
• The system should move the work message data to the train list US customer train ID field
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when database access parameters are configured and train id is set. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Database access parameters are configured and train ID is set
Applied to: Call Database to Get Train Record
Action: The database lookup is executed
Logic Flow:
IF Database access parameters are configured and train ID is set
AND The database lookup is executed
THEN:
• The system should call the database utility program with the common communication area, database parameters, and train list structure
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when database lookup for a train record has been executed. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A database lookup for a train record has been executed
Applied to: Train Record Found?
Action: Checking the result of the database call
Logic Flow:
IF A database lookup for a train record has been executed
AND Checking the result of the database call
THEN:
• The system should evaluate if the status code is not spaces to determine if the record was found
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train database lookup has been performed.
Trigger Criteria:
Context: A train database lookup has been performed
Applied to: Set Train Not Found Flag
Action: The database status code indicates the record was not found
Logic Flow:
IF A train database lookup has been performed
AND The database status code indicates the record was not found
THEN:
• The system should set the train not found flag to true
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train record lookup has failed.
Trigger Criteria:
Context: A train record lookup has failed
Applied to: Log Train ID Not Found Error
Action: The train ID is not found in the database
Logic Flow:
IF A train record lookup has failed
AND The train ID is not found in the database
THEN:
• The system should move the message 'THIS US-TRAIN-ID WAS NOT FOUND: ' to the error report line and increment the line counter
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train record has been successfully retrieved from the database.
Trigger Criteria:
Context: A train record has been successfully retrieved from the database
Applied to: Set Merlin Keys for Logging
Action: Setting up logging information
Logic Flow:
IF A train record has been successfully retrieved from the database
AND Setting up logging information
THEN:
• The system should move the work message data to the Merlin key and move the train ID to the Merlin sub-key
R-GCX015-cbl-00166 (+4)File: GCX015.cblBusiness Rule: Update Train Status
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train record exists with deleted status and the message contains ack status.
Trigger Criteria:
Context: A train record exists with DELETED status and the message contains ACK status
Applied to: Set Status to DELETED
Action: The train status update process is executed
Logic Flow:
IF A train record exists with DELETED status and the message contains ACK status
AND The train status update process is executed
THEN:
• The train current status should be set to DELETED, security fields should be cleared, and the train record should be updated
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train record exists with delete-pending status and the message contains ack status.
Trigger Criteria:
Context: A train record exists with DELETE-PENDING status and the message contains ACK status
Applied to: Set Status to DELETED
Action: The train status update process is executed
Logic Flow:
IF A train record exists with DELETE-PENDING status and the message contains ACK status
AND The train status update process is executed
THEN:
• The train current status should be set to DELETED and the train record should be updated
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train record exists that is not deleted and not delete-pending.
Trigger Criteria:
Context: A train record exists that is not DELETED and not DELETE-PENDING
Applied to: Set Status from Message
Action: The train status update process is executed
Logic Flow:
IF A train record exists that is not DELETED and not DELETE-PENDING
AND The train status update process is executed
THEN:
• The train current status should be updated with the status from the message and the train record should be updated
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when train record has ack status and arrived-pending flag is set.
Trigger Criteria:
Context: A train record has ACK status and ARRIVED-PENDING flag is set
Applied to: Process Automatic Arrival
Action: The train status update process completes
Logic Flow:
IF A train record has ACK status and ARRIVED-PENDING flag is set
AND The train status update process completes
THEN:
• The automatic train arrival process should be triggered
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train record has been updated with normal status (not deleted or delete pending).
Trigger Criteria:
Context: A train record has been updated with normal status (not deleted or delete pending)
Applied to: Check AEI Qualification
Action: The train status update process continues
Logic Flow:
IF A train record has been updated with normal status (not deleted or delete pending)
AND The train status update process continues
THEN:
• The system should check if the train meets AEI send requirements and process accordingly
R-GCX015-cbl-00171 (+5)File: GCX015.cblBusiness Rule: Update Cargo Status
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when cargo status update is being processed and the final status is ack and there is a saved status description in the save area.
Trigger Criteria:
Context: A cargo status update is being processed AND the final status is ACK AND there is a saved status description in the save area
Applied to: Restore Previous Status from Save Area
Action: The cargo status update is executed
Logic Flow:
IF A cargo status update is being processed AND the final status is ACK AND there is a saved status description in the save area
AND The cargo status update is executed
THEN:
• The saved status is moved to the current USCARGO status AND the saved status description is moved to the current USCARGO short description
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when cargo status update is being processed and the final status is ack and there is no saved status description in the save area.
Trigger Criteria:
Context: A cargo status update is being processed AND the final status is ACK AND there is no saved status description in the save area
Applied to: Set Status to USCARGO-ACK
Action: The cargo status update is executed
Logic Flow:
IF A cargo status update is being processed AND the final status is ACK AND there is no saved status description in the save area
AND The cargo status update is executed
THEN:
• The USCARGO status flag is set to ACK AND the USCARGO short description flag is set to ACK
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when cargo status update is being processed and the final status is error and the current uscargo short description is not error and not ack and not ack-r.
Trigger Criteria:
Context: A cargo status update is being processed AND the final status is ERROR AND the current USCARGO short description is not ERROR AND not ACK AND not ACK-R
Applied to: Save Current Status to Save Area
Action: The cargo status update is executed
Logic Flow:
IF A cargo status update is being processed AND the final status is ERROR AND the current USCARGO short description is not ERROR AND not ACK AND not ACK-R
AND The cargo status update is executed
THEN:
• The current USCARGO status is moved to the save status area AND the current USCARGO short description is moved to the save status description area
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when cargo status update is being processed and the final status is error and the cpcargo status is not deleted.
Trigger Criteria:
Context: A cargo status update is being processed AND the final status is ERROR AND the CPCARGO status is not DELETED
Applied to: Set Cargo Status to ERROR
Action: The cargo status update is executed
Logic Flow:
IF A cargo status update is being processed AND the final status is ERROR AND the CPCARGO status is not DELETED
AND The cargo status update is executed
THEN:
• The CPCARGO status flag is set to ERROR
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when cargo status update is being processed and the final status is error.
Trigger Criteria:
Context: A cargo status update is being processed AND the final status is ERROR
Applied to: Set US Cargo Status to ERROR
Action: The cargo status update is executed
Logic Flow:
IF A cargo status update is being processed AND the final status is ERROR
AND The cargo status update is executed
THEN:
• The USCARGO status flag is set to ERROR AND the USCARGO short description flag is set to ERROR
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when cargo status flags have been updated.
Trigger Criteria:
Context: Cargo status flags have been updated
Applied to: Update Cargo Record in Database
Action: The cargo record update is requested
Logic Flow:
IF Cargo status flags have been updated
AND The cargo record update is requested
THEN:
• The GCSUSRT segment is updated using replace function through the GCCUSIO service
Business Justification: Defines the strict business conditions required to proceed when train record exists in the system.
Trigger Criteria:
Context: A train record exists in the system
Applied to: Train Status = ACK?
Action: The system checks the train's current status for AEI qualification
Logic Flow:
IF A train record exists in the system
AND The system checks the train's current status for AEI qualification
THEN:
• The train must have ACK status to qualify for AEI processing, otherwise it does not qualify
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train record with ack status exists.
Trigger Criteria:
Context: A train record with ACK status exists
Applied to: Train Configured for AEI Send?
Action: The system evaluates the train's AEI send configuration
Logic Flow:
IF A train record with ACK status exists
AND The system evaluates the train's AEI send configuration
THEN:
• The train must have AEI-SEND flag set to true to proceed with full AEI processing
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when train with ack status and aei send configuration enabled.
Trigger Criteria:
Context: A train with ACK status and AEI send configuration enabled
Applied to: Train Enroute Not Yet Reported?
Action: The system checks if the train's enroute status has been reported
Logic Flow:
IF A train with ACK status and AEI send configuration enabled
AND The system checks if the train's enroute status has been reported
THEN:
• The train must have ENROUTE-NOT-REPORTED status to qualify for customs transaction processing
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train with ack status, aei send enabled, and enroute not reported.
Trigger Criteria:
Context: A train with ACK status, AEI send enabled, and enroute not reported
Applied to: Train ID Suffix = 'T'?
Action: The system examines the train ID suffix at position 23
Logic Flow:
IF A train with ACK status, AEI send enabled, and enroute not reported
AND The system examines the train ID suffix at position 23
THEN:
• The train ID must end with 'T' to qualify for full AEI customs transaction processing
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train qualifies for aei processing with all validation criteria met.
Trigger Criteria:
Context: A train qualifies for AEI processing with all validation criteria met
Applied to: Set Up Customs Transaction Data
Action: The system sets up customs transaction data
Logic Flow:
IF A train qualifies for AEI processing with all validation criteria met
AND The system sets up customs transaction data
THEN:
• The system must populate transaction code as 'GCT1461E', security as HIGH-VALUES, customer code as 'A', and map train details to customs fields including train ID, stations, consist number, date and time
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when customs transaction data is set up for a qualified train.
Trigger Criteria:
Context: Customs transaction data is set up for a qualified train
Applied to: Load Train Car Information
Action: The system loads car information from the train consist
Logic Flow:
IF Customs transaction data is set up for a qualified train
AND The system loads car information from the train consist
THEN:
• The system must process each car excluding container indicators 'C', extract equipment initials and numbers, determine loaded/empty status based on next car's container indicator, map equipment types (LO to L, ET to E), and limit processing to maximum 500 cars
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when train car information has been loaded into the customs transaction. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Train car information has been loaded into the customs transaction
Applied to: Send AEI Status Message
Action: The system submits the customs transaction
Logic Flow:
IF Train car information has been loaded into the customs transaction
AND The system submits the customs transaction
THEN:
• The system must call CIMS to change message format, call WRITMSGL to send the customs transaction with message code 'S', and call CIMS to purge the transaction
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train has aei-send configuration enabled but does not meet all qualification criteria for customs processing.
Trigger Criteria:
Context: A train has AEI-SEND configuration enabled but does not meet all qualification criteria for customs processing
Applied to: Send AEI Status Message Only
Action: The system processes AEI status messaging
Logic Flow:
IF A train has AEI-SEND configuration enabled but does not meet all qualification criteria for customs processing
AND The system processes AEI status messaging
THEN:
• The system must retrieve AEI Merlin ID, format status message with train ID and current status, and send via Merlin messaging system
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train has ack status, aei send enabled, and enroute already reported.
Trigger Criteria:
Context: A train has ACK status, AEI send enabled, and enroute already reported
Applied to: Send AEI Status Message Only
Action: The system processes terminal enroute notifications
Logic Flow:
IF A train has ACK status, AEI send enabled, and enroute already reported
AND The system processes terminal enroute notifications
THEN:
• The system must retrieve AEI Merlin ID, format enroute message with train ID, and send notification via Merlin messaging system
R-GCX015-cbl-00186 (+10)File: GCX015.cblBusiness Rule: Load Train Car Information
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when train equipment record is being processed for aei customs reporting.
Trigger Criteria:
Context: A train equipment record is being processed for AEI customs reporting
Applied to: Is Current Equipment a Container?
Action: The equipment has a container indicator of 'C'
Logic Flow:
IF A train equipment record is being processed for AEI customs reporting
AND The equipment has a container indicator of 'C'
THEN:
• The equipment should be skipped and the processing should move to the next equipment record
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when non-container equipment record is being processed.
Trigger Criteria:
Context: A non-container equipment record is being processed
Applied to: Extract Car Initial from Equipment
Action: The equipment initial field contains valid data
Logic Flow:
IF A non-container equipment record is being processed
AND The equipment initial field contains valid data
THEN:
• The equipment initial should be moved to the customs car initial field
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when non-container equipment record is being processed.
Trigger Criteria:
Context: A non-container equipment record is being processed
Applied to: Get Loaded/Empty Status from Current Car
Action: The next equipment record is not a container or does not exist
Logic Flow:
IF A non-container equipment record is being processed
AND The next equipment record is not a container or does not exist
THEN:
• The current equipment's own loaded/empty status indicator should be used for customs reporting
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when non-container equipment record with equipment number is being processed.
Trigger Criteria:
Context: A non-container equipment record with equipment number is being processed
Applied to: Extract Car Number from Equipment
Action: The equipment number field contains valid data
Logic Flow:
IF A non-container equipment record with equipment number is being processed
AND The equipment number field contains valid data
THEN:
• The equipment number should be extracted and converted to a 6-digit car number format for customs output
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when non-container equipment record is being processed and there is a next equipment record in the sequence.
Trigger Criteria:
Context: A non-container equipment record is being processed and there is a next equipment record in the sequence
Applied to: Is Next Equipment a Container?
Action: The next equipment record has a container indicator of 'C'
Logic Flow:
IF A non-container equipment record is being processed and there is a next equipment record in the sequence
AND The next equipment record has a container indicator of 'C'
THEN:
• The current equipment's loaded/empty status should be set to 'L' (Loaded)
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when non-container equipment record is being processed for customs reporting.
Trigger Criteria:
Context: A non-container equipment record is being processed for customs reporting
Applied to: Equipment Type = 'LO'?
Action: The equipment type is 'LO'
Logic Flow:
IF A non-container equipment record is being processed for customs reporting
AND The equipment type is 'LO'
THEN:
• The car kind should be set to 'L' for locomotive
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when non-container equipment record is being processed for customs reporting.
Trigger Criteria:
Context: A non-container equipment record is being processed for customs reporting
Applied to: Set Car Kind as Spaces
Action: The equipment type is neither 'LO' nor 'ET'
Logic Flow:
IF A non-container equipment record is being processed for customs reporting
AND The equipment type is neither 'LO' nor 'ET'
THEN:
• The car kind should be set to spaces
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when non-container equipment record is being processed for customs reporting and the equipment type is not 'lo'.
Trigger Criteria:
Context: A non-container equipment record is being processed for customs reporting and the equipment type is not 'LO'
Applied to: Equipment Type = 'ET'?
Action: The equipment type is 'ET'
Logic Flow:
IF A non-container equipment record is being processed for customs reporting and the equipment type is not 'LO'
AND The equipment type is 'ET'
THEN:
• The car kind should be set to 'E' for engine
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when non-container equipment record has been processed with all required fields populated.
Trigger Criteria:
Context: A non-container equipment record has been processed with all required fields populated
Applied to: Add Car to Customs Output Table
Action: The car initial, number, loaded/empty status, and car kind have been determined
Logic Flow:
IF A non-container equipment record has been processed with all required fields populated
AND The car initial, number, loaded/empty status, and car kind have been determined
THEN:
• The complete car information should be added to the customs output table for transmission
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when non-container equipment record has been successfully added to the customs output table.
Trigger Criteria:
Context: A non-container equipment record has been successfully added to the customs output table
Applied to: Increment Car Counter
Action: The car information has been stored
Logic Flow:
IF A non-container equipment record has been successfully added to the customs output table
AND The car information has been stored
THEN:
• The car counter should be incremented by 1 to maintain accurate count
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when equipment records are being processed for aei customs reporting.
Trigger Criteria:
Context: Equipment records are being processed for AEI customs reporting
Applied to: More Equipment to Process?
Action: The current equipment record processing is complete and there are more equipment records in the train consist
Logic Flow:
IF Equipment records are being processed for AEI customs reporting
AND The current equipment record processing is complete and there are more equipment records in the train consist
THEN:
• Processing should continue with the next equipment record in sequence
R-GCX015-cbl-00197 (+6)File: GCX015.cblBusiness Rule: Send AEI Status Messages
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train requires aei status notification and train has a port location in secx field.
Trigger Criteria:
Context: A train requires AEI status notification and train has a port location in SECX field
Applied to: Get AEI Merlin Recipients
Action: System queries AEI email database using the train's port location as the key
Logic Flow:
IF A train requires AEI status notification and train has a port location in SECX field
AND System queries AEI email database using the train's port location as the key
THEN:
• System retrieves list of email recipients associated with that port location
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when aei email database query returns no recipients for the train's port location or database query fails with no-entry status.
Trigger Criteria:
Context: AEI email database query returns no recipients for the train's port location OR database query fails with no-entry status
Applied to: Use Default Merlin ID
Action: System processes the empty or failed query result
Logic Flow:
IF AEI email database query returns no recipients for the train's port location OR database query fails with no-entry status
AND System processes the empty or failed query result
THEN:
• System assigns default Merlin ID as both sender and recipient for the status message
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train has a valid train id and current status that needs to be communicated.
Trigger Criteria:
Context: A train has a valid train ID and current status that needs to be communicated
Applied to: Format Train Status Message
Action: System prepares AEI status message
Logic Flow:
IF A train has a valid train ID and current status that needs to be communicated
AND System prepares AEI status message
THEN:
• System formats message subject as 'TRAIN: [train-id] STATUS: [current-status]' and clears message text content
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when formatted train status message with designated recipients.
Trigger Criteria:
Context: A formatted train status message with designated recipients
Applied to: Send Message via Merlin System
Action: System calls Merlin send service with message details
Logic Flow:
IF A formatted train status message with designated recipients
AND System calls Merlin send service with message details
THEN:
• System transmits message and receives confirmation of delivery status
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when primary merlin message send has failed.
Trigger Criteria:
Context: Primary Merlin message send has failed
Applied to: Retry Send to Backup Recipients
Action: System detects send failure
Logic Flow:
IF Primary Merlin message send has failed
AND System detects send failure
THEN:
• System retries send operation using backup recipient list including AEI9999 and OM01247 as fallback recipients
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when both primary and backup merlin message sends have failed.
Trigger Criteria:
Context: Both primary and backup Merlin message sends have failed
Applied to: Log Send Failure Error
Action: System detects final send failure
Logic Flow:
IF Both primary and backup Merlin message sends have failed
AND System detects final send failure
THEN:
• System logs error message 'SEND TO FILE OF OM01247 FAILED' for operational review
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when aei email database query fails due to database connection or system error.
Trigger Criteria:
Context: AEI email database query fails due to database connection or system error
Applied to: Get AEI Merlin Recipients
Action: System receives database error response that is not a simple no-entry condition
Logic Flow:
IF AEI email database query fails due to database connection or system error
AND System receives database error response that is not a simple no-entry condition
THEN:
• System logs database error with SQL code information and continues processing using default Merlin ID
R-GCX015-cbl-00204 (+7)File: GCX015.cblBusiness Rule: Send Terminal Status Messages
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when train record exists in the system.
Trigger Criteria:
Context: A train record exists in the system
Applied to: Check Terminal Status Conditions
Action: The system evaluates terminal status message requirements
Logic Flow:
IF A train record exists in the system
AND The system evaluates terminal status message requirements
THEN:
• The train must have ACK status AND AEI send qualification AND enroute already reported status to proceed with terminal messaging
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when train record is being evaluated for terminal status messaging.
Trigger Criteria:
Context: A train record is being evaluated for terminal status messaging
Applied to: Train ACK Status?
Action: The system checks the train's acknowledgment status
Logic Flow:
IF A train record is being evaluated for terminal status messaging
AND The system checks the train's acknowledgment status
THEN:
• The train must have ACK status to continue with terminal status processing, otherwise terminate the process
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train has ack status.
Trigger Criteria:
Context: A train has ACK status
Applied to: AEI Send Qualified?
Action: The system evaluates AEI send qualification
Logic Flow:
IF A train has ACK status
AND The system evaluates AEI send qualification
THEN:
• The train must have AEI send flag enabled to proceed with terminal status messaging
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train has ack status and aei send qualification.
Trigger Criteria:
Context: A train has ACK status and AEI send qualification
Applied to: Enroute Already Reported?
Action: The system checks the enroute reporting status
Logic Flow:
IF A train has ACK status and AEI send qualification
AND The system checks the enroute reporting status
THEN:
• The train must have enroute already reported status to proceed with terminal status messaging
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train qualifies for terminal status messaging.
Trigger Criteria:
Context: A train qualifies for terminal status messaging
Applied to: Get AEI Merlin Distribution List
Action: The system needs to determine message recipients
Logic Flow:
IF A train qualifies for terminal status messaging
AND The system needs to determine message recipients
THEN:
• The system retrieves the AEI Merlin distribution list using the train's security port information, defaulting to standard recipients if no specific list is found
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train qualifies for terminal status messaging and distribution list is retrieved.
Trigger Criteria:
Context: A train qualifies for terminal status messaging and distribution list is retrieved
Applied to: Format Enroute Status Message
Action: The system formats the enroute status message
Logic Flow:
IF A train qualifies for terminal status messaging and distribution list is retrieved
AND The system formats the enroute status message
THEN:
• The system creates a standardized enroute message format using the predefined enroute message template
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when enroute status message is formatted.
Trigger Criteria:
Context: An enroute status message is formatted
Applied to: Set Train ID in Message
Action: The system assigns train identification to the message
Logic Flow:
IF An enroute status message is formatted
AND The system assigns train identification to the message
THEN:
• The system sets the train's customer train ID as the subject identifier in the enroute status message
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when enroute status message is formatted with train id and distribution list is available.
Trigger Criteria:
Context: An enroute status message is formatted with train ID and distribution list is available
Applied to: Send Status Message to Terminal Systems
Action: The system transmits the terminal status message
Logic Flow:
IF An enroute status message is formatted with train ID and distribution list is available
AND The system transmits the terminal status message
THEN:
• The system sends the enroute status message through the Merlin messaging system to the designated recipients
R-GCX015-cbl-00212 (+11)File: GCX015.cblBusiness Rule: Process Automatic Train Arrival
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train record exists in the system.
Trigger Criteria:
Context: A train record exists in the system
Applied to: Check Train Status Conditions
Action: The system checks the train's status for arrival processing eligibility
Logic Flow:
IF A train record exists in the system
AND The system checks the train's status for arrival processing eligibility
THEN:
• The train is eligible for arrival processing only if it has both ACK status andARRIVED-PENDING flag set to true
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train is eligible for arrival processing.
Trigger Criteria:
Context: A train is eligible for arrival processing
Applied to: Initialize Train Arrival Transaction
Action: The system begins creating the arrival transaction
Logic Flow:
IF A train is eligible for arrival processing
AND The system begins creating the arrival transaction
THEN:
• The train arrival transaction data structure is cleared and prepared for population
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when train arrival transaction is being created.
Trigger Criteria:
Context: A train arrival transaction is being created
Applied to: Set Action Code to 'TAR'
Action: The system sets the transaction type
Logic Flow:
IF A train arrival transaction is being created
AND The system sets the transaction type
THEN:
• The action code is set to 'TAR' to indicate train arrival processing
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when train arrival transaction is being created.
Trigger Criteria:
Context: A train arrival transaction is being created
Applied to: Get Current System Date and Time
Action: The system needs to timestamp the arrival event
Logic Flow:
IF A train arrival transaction is being created
AND The system needs to timestamp the arrival event
THEN:
• The current machine date and time are captured from the system
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when train arrival transaction is being created.
Trigger Criteria:
Context: A train arrival transaction is being created
Applied to: Set Security Byte to High-Value
Action: The system sets the security configuration
Logic Flow:
IF A train arrival transaction is being created
AND The system sets the security configuration
THEN:
• The security byte is set to high-value to indicate maximum security level
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when train arrival transaction is being created.
Trigger Criteria:
Context: A train arrival transaction is being created
Applied to: Set Train Type Flag
Action: The system sets the entity type flag
Logic Flow:
IF A train arrival transaction is being created
AND The system sets the entity type flag
THEN:
• The US-TRAIN flag is set to true to distinguish this from cargo processing
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when current system date has been captured.
Trigger Criteria:
Context: The current system date has been captured
Applied to: Set Event Date from Machine Date
Action: The system assigns the event date for the arrival transaction
Logic Flow:
IF The current system date has been captured
AND The system assigns the event date for the arrival transaction
THEN:
• The event date is set to the current machine date in YYMMDD format
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when current system time has been captured.
Trigger Criteria:
Context: The current system time has been captured
Applied to: Set Event Time from Machine Time
Action: The system assigns the event time for the arrival transaction
Logic Flow:
IF The current system time has been captured
AND The system assigns the event time for the arrival transaction
THEN:
• The event time is set to the first 4 digits of the current machine time (HHMM format)
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when train record contains a us customer train id.
Trigger Criteria:
Context: A train record contains a US customer train ID
Applied to: Set Train ID from US-CUST-TRAIN-ID
Action: The system creates the arrival transaction
Logic Flow:
IF A train record contains a US customer train ID
AND The system creates the arrival transaction
THEN:
• The train identifier in the transaction is set to the US customer train ID from the train record
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when all train arrival transaction data has been populated.
Trigger Criteria:
Context: All train arrival transaction data has been populated
Applied to: Build GCT1121E Message
Action: The system prepares the message for transmission
Logic Flow:
IF All train arrival transaction data has been populated
AND The system prepares the message for transmission
THEN:
• The complete GCT1121E message structure is built with all transaction data
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when complete train arrival message has been constructed.
Trigger Criteria:
Context: A complete train arrival message has been constructed
Applied to: Send Train Arrival Message to Queue
Action: The system sends the message for processing
Logic Flow:
IF A complete train arrival message has been constructed
AND The system sends the message for processing
THEN:
• The message is transmitted to the designated message queue using the WRITMSGL service
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train arrival message has been sent to the queue.
Trigger Criteria:
Context: A train arrival message has been sent to the queue
Applied to: Purge Message Queue
Action: The system completes the message transmission
Logic Flow:
IF A train arrival message has been sent to the queue
AND The system completes the message transmission
THEN:
• The message queue is purged to clean up any temporary message data
Business Justification: Defines the strict business conditions required to proceed when manifest acknowledgment needs to be processed.
Trigger Criteria:
Context: A manifest acknowledgment needs to be processed
Applied to: Get T1 Administrative Table
Action: The system attempts to retrieve the T1 administrative table using table ID 'T1'
Logic Flow:
IF A manifest acknowledgment needs to be processed
AND The system attempts to retrieve the T1 administrative table using table ID 'T1'
THEN:
• The T1 administrative table segment should be loaded for timestamp updates
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when system is attempting to update acknowledgment timestamps.
Trigger Criteria:
Context: The system is attempting to update acknowledgment timestamps
Applied to: Send Error - Table Not Found
Action: The T1 administrative table retrieval fails with a non-zero return flag
Logic Flow:
IF The system is attempting to update acknowledgment timestamps
AND The T1 administrative table retrieval fails with a non-zero return flag
THEN:
• An error message 'T1 CHECK TABLE ENTRY NOT FOUND' should be sent and processing should terminate
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when manifest acknowledgment is being processed and the t1 administrative table is available.
Trigger Criteria:
Context: A manifest acknowledgment is being processed and the T1 administrative table is available
Applied to: Update P-Type Manifest Timestamp Record Current Date/Time in T1-309-ACK
Action: The manifest type code equals 'P'
Logic Flow:
IF A manifest acknowledgment is being processed and the T1 administrative table is available
AND The manifest type code equals 'P'
THEN:
• The current machine date should be recorded in positions 3-6 of T1-309-ACK field, the current machine century should be recorded in positions 1-2 of T1-309-ACK field, and the current machine time (first 4 digits) should be recorded in positions 9-4 of T1-309-ACK field
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when manifest acknowledgment is being processed and the t1 administrative table is available.
Trigger Criteria:
Context: A manifest acknowledgment is being processed and the T1 administrative table is available
Applied to: Update H-Type Manifest Timestamp Record Current Date/Time in T1-353-ACK
Action: The manifest type code equals 'H'
Logic Flow:
IF A manifest acknowledgment is being processed and the T1 administrative table is available
AND The manifest type code equals 'H'
THEN:
• The current machine date should be recorded in positions 3-6 of T1-353-ACK field, the current machine century should be recorded in positions 1-2 of T1-353-ACK field, and the current machine time (first 4 digits) should be recorded in positions 9-4 of T1-353-ACK field
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when manifest acknowledgment is being processed and the t1 administrative table is available.
Trigger Criteria:
Context: A manifest acknowledgment is being processed and the T1 administrative table is available
Applied to: Update S-Type Manifest Timestamp Record Current Date/Time in T1-358-ACK
Action: The manifest type code equals 'S'
Logic Flow:
IF A manifest acknowledgment is being processed and the T1 administrative table is available
AND The manifest type code equals 'S'
THEN:
• The current machine date should be recorded in positions 3-6 of T1-358-ACK field, the current machine century should be recorded in positions 1-2 of T1-358-ACK field, and the current machine time (first 4 digits) should be recorded in positions 9-4 of T1-358-ACK field
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when acknowledgment timestamps have been updated in the t1 administrative table segment.
Trigger Criteria:
Context: Acknowledgment timestamps have been updated in the T1 administrative table segment
Applied to: Save Updated Administrative Table
Action: The timestamp update process is complete
Logic Flow:
IF Acknowledgment timestamps have been updated in the T1 administrative table segment
AND The timestamp update process is complete
THEN:
• The updated T1 administrative table segment should be saved using the REPL function code to persist the changes
Business Justification: Defines the strict business conditions required to proceed when request to update administrative table t1 is initiated.
Trigger Criteria:
Context: A request to update administrative table T1 is initiated
Applied to: Get T1 Table Segment
Action: The system attempts to retrieve the T1 table segment
Logic Flow:
IF A request to update administrative table T1 is initiated
AND The system attempts to retrieve the T1 table segment
THEN:
• The system must verify the table is found and accessible for updates
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when request to update administrative table t1 is made.
Trigger Criteria:
Context: A request to update administrative table T1 is made
Applied to: Send Error - Table Not Found
Action: The T1 table segment cannot be found or accessed
Logic Flow:
IF A request to update administrative table T1 is made
AND The T1 table segment cannot be found or accessed
THEN:
• The system must send an error message indicating the table entry was not found and terminate the update process
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when manifest message is being processed for administrative table updates.
Trigger Criteria:
Context: A manifest message is being processed for administrative table updates
Applied to: Manifest Type?
Action: The system evaluates the manifest type code from the message
Logic Flow:
IF A manifest message is being processed for administrative table updates
AND The system evaluates the manifest type code from the message
THEN:
• The system must identify whether it is P-type, H-type, or S-type manifest to route to appropriate timestamp update
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when p-type manifest message has been processed successfully.
Trigger Criteria:
Context: A P-type manifest message has been processed successfully
Applied to: Update P-Type Manifest Timestamp
Action: The system updates the T1 administrative table
Logic Flow:
IF A P-type manifest message has been processed successfully
AND The system updates the T1 administrative table
THEN:
• The system must set the T1-309-ACK field with the current system date and time (century, date, and time components)
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when h-type manifest message has been processed successfully.
Trigger Criteria:
Context: An H-type manifest message has been processed successfully
Applied to: Update H-Type Manifest Timestamp
Action: The system updates the T1 administrative table
Logic Flow:
IF An H-type manifest message has been processed successfully
AND The system updates the T1 administrative table
THEN:
• The system must set the T1-353-ACK field with the current system date and time (century, date, and time components)
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when s-type manifest message has been processed successfully.
Trigger Criteria:
Context: An S-type manifest message has been processed successfully
Applied to: Update S-Type Manifest Timestamp
Action: The system updates the T1 administrative table
Logic Flow:
IF An S-type manifest message has been processed successfully
AND The system updates the T1 administrative table
THEN:
• The system must set the T1-358-ACK field with the current system date and time (century, date, and time components)
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when t1 administrative table segment has been updated with manifest acknowledgment timestamps.
Trigger Criteria:
Context: The T1 administrative table segment has been updated with manifest acknowledgment timestamps
Applied to: Save Updated T1 Table Segment
Action: The system completes the timestamp update process
Logic Flow:
IF The T1 administrative table segment has been updated with manifest acknowledgment timestamps
AND The system completes the timestamp update process
THEN:
• The system must save the modified T1 table segment back to the administrative table storage
Business Justification: Establishes the required business protocol to be followed when error condition has been detected during message processing.
Trigger Criteria:
Context: An error condition has been detected during message processing
Applied to: Prepare Error Report Message
Action: The system needs to send error notifications
Logic Flow:
IF An error condition has been detected during message processing
AND The system needs to send error notifications
THEN:
• Prepare error report message with processing results and error information for transmission to Merlin system
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when error report message is prepared for transmission.
Trigger Criteria:
Context: Error report message is prepared for transmission
Applied to: Set Primary Merlin Recipients
Action: Setting up primary Merlin recipients
Logic Flow:
IF Error report message is prepared for transmission
AND Setting up primary Merlin recipients
THEN:
• Set from user code to 'OM01247', set primary recipient to 'OM01247', and configure subject line with Merlin subject information
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when primary merlin recipients are configured and error report is prepared. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Primary Merlin recipients are configured and error report is prepared
Applied to: Send to Primary Merlin Destination
Action: Transmitting to primary Merlin destination
Logic Flow:
IF Primary Merlin recipients are configured and error report is prepared
AND Transmitting to primary Merlin destination
THEN:
• Call EMCSEND2 service with configured parameters including from user code, destination, recipients, subject, and error report content
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when primary merlin transmission has been attempted.
Trigger Criteria:
Context: Primary Merlin transmission has been attempted
Applied to: Send Successful?
Action: Checking transmission success status
Logic Flow:
IF Primary Merlin transmission has been attempted
AND Checking transmission success status
THEN:
• IfEMI-NO-ERRORS condition is true, consider transmission successful, otherwise handle as failure
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when primary merlin transmission has failed. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Primary Merlin transmission has failed
Applied to: Handle Send Failure
Action: Handling send failure conditions
Logic Flow:
IF Primary Merlin transmission has failed
AND Handling send failure conditions
THEN:
• IfEMI-FROM-NOT-FOUND, set error message 'EMI - INVALID MERLIN FROM' and perform abend; IfEMI-TO-OR-COPY-NOT-FOUND, set error message 'EMI - INVALID MERLIN TO OR COPY' and perform abend; IfEMI-FILENAME-INVALID, set error message 'EMI - INVALID MERLIN FILENAME' and perform abend
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when primary merlin transmission processing is complete. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Primary Merlin transmission processing is complete
Applied to: Set Administrative Recipients
Action: Setting up administrative recipients for secondary transmission
Logic Flow:
IF Primary Merlin transmission processing is complete
AND Setting up administrative recipients for secondary transmission
THEN:
• Clear existing recipient codes, set primary administrative recipient to GCSTBRT-AD-DC-P-MERLIN-1 value, and set copy recipient to GCSTBRT-AD-DC-P-MERLIN-5 value
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when administrative recipients are configured. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Administrative recipients are configured
Applied to: Send to Administrative Destination
Action: Transmitting to administrative Merlin destination
Logic Flow:
IF Administrative recipients are configured
AND Transmitting to administrative Merlin destination
THEN:
• Call EMCSEND2 service with administrative destination filename (EMI-DESTINATION-FILENAME2) and configured administrative recipients
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when administrative merlin transmission has been attempted.
Trigger Criteria:
Context: Administrative Merlin transmission has been attempted
Applied to: Admin Send Successful?
Action: Checking administrative transmission success status
Logic Flow:
IF Administrative Merlin transmission has been attempted
AND Checking administrative transmission success status
THEN:
• IfEMI-NO-ERRORS condition is true, consider administrative transmission successful, otherwise handle as failure
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when administrative merlin transmission has failed. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Administrative Merlin transmission has failed
AND Handling administrative send failure conditions
THEN:
• IfEMI-FROM-NOT-FOUND, set error message 'EMI - INVALID MERLIN FROM' and perform abend; IfEMI-TO-OR-COPY-NOT-FOUND, set error message 'EMI - INVALID MERLIN TO OR COPY' and perform abend; IfEMI-FILENAME-INVALID, set error message 'EMI - INVALID MERLIN FILENAME' and perform abend
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when train processing is complete and aei send flag is set.
Trigger Criteria:
Context: Train processing is complete and AEI send flag is set
Applied to: Prepare AEI Status Message
Action: Preparing AEI status message
Logic Flow:
IF Train processing is complete and AEI send flag is set
AND Preparing AEI status message
THEN:
• Format subject line with 'TRAIN: ' followed by train ID and ' STATUS: ' followed by current status, then prepare message for Merlin transmission
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when aei status message is prepared for transmission. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: AEI status message is prepared for transmission
Applied to: Get AEI Merlin Recipients
Action: Retrieving AEI Merlin recipients
Logic Flow:
IF AEI status message is prepared for transmission
AND Retrieving AEI Merlin recipients
THEN:
• Extract port information from train security data, call AECWRKTB with 'CUSEMAIL' record type to get email recipients; If successful, set default Merlin ID as from user and populate recipient list from database results; If no entry found, use default Merlin ID for both from and to users; If database error occurs, perform DB2 abend processing
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when aei merlin recipients are retrieved and status message is prepared. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: AEI Merlin recipients are retrieved and status message is prepared
Applied to: Send AEI Status to Merlin
Action: Transmitting AEI status to Merlin
Logic Flow:
IF AEI Merlin recipients are retrieved and status message is prepared
AND Transmitting AEI status to Merlin
THEN:
• Call EMCSEND3 service with AEI recipients, formatted subject line, and message content for transmission
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when aei status transmission has been attempted.
Trigger Criteria:
Context: AEI status transmission has been attempted
Applied to: AEI Send Successful?
Action: Checking AEI transmission success status
Logic Flow:
IF AEI status transmission has been attempted
AND Checking AEI transmission success status
THEN:
• IfEMI-NO-ERRORS condition is true, consider AEI transmission successful, otherwise handle as failure
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when aei status transmission has failed. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: AEI status transmission has failed
Applied to: Retry AEI Send with Fallbacks
Action: Retrying AEI send with fallback recipients
Logic Flow:
IF AEI status transmission has failed
AND Retrying AEI send with fallback recipients
THEN:
• Clear existing recipients, set fallback recipients to 'AEI9999' and 'OM01247', retry EMCSEND3 call with fallback configuration
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when aei retry transmission has been attempted with fallback recipients. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: AEI retry transmission has been attempted with fallback recipients
Applied to: AEI Retry Successful?
Action: Checking AEI retry success status
Logic Flow:
IF AEI retry transmission has been attempted with fallback recipients
AND Checking AEI retry success status
THEN:
• IfEMI-NO-ERRORS condition is true, consider retry successful; If still failing, set error message 'SEND TO FILE OF OM01247 FAILED' and call CERR for error handling
R-GCX015-cbl-00252 (+4)File: GCX015.cblBusiness Rule: Close MQ Connections
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when message processing is complete and message queue handle exists.
Trigger Criteria:
Context: Message processing is complete and message queue handle exists
Applied to: Close Message Queue Handle
Action: System initiates message queue closure
Logic Flow:
IF Message processing is complete and message queue handle exists
AND System initiates message queue closure
THEN:
• Message queue handle is closed and queue resources are released
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when message queue closure is attempted.
Trigger Criteria:
Context: Message queue closure is attempted
Applied to: Handle Queue Close Error
Action: Queue closure fails with error condition
Logic Flow:
IF Message queue closure is attempted
AND Queue closure fails with error condition
THEN:
• System captures error details and initiates error handling process
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when message queue handle has been closed successfully.
Trigger Criteria:
Context: Message queue handle has been closed successfully
Applied to: Disconnect from MQ Manager
Action: System initiates disconnection from MQ manager
Logic Flow:
IF Message queue handle has been closed successfully
AND System initiates disconnection from MQ manager
THEN:
• Connection to MQ manager is terminated and messaging resources are freed
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when mq manager disconnection is attempted.
Trigger Criteria:
Context: MQ manager disconnection is attempted
Applied to: Handle Disconnect Error
Action: Disconnection fails with error condition
Logic Flow:
IF MQ manager disconnection is attempted
AND Disconnection fails with error condition
THEN:
• System captures error details and initiates error handling process
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when mq close or disconnect operation has failed.
Trigger Criteria:
Context: MQ close or disconnect operation has failed
Applied to: System Abend
Action: Error handling determines the error is unrecoverable
Logic Flow:
IF MQ close or disconnect operation has failed
AND Error handling determines the error is unrecoverable
THEN:
• System performs abnormal termination with error details
R-GCX015-cbl-00257 (+3)File: GCX015.cblBusiness Rule: Process Special Test Messages
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when message segment is being processed and it is identified as an m10 segment type.
Trigger Criteria:
Context: A message segment is being processed and it is identified as an M10 segment type
Applied to: Check Reference Number
Action: The M10 segment reference number equals 'TRAINCPRSTESTTRAIN0000000000' or 'CARGOCPRS940000000000'
Logic Flow:
IF A message segment is being processed and it is identified as an M10 segment type
AND The M10 segment reference number equals 'TRAINCPRSTESTTRAIN0000000000' or 'CARGOCPRS940000000000'
THEN:
• The system should clear the message array, set the end processing flag to true, and terminate message processing
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when special test message has been identified with reference number 'traincprstesttrain0000000000' or 'cargocprs940000000000'.
Trigger Criteria:
Context: A special test message has been identified with reference number 'TRAINCPRSTESTTRAIN0000000000' or 'CARGOCPRS940000000000'
Applied to: Update Administrative Timestamps
Action: The manifest type code in the M10 segment is 'P', 'H', or 'S'
Logic Flow:
IF A special test message has been identified with reference number 'TRAINCPRSTESTTRAIN0000000000' or 'CARGOCPRS940000000000'
AND The manifest type code in the M10 segment is 'P', 'H', or 'S'
THEN:
• The system should update the corresponding administrative table timestamp field (T1-309-ACK for 'P', T1-353-ACK for 'H', T1-358-ACK for 'S') with current machine date, century, and time
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when special test message has been detected and administrative timestamps have been updated. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A special test message has been detected and administrative timestamps have been updated
Applied to: Clear Message Array
Action: The special check processing is executed
Logic Flow:
IF A special test message has been detected and administrative timestamps have been updated
AND The special check processing is executed
THEN:
• The system should move spaces to the MQS-MSG-ARRAY to clear all message data
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when special test message has been processed and the message array has been cleared. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A special test message has been processed and the message array has been cleared
Applied to: Set End Processing Flag
Action: The test message handling is complete
Logic Flow:
IF A special test message has been processed and the message array has been cleared
AND The test message handling is complete
THEN:
• The system should set WS-END-FOUND to true to indicate end of processing
Business Justification: Defines the strict business conditions required to proceed when system needs to update administrative timestamps for acknowledgment processing.
Trigger Criteria:
Context: The system needs to update administrative timestamps for acknowledgment processing
Applied to: Get T1 Administrative Table
Action: The system attempts to retrieve the T1 administrative table using table ID 'T1'
Logic Flow:
IF The system needs to update administrative timestamps for acknowledgment processing
AND The system attempts to retrieve the T1 administrative table using table ID 'T1'
THEN:
• The T1 administrative table segment should be retrieved and made available for timestamp updates
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when system is attempting to retrieve the t1 administrative table for timestamp updates.
Trigger Criteria:
Context: The system is attempting to retrieve the T1 administrative table for timestamp updates
Applied to: Table Found? -> Log Error - Table Not Found
Action: The T1 administrative table retrieval fails and return flag is not equal to '0'
Logic Flow:
IF The system is attempting to retrieve the T1 administrative table for timestamp updates
AND The T1 administrative table retrieval fails and return flag is not equal to '0'
THEN:
• The system should log an error message 'T1 CHECK TABLE ENTRY NOT FOUND' and terminate the timestamp update process
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when t1 administrative table is available and a manifest transaction is being processed.
Trigger Criteria:
Context: The T1 administrative table is available and a manifest transaction is being processed
Applied to: Manifest Type = 'P'? -> Update 309 ACK Timestamp
Action: The manifest type code equals 'P'
Logic Flow:
IF The T1 administrative table is available and a manifest transaction is being processed
AND The manifest type code equals 'P'
THEN:
• The system should update the 309 ACK timestamp with current system date (positions 3-6), current century (positions 1-2), and current system time (positions 9-4)
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when t1 administrative table is available and a manifest transaction is being processed with manifest type not equal to 'p'.
Trigger Criteria:
Context: The T1 administrative table is available and a manifest transaction is being processed with manifest type not equal to 'P'
Applied to: Manifest Type = 'H'? -> Update 353 ACK Timestamp
Action: The manifest type code equals 'H'
Logic Flow:
IF The T1 administrative table is available and a manifest transaction is being processed with manifest type not equal to 'P'
AND The manifest type code equals 'H'
THEN:
• The system should update the 353 ACK timestamp with current system date (positions 3-6), current century (positions 1-2), and current system time (positions 9-4)
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when t1 administrative table is available and a manifest transaction is being processed with manifest type not equal to 'p' or 'h'.
Trigger Criteria:
Context: The T1 administrative table is available and a manifest transaction is being processed with manifest type not equal to 'P' or 'H'
Applied to: Manifest Type = 'S'? -> Update 358 ACK Timestamp
Action: The manifest type code equals 'S'
Logic Flow:
IF The T1 administrative table is available and a manifest transaction is being processed with manifest type not equal to 'P' or 'H'
AND The manifest type code equals 'S'
THEN:
• The system should update the 358 ACK timestamp with current system date (positions 3-6), current century (positions 1-2), and current system time (positions 9-4)
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when t1 administrative table has been retrieved and acknowledgment timestamps have been updated based on manifest type.
Trigger Criteria:
Context: The T1 administrative table has been retrieved and acknowledgment timestamps have been updated based on manifest type
Applied to: Save Updated Timestamps to T1 Table
Action: All timestamp updates are complete
Logic Flow:
IF The T1 administrative table has been retrieved and acknowledgment timestamps have been updated based on manifest type
AND All timestamp updates are complete
THEN:
• The system should save the updated T1 table segment back to the administrative table using replace function
R-GCX015-cbl-00267 (+8)File: GCX015.cblBusiness Rule: Extract M10 Segment Data
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when m10 segment is received for processing.
Trigger Criteria:
Context: An M10 segment is received for processing
Applied to: Extract Reference Number from M10-12 & Extract Manifest Type Code from M10-09
Action: The system processes the M10 segment
Logic Flow:
IF An M10 segment is received for processing
AND The system processes the M10 segment
THEN:
• The reference number is extracted from M10-12-REF-NUM field and stored in WORK-M10-12 for further processing
• The manifest type code is extracted from M10-09-MANIFEST-TYP-CDE field for action determination
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when m10 segment with manifest type code is processed.
Trigger Criteria:
Context: An M10 segment with manifest type code is processed
Applied to: P, X, Y, T, S
Action: The manifest type code is P, X, Y, T, or S
Logic Flow:
IF An M10 segment with manifest type code is processed
AND The manifest type code is P, X, Y, T, or S
THEN:
• The system sets SHOULD-UPDATE-STATUS flag to true indicating status should be updated
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when m10 segment with manifest type code is processed.
Trigger Criteria:
Context: An M10 segment with manifest type code is processed
Applied to: Set No Update Action Other Types
Action: The manifest type code is not P, X, Y, T, S, or H
Logic Flow:
IF An M10 segment with manifest type code is processed
AND The manifest type code is not P, X, Y, T, S, or H
THEN:
• The system sets SHOULD-NOT-UPDATE-STATUS flag to true indicating no status update should occur
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when m10 segment with manifest type code h is processed and the transaction is identified as train.
Trigger Criteria:
Context: An M10 segment with manifest type code H is processed and the transaction is identified as TRAIN
Applied to: H for Trains
Action: The manifest type code is H
Logic Flow:
IF An M10 segment with manifest type code H is processed and the transaction is identified as TRAIN
AND The manifest type code is H
THEN:
• The system sets SHOULD-DELETE-STATUS flag to true indicating the train status should be deleted
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when m10 segment reference number is extracted. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: An M10 segment reference number is extracted
Applied to: 'TRAIN'
Action: The reference number prefix equals 'TRAIN'
Logic Flow:
IF An M10 segment reference number is extracted
AND The reference number prefix equals 'TRAIN'
THEN:
• The system sets WS-TRAIN flag to true and identifies the transaction for train processing
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when m10 segment reference number is extracted. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: An M10 segment reference number is extracted
Applied to: 'CARGO'
Action: The reference number prefix equals 'CARGO'
Logic Flow:
IF An M10 segment reference number is extracted
AND The reference number prefix equals 'CARGO'
THEN:
• The system sets WS-CARGO flag to true and identifies the transaction for cargo processing
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when m10 segment reference number is extracted. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: An M10 segment reference number is extracted
Applied to: Mark as Unknown Type Other Prefixes
Action: The reference number prefix is neither 'TRAIN' nor 'CARGO'
Logic Flow:
IF An M10 segment reference number is extracted
AND The reference number prefix is neither 'TRAIN' nor 'CARGO'
THEN:
• The system maintains WS-UNKNOWN flag as true indicating unknown transaction type
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when m10 segment data has been extracted and transaction type identified.
Trigger Criteria:
Context: M10 segment data has been extracted and transaction type identified
Applied to: Store M10 Data for Processing
Action: The system completes M10 segment analysis
Logic Flow:
IF M10 segment data has been extracted and transaction type identified
AND The system completes M10 segment analysis
THEN:
• The reference number data is moved to WORK-M10-12-DATA field for use in database operations and logging
R-GCX015-cbl-00276 (+12)File: GCX015.cblBusiness Rule: Process K1 Segment
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when k1 segment is being processed.
Trigger Criteria:
Context: A K1 segment is being processed
Applied to: Start K1 Segment Processing
Action: The system processes the K1 segment
Logic Flow:
IF A K1 segment is being processed
AND The system processes the K1 segment
THEN:
• The message number is extracted from the K1 segment and stored for further processing
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when k1 message number has been extracted.
Trigger Criteria:
Context: A K1 message number has been extracted
Applied to: Build MS Table Key with Message Number
Action: The system builds the MS table lookup key
Logic Flow:
IF A K1 message number has been extracted
AND The system builds the MS table lookup key
THEN:
• The key is constructed with table ID 'MS', prefix 'A', and the K1 message number
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when ms table key has been constructed with message number.
Trigger Criteria:
Context: An MS table key has been constructed with message number
Applied to: Look Up Error Message Text in MS Table
Action: The system performs a table lookup
Logic Flow:
IF An MS table key has been constructed with message number
AND The system performs a table lookup
THEN:
• The system retrieves the corresponding English error message text from the MS table
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when ms table lookup has been performed for error message text.
Trigger Criteria:
Context: An MS table lookup has been performed for error message text
Applied to: Message Text Found?
Action: The lookup return flag equals '0'
Logic Flow:
IF An MS table lookup has been performed for error message text
AND The lookup return flag equals '0'
THEN:
• Use the MS table English text as the error message
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when ms table lookup has been performed for error message text.
Trigger Criteria:
Context: An MS table lookup has been performed for error message text
Applied to: Use K1 Free Form Message
Action: The lookup return flag does not equal '0'
Logic Flow:
IF An MS table lookup has been performed for error message text
AND The lookup return flag does not equal '0'
THEN:
• Use the K1 free form message as the error message text
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when error message text has been selected (either from ms table or k1 free form).
Trigger Criteria:
Context: An error message text has been selected (either from MS table or K1 free form)
Applied to: Add Error Message to Report Lines
Action: The system adds the message to the report
Logic Flow:
IF An error message text has been selected (either from MS table or K1 free form)
AND The system adds the message to the report
THEN:
• The error message is added to the report lines and the line counter is incremented
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when error message has been formatted for display.
Trigger Criteria:
Context: An error message has been formatted for display
Applied to: Store Message in K1 Message Array
Action: The system stores the message for logging
Logic Flow:
IF An error message has been formatted for display
AND The system stores the message for logging
THEN:
• The formatted log message is stored in the K1 message array and the counter is incremented
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when k1 message has been processed.
Trigger Criteria:
Context: A K1 message has been processed
Applied to: Message Number = 242?
Action: The K1 message number equals '242'
Logic Flow:
IF A K1 message has been processed
AND The K1 message number equals '242'
THEN:
• The system initiates special C4 code processing
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when message number 242 requires c4 code processing.
Trigger Criteria:
Context: Message number 242 requires C4 code processing
Applied to: C4 Code Available?
Action: The C4 code holder is not spaces and not low-values
Logic Flow:
IF Message number 242 requires C4 code processing
AND The C4 code holder is not spaces and not low-values
THEN:
• The system proceeds with C4 code message construction
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when c4 code data is available for message 242.
Trigger Criteria:
Context: C4 code data is available for message 242
Applied to: Build C4 Code Message
Action: The system builds the C4 code message
Logic Flow:
IF C4 code data is available for message 242
AND The system builds the C4 code message
THEN:
• A message is constructed with format 'C4 CODE=' followed by the C4 code value
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when c4 code message has been constructed.
Trigger Criteria:
Context: A C4 code message has been constructed
Applied to: Add C4 Code to Report Lines
Action: The system adds the C4 message to the report
Logic Flow:
IF A C4 code message has been constructed
AND The system adds the C4 message to the report
THEN:
• The C4 code message is added to the report lines and the line counter is incremented
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when c4 code message has been added to the report.
Trigger Criteria:
Context: A C4 code message has been added to the report
Applied to: Store C4 Message in Array
Action: The system stores the C4 message for logging
Logic Flow:
IF A C4 code message has been added to the report
AND The system stores the C4 message for logging
THEN:
• The C4 code log message is stored in the K1 message array and the counter is incremented
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when c4 code processing has been completed for message 242.
Trigger Criteria:
Context: C4 code processing has been completed for message 242
Applied to: Clear C4 Code Holder
Action: The system clears the C4 code holder
Logic Flow:
IF C4 code processing has been completed for message 242
AND The system clears the C4 code holder
THEN:
• The C4 code holder is set to spaces to prevent reuse in subsequent processing
R-GCX015-cbl-00289 (+5)File: GCX015.cblBusiness Rule: Extract K3 Segment Data
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when k3 segment is being processed from the message queue.
Trigger Criteria:
Context: A K3 segment is being processed from the message queue
Applied to: Extract Total Reject Count
Action: The total rejection count in the K3 segment is greater than zero
Logic Flow:
IF A K3 segment is being processed from the message queue
AND The total rejection count in the K3 segment is greater than zero
THEN:
• The system should set ERROR status for the transaction
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when k3 segment has zero rejection count.
Trigger Criteria:
Context: A K3 segment has zero rejection count
Applied to: Accept Count > 0?
Action: The total acceptance count is greater than zero
Logic Flow:
IF A K3 segment has zero rejection count
AND The total acceptance count is greater than zero
THEN:
• The system should proceed to evaluate train status conditions for appropriate status assignment
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when k3 segment has zero rejection count.
Trigger Criteria:
Context: A K3 segment has zero rejection count
Applied to: Record Zero Counts Message
Action: The total acceptance count is also zero
Logic Flow:
IF A K3 segment has zero rejection count
AND The total acceptance count is also zero
THEN:
• The system should record a warning message 'USCS K3 RECORD HAS ZERO COUNTS' and set ACK status
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when k3 segment has valid acceptance counts (zero rejections and positive acceptances) and the entity is a train.
Trigger Criteria:
Context: A K3 segment has valid acceptance counts (zero rejections and positive acceptances) and the entity is a train
Applied to: Set PRE-ARRIVAL Status
Action: The train status indicates PRE-ARRIVED condition
Logic Flow:
IF A K3 segment has valid acceptance counts (zero rejections and positive acceptances) and the entity is a train
AND The train status indicates PRE-ARRIVED condition
THEN:
• The system should set PRE-ARRIVAL status for the train
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when k3 segment has valid acceptance counts (zero rejections and positive acceptances) and the entity is a train.
Trigger Criteria:
Context: A K3 segment has valid acceptance counts (zero rejections and positive acceptances) and the entity is a train
Applied to: Set REVIEW-COMPLETED Status
Action: The train status indicates REVIEW-CMPL condition
Logic Flow:
IF A K3 segment has valid acceptance counts (zero rejections and positive acceptances) and the entity is a train
AND The train status indicates REVIEW-CMPL condition
THEN:
• The system should set REVIEW-COMPLETED status for the train
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when k3 segment has valid acceptance counts (zero rejections and positive acceptances).
Trigger Criteria:
Context: A K3 segment has valid acceptance counts (zero rejections and positive acceptances)
Applied to: Set ACK Status
Action: The entity is not in PRE-ARRIVED or REVIEW-CMPL status conditions
Logic Flow:
IF A K3 segment has valid acceptance counts (zero rejections and positive acceptances)
AND The entity is not in PRE-ARRIVED or REVIEW-CMPL status conditions
THEN:
• The system should set standard ACK status
R-GCX015-cbl-00295 (+6)File: GCX015.cblBusiness Rule: Update Train Record
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train record exists with gcwtl-deleted flag set to true. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A train record exists with GCWTL-DELETED flag set to true
Applied to: Set Status to DELETED
Action: The message processing results in WS-ACK-STATUS being true
Logic Flow:
IF A train record exists with GCWTL-DELETED flag set to true
AND The message processing results in WS-ACK-STATUS being true
THEN:
• The train current status is set to 'DELETED' and security fields are cleared
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train record exists with gcwtl-delete-pending flag set to true. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A train record exists with GCWTL-DELETE-PENDING flag set to true
Applied to: Set Status to DELETED
Action: The message processing results in WS-ACK-STATUS being true
Logic Flow:
IF A train record exists with GCWTL-DELETE-PENDING flag set to true
AND The message processing results in WS-ACK-STATUS being true
THEN:
• The train current status is set to 'DELETED' and security fields are cleared
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train record exists that is not deleted and not delete pending.
Trigger Criteria:
Context: A train record exists that is not deleted and not delete pending
Applied to: Set Current Status from Message
Action: The message processing completes with a status update
Logic Flow:
IF A train record exists that is not deleted and not delete pending
AND The message processing completes with a status update
THEN:
• The train current status is updated with the message status value
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train record is being updated to deleted status.
Trigger Criteria:
Context: A train record is being updated to DELETED status
Applied to: Clear Security Fields
Action: The status update operation is executed
Logic Flow:
IF A train record is being updated to DELETED status
AND The status update operation is executed
THEN:
• The GCWTL-SECX security field is initialized to spaces
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train record requires status or field updates.
Trigger Criteria:
Context: A train record requires status or field updates
Applied to: Execute Database Update
Action: The update operation is initiated
Logic Flow:
IF A train record requires status or field updates
AND The update operation is initiated
THEN:
• The system calls GCCUTRIO with replacement function and root-only scope using the train PCB
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train record has been updated successfully.
Trigger Criteria:
Context: A train record has been updated successfully
Applied to: Check AEI Train Qualification
Action: The update operation completes
Logic Flow:
IF A train record has been updated successfully
AND The update operation completes
THEN:
• The system performs AEI train send qualification check to determine if additional AEI processing is required
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train record has gcwtl-ack status set to true and gcwtl-arrived-pending status set to true.
Trigger Criteria:
Context: A train record has GCWTL-ACK status set to true and GCWTL-ARRIVED-PENDING status set to true
Applied to: Process Automatic Train Arrival
Action: The train record update is completed
Logic Flow:
IF A train record has GCWTL-ACK status set to true and GCWTL-ARRIVED-PENDING status set to true
AND The train record update is completed
THEN:
• The system automatically triggers train arrival processing
R-GCX015-cbl-00302 (+9)File: GCX015.cblBusiness Rule: Update Cargo Record
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when cargo record is being processed for status update.
Trigger Criteria:
Context: A cargo record is being processed for status update
Applied to: Is Status ACK?
Action: The system evaluates the current status type
Logic Flow:
IF A cargo record is being processed for status update
AND The system evaluates the current status type
THEN:
• If the status is ACK, the system proceeds to check for previously saved status information, otherwise it processes as an error status
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when cargo status is being acknowledged.
Trigger Criteria:
Context: A cargo status is being acknowledged
Applied to: Previous Status Saved?
Action: The system checks the saved status description field
Logic Flow:
IF A cargo status is being acknowledged
AND The system checks the saved status description field
THEN:
• If the saved status description is not empty, restore the saved status and description, otherwise set default acknowledgment flags
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when cargo status is being acknowledged and no previous status is saved.
Trigger Criteria:
Context: A cargo status is being acknowledged and no previous status is saved
Applied to: Set Status to USCARGO-ACK
Action: The system processes the acknowledgment
Logic Flow:
IF A cargo status is being acknowledged and no previous status is saved
AND The system processes the acknowledgment
THEN:
• Set both USCARGO status flags to acknowledgment state
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when cargo status is being acknowledged and a previous status description exists in save fields.
Trigger Criteria:
Context: A cargo status is being acknowledged and a previous status description exists in save fields
Applied to: Restore Previous Status from Save Fields
Action: The system processes the acknowledgment
Logic Flow:
IF A cargo status is being acknowledged and a previous status description exists in save fields
AND The system processes the acknowledgment
THEN:
• Restore the cargo status from the saved status field and restore the status description from the saved description field
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when cargo is being processed with error status.
Trigger Criteria:
Context: A cargo is being processed with error status
Applied to: Current Status is Error/ACK?
Action: The system evaluates the current USCARGO short description status
Logic Flow:
IF A cargo is being processed with error status
AND The system evaluates the current USCARGO short description status
THEN:
• If the current status is ERROR, ACK, orACK-R, skip saving the current status, otherwise save the current status to backup fields
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when cargo is being processed with error status.
Trigger Criteria:
Context: A cargo is being processed with error status
Applied to: Cargo Already Deleted?
Action: The system evaluates the CPCARGO deletion status
Logic Flow:
IF A cargo is being processed with error status
AND The system evaluates the CPCARGO deletion status
THEN:
• If the cargo is already marked as CPCARGO-DELETED, skip setting CPCARGO-ERROR flag, otherwise set the CPCARGO-ERROR flag
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when cargo is being processed with error status.
Trigger Criteria:
Context: A cargo is being processed with error status
Applied to: Set Status to USCARGO-ERROR
Action: The system applies error status flags
Logic Flow:
IF A cargo is being processed with error status
AND The system applies error status flags
THEN:
• Set both USCARGO status flag and USCARGO short description flag to ERROR state
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when cargo is being set to error status and current status is not error, ack, or ack-r.
Trigger Criteria:
Context: A cargo is being set to error status and current status is not ERROR, ACK, or ACK-R
Applied to: Save Current Status to Backup Fields
Action: The system processes the error status
Logic Flow:
IF A cargo is being set to error status and current status is not ERROR, ACK, or ACK-R
AND The system processes the error status
THEN:
• Move the current USCARGO status to the saved status field and move the current USCARGO short description to the saved description field
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when cargo is being set to error status and is not already deleted.
Trigger Criteria:
Context: A cargo is being set to error status and is not already deleted
Applied to: Set Status to CPCARGO-ERROR
Action: The system processes the error status
Logic Flow:
IF A cargo is being set to error status and is not already deleted
AND The system processes the error status
THEN:
• Set the CPCARGO status flag to ERROR state
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when all cargo status fields have been modified according to business rules.
Trigger Criteria:
Context: All cargo status fields have been modified according to business rules
Applied to: Execute Database Update Operation
Action: The system is ready to persist changes
Logic Flow:
IF All cargo status fields have been modified according to business rules
AND The system is ready to persist changes
THEN:
• Execute database update operation using GCCUSIO with segment replacement function for the cargo record
R-GCX015-cbl-00312 (+19)File: GCX015.cblBusiness Rule: Set Up Customs Transaction Data
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when train record exists with status, aei send flag, enroute reporting status, and train identifier.
Trigger Criteria:
Context: A train record exists with status, AEI send flag, enroute reporting status, and train identifier
Applied to: Train Qualifies for AEI?
Action: The system evaluates AEI processing eligibility
Logic Flow:
IF A train record exists with status, AEI send flag, enroute reporting status, and train identifier
AND The system evaluates AEI processing eligibility
THEN:
• The train qualifies for AEI processing if it has ACK status AND AEI send flag is enabled AND enroute is not yet reported AND train identifier ends with 'T'
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when train qualifies for aei processing.
Trigger Criteria:
Context: A train qualifies for AEI processing
Applied to: Set Transaction Code to GCT1461E
Action: Setting up customs transaction data
Logic Flow:
IF A train qualifies for AEI processing
AND Setting up customs transaction data
THEN:
• The customs transaction code is set to 'GCT1461E'
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when customs transaction is being prepared for aei processing.
Trigger Criteria:
Context: A customs transaction is being prepared for AEI processing
Applied to: Set Security Level to High
Action: Setting security parameters
Logic Flow:
IF A customs transaction is being prepared for AEI processing
AND Setting security parameters
THEN:
• The security level is set to high values (HIGH-VALUES)
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when customs transaction is being configured.
Trigger Criteria:
Context: A customs transaction is being configured
Applied to: Set Customs Code to 'A'
Action: Setting the customs processing code
Logic Flow:
IF A customs transaction is being configured
AND Setting the customs processing code
THEN:
• The customs code is set to 'A'
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when train record with a valid train identifier. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A train record with a valid train identifier
Applied to: Copy Train ID to Customs Train ID
Action: Building the customs transaction
Logic Flow:
IF A train record with a valid train identifier
AND Building the customs transaction
THEN:
• The train identifier is copied to the customs train ID field
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train record with station routing information.
Trigger Criteria:
Context: A train record with station routing information
Applied to: Set Station Information
Action: Setting up customs transaction routing data
Logic Flow:
IF A train record with station routing information
AND Setting up customs transaction routing data
THEN:
• Both origin and destination stations are set to the train's from station
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when train record with a consist number. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A train record with a consist number
Applied to: Copy Train Consist Number
Action: Building customs transaction data
Logic Flow:
IF A train record with a consist number
AND Building customs transaction data
THEN:
• The train consist number is copied to the customs consist field
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when train record with estimated departure date (eda).
Trigger Criteria:
Context: A train record with estimated departure date (EDA)
Applied to: Set Event Date from Train Data
Action: Configuring customs transaction timing
Logic Flow:
IF A train record with estimated departure date (EDA)
AND Configuring customs transaction timing
THEN:
• The event date is set to the train's P402 EDA value
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when train record with estimated time of arrival (eta).
Trigger Criteria:
Context: A train record with estimated time of arrival (ETA)
Applied to: Set Event Time from Train Data
Action: Configuring customs transaction timing
Logic Flow:
IF A train record with estimated time of arrival (ETA)
AND Configuring customs transaction timing
THEN:
• The event time is set to the train's P405 ETA value
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when starting car information processing for a train.
Trigger Criteria:
Context: Starting car information processing for a train
Applied to: Initialize Car Counter Variables
Action: Initializing processing variables
Logic Flow:
IF Starting car information processing for a train
AND Initializing processing variables
THEN:
• Car counter is set to 1, secondary counter is set to 2, and tertiary counter is set to 2
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when beginning car data processing for customs transaction.
Trigger Criteria:
Context: Beginning car data processing for customs transaction
Applied to: Clear Customs Output Table
Action: Preparing the output data structure
Logic Flow:
IF Beginning car data processing for customs transaction
AND Preparing the output data structure
THEN:
• The customs output table is cleared to spaces
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when processing cars in a train consist.
Trigger Criteria:
Context: Processing cars in a train consist
Applied to: More Cars to Process?
Action: Determining whether to continue processing
Logic Flow:
IF Processing cars in a train consist
AND Determining whether to continue processing
THEN:
• Continue processing if current car index is within equipment quantity AND car counter is 500 or less
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when car with container indicator in the train consist.
Trigger Criteria:
Context: A car with container indicator in the train consist
Applied to: Skip Container Cars
Action: Processing individual cars for customs data
Logic Flow:
IF A car with container indicator in the train consist
AND Processing individual cars for customs data
THEN:
• Skip the car if its container indicator is 'C'
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when non-container car with equipment initials and number. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A non-container car with equipment initials and number
Applied to: Copy Car Initials and Numbers
Action: Building customs car data
Logic Flow:
IF A non-container car with equipment initials and number
AND Building customs car data
THEN:
• Copy equipment initials to customs car initials AND convert equipment number to 6-digit format for customs car number
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when car being processed with load/empty indicator and information about subsequent cars.
Trigger Criteria:
Context: A car being processed with load/empty indicator and information about subsequent cars
Applied to: Determine Car Load Status
Action: Setting the car's load status for customs
Logic Flow:
IF A car being processed with load/empty indicator and information about subsequent cars
AND Setting the car's load status for customs
THEN:
• If processing the last car, use its load/empty indicator; otherwise, if the next car is a container, set status to 'L' (loaded); otherwise, use current car's load/empty indicator
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when car with equipment type designation.
Trigger Criteria:
Context: A car with equipment type designation
Applied to: Set Car Type Information
Action: Setting customs car type information
Logic Flow:
IF A car with equipment type designation
AND Setting customs car type information
THEN:
• If equipment type is 'LO', set car kind to 'L'; if equipment type is 'ET', set car kind to 'E'; otherwise, set car kind to spaces
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when non-container car has been processed successfully.
Trigger Criteria:
Context: A non-container car has been processed successfully
Applied to: Increment Car Counter
Action: Completing car data processing
Logic Flow:
IF A non-container car has been processed successfully
AND Completing car data processing
THEN:
• Increment the car counter by 1 AND increment the tertiary counter by 1
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when completed customs transaction with all car data loaded. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A completed customs transaction with all car data loaded
Applied to: Send Transaction to CIMS
Action: Submitting the transaction for processing
Logic Flow:
IF A completed customs transaction with all car data loaded
AND Submitting the transaction for processing
THEN:
• Call CIMS with change operation using the customs transaction code
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when customs transaction ready for queue processing. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A customs transaction ready for queue processing
Applied to: Write Message to Queue
Action: Submitting the message to the queue
Logic Flow:
IF A customs transaction ready for queue processing
AND Submitting the message to the queue
THEN:
• Call WRITMSGL with send message code, customs transaction data, message length, and module name
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when customs transaction has been successfully submitted. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A customs transaction has been successfully submitted
Applied to: Purge Transaction
Action: Completing the AEI processing
Logic Flow:
IF A customs transaction has been successfully submitted
AND Completing the AEI processing
THEN:
• Call CIMS with purge operation to clean up the transaction
R-GCX015-cbl-00332 (+7)File: GCX015.cblBusiness Rule: Get AEI Merlin Recipients
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when train record with security code (secx) is available.
Trigger Criteria:
Context: A train record with security code (SECX) is available
Applied to: Extract Port from Train Security Code
Action: The system needs to determine the port for AEI email lookup
Logic Flow:
IF A train record with security code (SECX) is available
AND The system needs to determine the port for AEI email lookup
THEN:
• The system extracts the first 4 characters of the security code as the port identifier
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when system needs to query aei email database for distribution list.
Trigger Criteria:
Context: The system needs to query AEI email database for distribution list
Applied to: Set Record Type to CUSEMAIL
Action: Setting up database query parameters
Logic Flow:
IF The system needs to query AEI email database for distribution list
AND Setting up database query parameters
THEN:
• The system sets record type to 'CUSEMAIL' and uses extracted port as the record key
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when database query parameters are set with port and record type. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Database query parameters are set with port and record type
Applied to: Call AEI Email Database Query
Action: The system executes the AEI email database query
Logic Flow:
IF Database query parameters are set with port and record type
AND The system executes the AEI email database query
THEN:
• The system calls AECWRKTB program to retrieve email distribution information
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when aei email database query returns success status.
Trigger Criteria:
Context: AEI email database query returns success status
Applied to: Set Default Merlin ID as Sender
Action: Processing the successful query response
Logic Flow:
IF AEI email database query returns success status
AND Processing the successful query response
THEN:
• The system sets the default Merlin ID as the message sender
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when database query was successful and returned email data.
Trigger Criteria:
Context: Database query was successful and returned email data
Applied to: Load Retrieved Email Recipients
Action: Processing the retrieved email information
Logic Flow:
IF Database query was successful and returned email data
AND Processing the retrieved email information
THEN:
• The system iterates through up to 10 email addresses and loads non-blank user IDs into the recipient list
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when database query was successful but no email recipients were found.
Trigger Criteria:
Context: Database query was successful but no email recipients were found
Applied to: Use Default Merlin ID as Recipient
Action: All retrieved email addresses are blank or empty
Logic Flow:
IF Database query was successful but no email recipients were found
AND All retrieved email addresses are blank or empty
THEN:
• The system uses the default Merlin ID as both sender and recipient
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when aei email database query returns no entry found status.
Trigger Criteria:
Context: AEI email database query returns no entry found status
Applied to: Use Default Merlin ID as Recipient
Action: The specified port has no email distribution configuration
Logic Flow:
IF AEI email database query returns no entry found status
AND The specified port has no email distribution configuration
THEN:
• The system uses the default Merlin ID as both sender and recipient
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when aei email database query returns an error status other than no entry found.
Trigger Criteria:
Context: AEI email database query returns an error status other than no entry found
Applied to: Send DB2 Error Alert
Action: A database error occurs during email lookup
Logic Flow:
IF AEI email database query returns an error status other than no entry found
AND A database error occurs during email lookup
THEN:
• The system sends a DB2 error alert message and uses the default Merlin ID as recipient
Business Justification: Ensures correct system behavior and process compliance when error report needs to be transmitted via merlin system.
Trigger Criteria:
Context: An error report needs to be transmitted via Merlin system
Applied to: Set Merlin From User Code to OM01247
Action: Setting up primary transmission parameters
Logic Flow:
IF An error report needs to be transmitted via Merlin system
AND Setting up primary transmission parameters
THEN:
• The from user code should be set to OM01247 for sender identification
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when error report transmission is being configured.
Trigger Criteria:
Context: Error report transmission is being configured
Applied to: Set Primary To User Code to OM01247
Action: Setting primary recipient information
Logic Flow:
IF Error report transmission is being configured
AND Setting primary recipient information
THEN:
• The primary to user code should be set to OM01247
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when error report is being prepared for transmission.
Trigger Criteria:
Context: Error report is being prepared for transmission
Applied to: Set Subject from Merlin Subject
Action: Setting the message subject
Logic Flow:
IF Error report is being prepared for transmission
AND Setting the message subject
THEN:
• The subject should be assigned from the Merlin subject field
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when error report is formatted and ready for transmission. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Error report is formatted and ready for transmission
Applied to: Call EMCSEND2 for Primary Send
Action: Initiating primary send operation
Logic Flow:
IF Error report is formatted and ready for transmission
AND Initiating primary send operation
THEN:
• EMCSEND2 should be called with configured parameters to transmit the error report
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when primary error report transmission has been attempted.
Trigger Criteria:
Context: Primary error report transmission has been attempted
Applied to: Primary Send Successful?
Action: Checking transmission result status
Logic Flow:
IF Primary error report transmission has been attempted
AND Checking transmission result status
THEN:
• IfEMI-NO-ERRORS condition is true, the transmission is considered successful
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when primary transmission was successful and secondary transmission is required.
Trigger Criteria:
Context: Primary transmission was successful and secondary transmission is required
Applied to: Set To User Code from Admin Table MERLIN-1
Action: Setting up secondary recipient information
Logic Flow:
IF Primary transmission was successful and secondary transmission is required
AND Setting up secondary recipient information
THEN:
• The to user code should be retrieved from admin table field GCSTBRT-AD-DC-P-MERLIN-1
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when secondary transmission is being configured. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Secondary transmission is being configured
Applied to: Set Copy User Code from Admin Table MERLIN-5
Action: Setting copy recipient information
Logic Flow:
IF Secondary transmission is being configured
AND Setting copy recipient information
THEN:
• The copy user code should be retrieved from admin table field GCSTBRT-AD-DC-P-MERLIN-5
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when secondary transmission is being set up.
Trigger Criteria:
Context: Secondary transmission is being set up
Applied to: Use Alternative Destination Filename
Action: Configuring destination parameters
Logic Flow:
IF Secondary transmission is being set up
AND Configuring destination parameters
THEN:
• The destination filename should be set to EMI-DESTINATION-FILENAME2
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when secondary transmission parameters are configured. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Secondary transmission parameters are configured
Applied to: Call EMCSEND2 for Secondary Send
Action: Initiating secondary send operation
Logic Flow:
IF Secondary transmission parameters are configured
AND Initiating secondary send operation
THEN:
• EMCSEND2 should be called with alternative destination and recipient configuration
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when secondary error report transmission has been attempted.
Trigger Criteria:
Context: Secondary error report transmission has been attempted
Applied to: Secondary Send Successful?
Action: Checking secondary transmission result status
Logic Flow:
IF Secondary error report transmission has been attempted
AND Checking secondary transmission result status
THEN:
• IfEMI-NO-ERRORS condition is true, the secondary transmission is considered successful
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when error report transmission has failed. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Error report transmission has failed
Applied to: Handle Send Failure Error
Action: Evaluating the failure type
Logic Flow:
IF Error report transmission has failed
AND Evaluating the failure type
THEN:
• IfEMI-FROM-NOT-FOUND then set error message to 'EMI - INVALID MERLIN FROM', ifEMI-TO-OR-COPY-NOT-FOUND then set error message to 'EMI - INVALID MERLIN TO OR COPY', ifEMI-FILENAME-INVALID then set error message to 'EMI - INVALID MERLIN FILENAME', and perform abend procedure
R-GCX015-cbl-00351 (+9)File: GCX015.cblBusiness Rule: Load Car Information Loop
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when train car is being processed for customs reporting.
Trigger Criteria:
Context: A train car is being processed for customs reporting
Applied to: Is Car a Container?
Action: The car has a container indicator of 'C'
Logic Flow:
IF A train car is being processed for customs reporting
AND The car has a container indicator of 'C'
THEN:
• The car should be skipped and not included in the customs car records
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when non-container car is being processed for customs.
Trigger Criteria:
Context: A non-container car is being processed for customs
Applied to: Extract Car Initials
Action: The car equipment information is available
Logic Flow:
IF A non-container car is being processed for customs
AND The car equipment information is available
THEN:
• The car initials should be extracted from the equipment initials field and stored in the customs car record
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when non-container car is being processed for customs.
Trigger Criteria:
Context: A non-container car is being processed for customs
Applied to: Extract Car Number
Action: The car equipment number is available
Logic Flow:
IF A non-container car is being processed for customs
AND The car equipment number is available
THEN:
• The car number should be extracted and converted to a 6-digit format for the customs car record
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when car is being processed and there are more cars in the train sequence.
Trigger Criteria:
Context: A car is being processed and there are more cars in the train sequence
Applied to: Determine Load/Empty Status from Next Car
Action: The next car in sequence has a container indicator of 'C'
Logic Flow:
IF A car is being processed and there are more cars in the train sequence
AND The next car in sequence has a container indicator of 'C'
THEN:
• The current car's load/empty status should be set to 'L' (Loaded), otherwise use the current car's load/empty status
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when car is being processed and it is the last car in the train sequence.
Trigger Criteria:
Context: A car is being processed and it is the last car in the train sequence
Applied to: Use Current Car Load/Empty Status
Action: No next car is available to check container status
Logic Flow:
IF A car is being processed and it is the last car in the train sequence
AND No next car is available to check container status
THEN:
• The current car's own load/empty status indicator should be used for the customs record
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when car is being processed for customs reporting.
Trigger Criteria:
Context: A car is being processed for customs reporting
Applied to: Set Car Kind = 'L' for Locomotive
Action: The equipment type is 'LO'
Logic Flow:
IF A car is being processed for customs reporting
AND The equipment type is 'LO'
THEN:
• The car kind should be set to 'L' to indicate locomotive
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when car is being processed for customs reporting.
Trigger Criteria:
Context: A car is being processed for customs reporting
Applied to: Set Car Kind = Blank
Action: The equipment type is neither 'LO' nor 'ET'
Logic Flow:
IF A car is being processed for customs reporting
AND The equipment type is neither 'LO' nor 'ET'
THEN:
• The car kind should be set to blank spaces
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when car is being processed for customs reporting and equipment type is not 'lo'.
Trigger Criteria:
Context: A car is being processed for customs reporting and equipment type is not 'LO'
Applied to: Set Car Kind = 'E' for Engine
Action: The equipment type is 'ET'
Logic Flow:
IF A car is being processed for customs reporting and equipment type is not 'LO'
AND The equipment type is 'ET'
THEN:
• The car kind should be set to 'E' to indicate engine
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when all car information has been extracted and classified.
Trigger Criteria:
Context: All car information has been extracted and classified
Applied to: Build Customs Car Record
Action: Car initials, number, load/empty status, and car kind have been determined
Logic Flow:
IF All car information has been extracted and classified
AND Car initials, number, load/empty status, and car kind have been determined
THEN:
• A complete customs car record should be built with all the processed information
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when car record has been successfully built for customs.
Trigger Criteria:
Context: A car record has been successfully built for customs
Applied to: Increment Car Counter
Action: The car processing is complete
Logic Flow:
IF A car record has been successfully built for customs
AND The car processing is complete
THEN:
• The car counter should be incremented by 1 and the position counter should be incremented by 1
Business Justification: Establishes the required business protocol to be followed when aei email database query is requested.
Trigger Criteria:
Context: AEI email database query is requested
Applied to: Initialize Database Work Area
Action: the system begins the database lookup process
Logic Flow:
IF AEI email database query is requested
AND the system begins the database lookup process
THEN:
• the database work area AELWRKTB is initialized to clear any previous data
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when train record with security code gcwtl-secx exists. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: a train record with security code GCWTL-SECX exists
Applied to: Extract Train Port from Security Code
Action: the system needs to identify the train port for email lookup
Logic Flow:
IF a train record with security code GCWTL-SECX exists
AND the system needs to identify the train port for email lookup
THEN:
• the train port is extracted from WS-TRAIN-SECXand moved to the first 4 positions of RECORD-KEY
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when aei email database query is being prepared.
Trigger Criteria:
Context: AEI email database query is being prepared
Applied to: Set Record Type to CUSEMAIL
Action: the system configures the database lookup parameters
Logic Flow:
IF AEI email database query is being prepared
AND the system configures the database lookup parameters
THEN:
• the RECORD-TYPE is set to 'CUSEMAIL' to specify customer email record lookup
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when database lookup parameters are configured with train port and cusemail record type. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: database lookup parameters are configured with train port and CUSEMAIL record type
Applied to: Call AECWRKTB Database Function
Action: the system executes the database query
Logic Flow:
IF database lookup parameters are configured with train port and CUSEMAIL record type
AND the system executes the database query
THEN:
• AECWRKTB is called with work area, return code, and DB2 SQL code parameters
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when aei email database query returns success code cst-aei-success.
Action: the system handles the no entry found condition
Logic Flow:
IF AEI email database query returns CST-AEI-NO-ENTRY
AND the system handles the no entry found condition
THEN:
• CST-DEFAULT-MERLIN-ID is set as both EMI-FROM-USERCODEandEMI-TO-USERCODE
Rule Belongs to : GCX015.cbl
Business Justification: Defines the strict business conditions required to proceed when aei email database query returns error code other than cst-aei-success or cst-aei-no-entry.
Trigger Criteria:
Context: AEI email database query returns error code other than CST-AEI-SUCCESS or CST-AEI-NO-ENTRY
Applied to: Send DB2 Error Alert
Action: the system encounters a database error
Logic Flow:
IF AEI email database query returns error code other than CST-AEI-SUCCESS or CST-AEI-NO-ENTRY
AND the system encounters a database error
THEN:
• B700-DB2-ABEND procedure is performed andCST-DEFAULT-MERLIN-ID is set as EMI-TO-USERCODE
R-GCX015-cbl-00369 (+7)File: GCX015.cblBusiness Rule: Call EMCSEND2 for Primary Send
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when merlin message needs to be sent.
Trigger Criteria:
Context: A Merlin message needs to be sent
Applied to: Set From User to OM01247
Action: Setting up the primary message transmission
Logic Flow:
IF A Merlin message needs to be sent
AND Setting up the primary message transmission
THEN:
• The from user code should be set to OM01247
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when merlin message sender has been configured.
Trigger Criteria:
Context: A Merlin message sender has been configured
Applied to: Set To User to OM01247
Action: Setting up the message recipient
Logic Flow:
IF A Merlin message sender has been configured
AND Setting up the message recipient
THEN:
• The to user code should be set to OM01247
Rule Belongs to : GCX015.cbl
Business Justification: Dictates the expected operational logic and validation steps when merlin message has been configured with sender and recipient.
Trigger Criteria:
Context: A Merlin message has been configured with sender and recipient
Applied to: Set Subject to Merlin Subject
Action: Setting the message subject
Logic Flow:
IF A Merlin message has been configured with sender and recipient
AND Setting the message subject
THEN:
• The subject should be set to the predefined Merlin subject content
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when merlin message has been fully configured with sender, recipient, and subject. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A Merlin message has been fully configured with sender, recipient, and subject
Applied to: Call EMCSEND2 for Primary Send
Action: Executing the message transmission
Logic Flow:
IF A Merlin message has been fully configured with sender, recipient, and subject
AND Executing the message transmission
THEN:
• The EMCSEND2 service should be called with all message parameters
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when merlin message has been successfully transmitted.
Trigger Criteria:
Context: A Merlin message has been successfully transmitted
Applied to: Purge Message Queue
Action: The transmission completes without errors
Logic Flow:
IF A Merlin message has been successfully transmitted
AND The transmission completes without errors
THEN:
• The message queue should be purged to clean up resources
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when merlin message transmission has failed.
Trigger Criteria:
Context: A Merlin message transmission has failed
Applied to: Send Invalid From User Error
Action: The failure is due to an invalid sender user identification
Logic Flow:
IF A Merlin message transmission has failed
AND The failure is due to an invalid sender user identification
THEN:
• An invalid Merlin sender error message should be generated and the process should terminate abnormally
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when merlin message transmission has failed. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: A Merlin message transmission has failed
Applied to: Send Invalid To/Copy User Error
Action: The failure is due to an invalid recipient or copy user identification
Logic Flow:
IF A Merlin message transmission has failed
AND The failure is due to an invalid recipient or copy user identification
THEN:
• An invalid Merlin recipient or copy user error message should be generated and the process should terminate abnormally
Rule Belongs to : GCX015.cbl
Business Justification: Ensures correct system behavior and process compliance when merlin message transmission has failed.
Trigger Criteria:
Context: A Merlin message transmission has failed
Applied to: Send Invalid Filename Error
Action: The failure is due to an invalid filename
Logic Flow:
IF A Merlin message transmission has failed
AND The failure is due to an invalid filename
THEN:
• An invalid Merlin filename error message should be generated and the process should terminate abnormally
R-GCX015-cbl-00377 (+8)File: GCX015.cblBusiness Rule: Call EMCSEND2 for Secondary Send
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when secondary merlin send process is initiated.
Trigger Criteria:
Context: A secondary Merlin send process is initiated
Applied to: Initialize Secondary Recipients
Action: The system prepares to set up alternative recipients
Logic Flow:
IF A secondary Merlin send process is initiated
AND The system prepares to set up alternative recipients
THEN:
• All recipient user code fields are cleared to spaces
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when secondary merlin send is being configured.
Trigger Criteria:
Context: Secondary Merlin send is being configured
Applied to: Set Primary Merlin ID as From User
Action: The from user needs to be established
Logic Flow:
IF Secondary Merlin send is being configured
AND The from user needs to be established
THEN:
• The primary Merlin ID 'OM01247' is set as the from user code
Rule Belongs to : GCX015.cbl
Business Justification: Governs the functional prerequisites and system routing when secondary merlin send is being configured.
Trigger Criteria:
Context: Secondary Merlin send is being configured
Applied to: Set Secondary Destination File
Action: Destination file needs to be specified
Logic Flow:
IF Secondary Merlin send is being configured
AND Destination file needs to be specified
THEN:
• The secondary destination filename (EMI-DESTINATION-FILENAME2) is used for message delivery
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when secondary merlin send requires recipient configuration. ⚠️ COBOL Technical Logic
Action: Administrative table recipients need to be assigned
Logic Flow:
IF Secondary Merlin send requires recipient configuration
AND Administrative table recipients need to be assigned
THEN:
• Primary recipient is set from admin table DC-P-MERLIN-1 field and copy recipient is set from admin table DC-P-MERLIN-5 field
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when all secondary send parameters are configured. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: All secondary send parameters are configured
Applied to: Call EMCSEND2 for Secondary Send
Action: The secondary Merlin send is executed
Logic Flow:
IF All secondary send parameters are configured
AND The secondary Merlin send is executed
THEN:
• EMCSEND2 service is called with configured parameters including from user, destination file, recipients, subject, and message content
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when secondary merlin send has been executed.
Trigger Criteria:
Context: Secondary Merlin send has been executed
Applied to: Purge Message Queue
Action: The send operation completes without errors (EMI-NO-ERRORS)
Logic Flow:
IF Secondary Merlin send has been executed
AND The send operation completes without errors (EMI-NO-ERRORS)
THEN:
• The message queue is purged using CIMS with PURG function
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when secondary merlin send has been executed.
Trigger Criteria:
Context: Secondary Merlin send has been executed
Applied to: Handle From User Not Found Error
Action: The send fails due to invalid from user (EMI-FROM-NOT-FOUND)
Logic Flow:
IF Secondary Merlin send has been executed
AND The send fails due to invalid from user (EMI-FROM-NOT-FOUND)
THEN:
• System abend is triggered with error message 'EMI - INVALID MERLIN FROM'
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when secondary merlin send has been executed. ⚠️ COBOL Technical Logic
Trigger Criteria:
Context: Secondary Merlin send has been executed
Applied to: Handle To/Copy User Not Found Error
Action: The send fails due to invalid recipient or copy user (EMI-TO-OR-COPY-NOT-FOUND)
Logic Flow:
IF Secondary Merlin send has been executed
AND The send fails due to invalid recipient or copy user (EMI-TO-OR-COPY-NOT-FOUND)
THEN:
• System abend is triggered with error message 'EMI - INVALID MERLIN TO OR COPY'
Rule Belongs to : GCX015.cbl
Business Justification: Establishes the required business protocol to be followed when secondary merlin send has been executed.
Trigger Criteria:
Context: Secondary Merlin send has been executed
Applied to: Handle Invalid Filename Error
Action: The send fails due to invalid filename (EMI-FILENAME-INVALID)
Logic Flow:
IF Secondary Merlin send has been executed
AND The send fails due to invalid filename (EMI-FILENAME-INVALID)
THEN:
• System abend is triggered with error message 'EMI - INVALID MERLIN FILENAME'