Bits In Glass
BIG Pega COE Team

Detailed Acceptance Criteria (ACs)

Category: GCX105

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.

🎯 GCX105 Scope Detected: Extracted 181 rules, Optimally Merged into 36 Feature Scenarios.
R-GCX105-cbl-00001 (+21) File: GCX105.cbl Overview Rules Merged 22 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Overview Rules':
  • Context - a user attempts to access the log processing system:
    For 2:Security Validation:
    When the security byte is not equal to high-values, then the system denies access and terminates processing without performing any log operations.
  • Context - a valid authorized request is received:
    For 3:Determine Processing Type:
    When the transfer ccn flag is set to true, then the system performs transfer log processing.
    For 3:Determine Processing Type:
    When neither transfer ccn flag nor delete log flag is set to true, then the system performs standard log creation processing.
  • Context - a valid authorized request is received and transfer ccn flag is not set:
    For 3:Determine Processing Type:
    When the delete log flag is set to true, then the system performs delete log processing.
  • Context - standard log creation or transfer operation is being performed:
    For 6:Format Log Root Segment:
    When the system needs to create a log root segment, then the system formats the segment with train or us ccn as key, current machine date and century as loaded date, and record type code from input.
  • Context - a log root segment has been formatted:
    For 7:Insert Log Root Segment:
    When the system attempts to insert the segment into the database, then the system stores the segment and retrieves it if insertion is successful.
  • Context - a log detail segment needs to be created:
    For 8:Format Log Dependent Segment:
    When the system processes the input date and time, then the system computes a new key by subtracting the combined date-time value from nines complement to ensure chronological ordering.
  • Context - a log detail segment is being formatted:
    For 9:Process Manual Release Messages:
    When the action code is 'mmr', then the system formats the message using mmr message structure.
    For 10:Process Direct Message Entries:
    When the action code is 'zzz', then the system uses the message as-is without additional formatting.
    For 11:Process Cargo Train Operations:
    When the action code is 'cat', 'cdt', 'cfr', 'cpr', 'cpz', or 'ctp', then the system formats the message using the corresponding message structure for that specific cargo or train operation.
    For 13:Process Cargo Renumbering:
    When the action code is 'rno' or 'rnn', then the system formats the message using the corresponding renumbering message structure.
    For 15:Process Manual Cargo Changes:
    When the action code is 'mc' or 'md', then the system formats the message including the reason code and bond type information.
    For 14:Process Cargo Transfer Operations:
    When the action code is 'tft' or 'tff', then the system formats the message using the corresponding transfer message structure.
    For 16:Process Equipment Hold Operations:
    When the action code is 'hnf', 'hid', 'rid', 'szi', or 'szr', then the system formats the message including the equipment id information.
    For 18:Lookup Unknown Action Codes:
    When the action code is not one of the predefined codes, then the system searches the log table for the action code and uses the corresponding message, or generates an error message if not found.
  • Context - a log detail segment is being formatted with action code 'ca':
    For 18:Lookup Unknown Action Codes:
    When the bond type field is not empty, then the system formats the message as 'cargo created automatically tp:' concatenated with the bond type.
  • Context - a log detail segment has been formatted:
    For 19:Insert Log Dependent Segment:
    When the system attempts to insert the segment and encounters a duplicate key, then the system automatically decrements the key value and retries insertion up to 50 times.
  • Context - standard log creation has been completed successfully:
    For 21:Spawn Vista GUI Transaction:
    When the record type code is 'cc' or 'uc' and both log root and detail insertions were successful, then the system spawns the gct1511e transaction with the formatted log segments.
  • Context - a transfer or delete operation is being performed:
    For 22:Find Existing Log Root:
    When the system searches for an existing log root using the provided ccn, then the system determines if the log root exists and sets the appropriate status flag.
  • Context - a transfer operation is being performed and the old log root exists:
    For 23:Retrieve Log Dependent Segments:
    When the system retrieves associated detail records, then the system collects up to 100 detail records associated with the old log root.
  • Context - a transfer operation has successfully created new log entries or a delete operation is requested:
    For 24:Delete Old Log Entries:
    When the old log root exists in the system, then the system deletes the old log root and all associated detail records.
  • Context - a delete log operation is requested:
    For 5:Delete Log Processing:
    When the system locates the log root using the provided ccn, then the system deletes the entire log structure if found.
👨‍💻 Technical ACs (Gherkin)
Context: A user attempts to access the log processing system
GIVEN
A user attempts to access the log processing system
Applied to: 2:Security Validation
WHEN
The security byte is not equal to HIGH-VALUES
THEN
The system denies access and terminates processing without performing any log operations
Context: A valid authorized request is received
GIVEN
A valid authorized request is received
Applied to: 3:Determine Processing Type
WHEN
The transfer CCN flag is set to true
THEN
The system performs transfer log processing
Applied to: 3:Determine Processing Type
WHEN
Neither transfer CCN flag nor delete log flag is set to true
THEN
The system performs standard log creation processing
Context: A valid authorized request is received and transfer CCN flag is not set
GIVEN
A valid authorized request is received and transfer CCN flag is not set
Applied to: 3:Determine Processing Type
WHEN
The delete log flag is set to true
THEN
The system performs delete log processing
Context: Standard log creation or transfer operation is being performed
GIVEN
Standard log creation or transfer operation is being performed
Applied to: 6:Format Log Root Segment
WHEN
The system needs to create a log root segment
THEN
The system formats the segment with train or US CCN as key, current machine date and century as loaded date, and record type code from input
Context: A log root segment has been formatted
GIVEN
A log root segment has been formatted
Applied to: 7:Insert Log Root Segment
WHEN
The system attempts to insert the segment into the database
THEN
The system stores the segment and retrieves it if insertion is successful
Context: A log detail segment needs to be created
GIVEN
A log detail segment needs to be created
Applied to: 8:Format Log Dependent Segment
WHEN
The system processes the input date and time
THEN
The system computes a new key by subtracting the combined date-time value from nines complement to ensure chronological ordering
Context: A log detail segment is being formatted
GIVEN
A log detail segment is being formatted
Applied to: 9:Process Manual Release Messages
WHEN
The action code is 'MMR'
THEN
The system formats the message using MMR message structure
Applied to: 10:Process Direct Message Entries
WHEN
The action code is 'ZZZ'
THEN
The system uses the message as-is without additional formatting
Applied to: 11:Process Cargo Train Operations
WHEN
The action code is 'CAT', 'CDT', 'CFR', 'CPR', 'CPZ', or 'CTP'
THEN
The system formats the message using the corresponding message structure for that specific cargo or train operation
Applied to: 13:Process Cargo Renumbering
WHEN
The action code is 'RNO' or 'RNN'
THEN
The system formats the message using the corresponding renumbering message structure
Applied to: 15:Process Manual Cargo Changes
WHEN
The action code is 'MC' or 'MD'
THEN
The system formats the message including the reason code and bond type information
Applied to: 14:Process Cargo Transfer Operations
WHEN
The action code is 'TFT' or 'TFF'
THEN
The system formats the message using the corresponding transfer message structure
Applied to: 16:Process Equipment Hold Operations
WHEN
The action code is 'HNF', 'HID', 'RID', 'SZI', or 'SZR'
THEN
The system formats the message including the equipment ID information
Applied to: 18:Lookup Unknown Action Codes
WHEN
The action code is not one of the predefined codes
THEN
The system searches the log table for the action code and uses the corresponding message, or generates an error message if not found
Context: A log detail segment is being formatted with action code 'CA'
GIVEN
A log detail segment is being formatted with action code 'CA'
Applied to: 18:Lookup Unknown Action Codes
WHEN
The bond type field is not empty
THEN
The system formats the message as 'CARGO CREATED AUTOMATICALLY TP:' concatenated with the bond type
Context: A log detail segment has been formatted
GIVEN
A log detail segment has been formatted
Applied to: 19:Insert Log Dependent Segment
WHEN
The system attempts to insert the segment and encounters a duplicate key
THEN
The system automatically decrements the key value and retries insertion up to 50 times
Context: Standard log creation has been completed successfully
GIVEN
Standard log creation has been completed successfully
Applied to: 21:Spawn Vista GUI Transaction
WHEN
The record type code is 'CC' or 'UC' and both log root and detail insertions were successful
THEN
The system spawns the GCT1511E transaction with the formatted log segments
Context: A transfer or delete operation is being performed
GIVEN
A transfer or delete operation is being performed
Applied to: 22:Find Existing Log Root
WHEN
The system searches for an existing log root using the provided CCN
THEN
The system determines if the log root exists and sets the appropriate status flag
Context: A transfer operation is being performed and the old log root exists
GIVEN
A transfer operation is being performed and the old log root exists
Applied to: 23:Retrieve Log Dependent Segments
WHEN
The system retrieves associated detail records
THEN
The system collects up to 100 detail records associated with the old log root
Context: A transfer operation has successfully created new log entries or a delete operation is requested
GIVEN
A transfer operation has successfully created new log entries or a delete operation is requested
Applied to: 24:Delete Old Log Entries
WHEN
The old log root exists in the system
THEN
The system deletes the old log root and all associated detail records
Context: A delete log operation is requested
GIVEN
A delete log operation is requested
Applied to: 5:Delete Log Processing
WHEN
The system locates the log root using the provided CCN
THEN
The system deletes the entire log structure if found
R-GCX105-cbl-00023 (+1) File: GCX105.cbl Read Input Message Merged 2 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Read Input Message':
  • Context - a transaction message exists in the message queue:
    For Call Message Queue Reader:
    When the system calls the message queue reader, then the message is retrieved from the queue for processing.
  • Context - a message has been retrieved from the queue with a specific length:
    For Move Message Content to Input Structure:
    When the system processes the message content, then the message content is moved to the input structure using the determined message length.
👨‍💻 Technical ACs (Gherkin)
Context: A transaction message exists in the message queue
GIVEN
A transaction message exists in the message queue
Applied to: Call Message Queue Reader
WHEN
The system calls the message queue reader
THEN
The message is retrieved from the queue for processing
Context: A message has been retrieved from the queue with a specific length
GIVEN
A message has been retrieved from the queue with a specific length
Applied to: Move Message Content to Input Structure
WHEN
The system processes the message content
THEN
The message content is moved to the input structure using the determined message length
R-GCX105-cbl-00025 (+2) File: GCX105.cbl Security Validation Merged 3 Rules
Validation Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Security Validation':
  • Context - a user attempts to access the log processing system with a security byte value:
    For Security Byte = HIGH-VALUES?:
    When the system checks if the security byte equals high-values, then access is granted if security byte is high-values, otherwise access is denied and processing terminates.
  • Context - security validation has passed successfully:
    For Access Authorized - Continue Processing:
    When the security byte equals high-values, then the system continues to execute the main processing logic for log operations.
  • Context - a user attempts to access the system with invalid security credentials:
    For Access Denied - Exit Program:
    When the security byte does not equal high-values, then the system denies access and terminates the program without performing any log operations.
👨‍💻 Technical ACs (Gherkin)
Context: A user attempts to access the log processing system with a security byte value
GIVEN
A user attempts to access the log processing system with a security byte value
Applied to: Security Byte = HIGH-VALUES?
WHEN
The system checks if the security byte equals HIGH-VALUES
THEN
Access is granted if security byte is HIGH-VALUES, otherwise access is denied and processing terminates
Context: Security validation has passed successfully
GIVEN
Security validation has passed successfully
Applied to: Access Authorized - Continue Processing
WHEN
The security byte equals HIGH-VALUES
THEN
The system continues to execute the main processing logic for log operations
Context: A user attempts to access the system with invalid security credentials
GIVEN
A user attempts to access the system with invalid security credentials
Applied to: Access Denied - Exit Program
WHEN
The security byte does not equal HIGH-VALUES
THEN
The system denies access and terminates the program without performing any log operations
R-GCX105-cbl-00028 (+2) File: GCX105.cbl Determine Processing Type Merged 3 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Determine Processing Type':
  • Context - a transaction message has been received and validated:
    For Check GCX105-TRANSFER-CCN Flag:
    When the system checks the gcx105-transfer-ccn flag in the input message, then if the transfer flag is set, route the transaction to transfer log processing workflow.
    For Route to Standard Log Update Processing:
    When both the gcx105-transfer-ccn flag and gcx105-delete-log flag are not set, then route the transaction to standard log update processing workflow to create new log entries.
  • Context - a transaction message has been received and the transfer flag is not set:
    For Check GCX105-DELETE-LOG Flag:
    When the system checks the gcx105-delete-log flag in the input message, then if the delete flag is set, route the transaction to delete log processing workflow.
👨‍💻 Technical ACs (Gherkin)
Context: A transaction message has been received and validated
GIVEN
A transaction message has been received and validated
Applied to: Check GCX105-TRANSFER-CCN Flag
WHEN
The system checks the GCX105-TRANSFER-CCN flag in the input message
THEN
If the transfer flag is set, route the transaction to transfer log processing workflow
Applied to: Route to Standard Log Update Processing
WHEN
Both the GCX105-TRANSFER-CCN flag and GCX105-DELETE-LOG flag are not set
THEN
Route the transaction to standard log update processing workflow to create new log entries
Context: A transaction message has been received and the transfer flag is not set
GIVEN
A transaction message has been received and the transfer flag is not set
Applied to: Check GCX105-DELETE-LOG Flag
WHEN
The system checks the GCX105-DELETE-LOG flag in the input message
THEN
If the delete flag is set, route the transaction to delete log processing workflow
R-GCX105-cbl-00031 (+14) File: GCX105.cbl Transfer Log Processing Merged 15 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Transfer Log Processing':
  • Context - a transfer request is received with an old ccn:
    For Find Old Log Root by Old CCN:
    When the system searches for the existing log root using the old ccn, then the system determines whether the old log root exists and sets the appropriate status flag.
  • Context - the system has searched for an old log root record:
    For Old Log Root Found?:
    When the search operation completes, then if old log root is found, proceed with transfer initialization, otherwise terminate transfer process.
  • Context - an old log root has been found for transfer:
    For Initialize Transfer Variables:
    When the system begins transfer processing, then set dependent segment found flag to true, initialize key value to zero, initialize counter to zero, and clear dependent segment storage area.
  • Context - transfer variables are initialized and old log root exists:
    For Retrieve First Dependent Segment:
    When the system retrieves dependent segments using get next parent operation, then if segment is found, increment counter and store segment in memory array, otherwise set dependent segment not found flag.
  • Context - a dependent segment retrieval operation has completed:
    For More Segments Available?:
    When the system checks the operation status and counter limits, then if status indicates success and counter is less than 100, continue retrieval, otherwise proceed to new log creation.
  • Context - a dependent segment has been successfully retrieved:
    For Store Segment in Memory:
    When the segment data is available, then increment the storage counter and move the segment data to the corresponding position in the memory array.
  • Context - all dependent segments have been retrieved and stored:
    For Create New Log Root with New CCN:
    When the system creates the new log structure, then format new log root with current ccn as key, current machine date, and record type code from input.
  • Context - a new log root record has been formatted with current ccn:
    For Insert New Log Root:
    When the system performs the insert operation, then insert the log root record and if successful, retrieve it to establish database positioning.
  • Context - new log root has been successfully inserted and dependent segments are stored in memory:
    For Process Each Stored Segment:
    When the system processes stored segments using a loop from 1 to 100, then for each non-empty segment, initialize segment structure and move stored data to working segment.
  • Context - a dependent segment is being processed for transfer:
    For Update Segment Key:
    When the segment data is moved to working storage, then extract the dependent key from the segment and move it to the new key field for insertion.
  • Context - a dependent segment has been prepared with updated key:
    For Insert Segment to New Log:
    When the system performs the insert operation, then insert the dependent segment as a child of the new log root record.
  • Context - a dependent segment has been inserted into the new log structure:
    For More Segments to Transfer?:
    When the system checks the loop counter and segment availability, then if counter is less than or equal to 100 and segment is not empty, continue processing, otherwise proceed to cleanup.
  • Context - all dependent segments have been successfully transferred to new log structure:
    For Position to Old Log Root:
    When the system prepares to delete the old log structure, then use get hold unique operation to position on the old log root using the old ccn.
  • Context - the system has positioned to the old log root location:
    For Old Log Root Still Exists?:
    When the positioning operation completes, then if status indicates successful positioning, proceed with deletion, otherwise complete transfer process.
  • Context - the old log root has been located and transfer is complete:
    For Delete Old Log Root and All Segments:
    When the system performs the delete operation, then delete the old log root record which cascades to remove all associated dependent segments.
👨‍💻 Technical ACs (Gherkin)
Context: A transfer request is received with an old CCN
GIVEN
A transfer request is received with an old CCN
Applied to: Find Old Log Root by Old CCN
WHEN
The system searches for the existing log root using the old CCN
THEN
The system determines whether the old log root exists and sets the appropriate status flag
Context: The system has searched for an old log root record
GIVEN
The system has searched for an old log root record
Applied to: Old Log Root Found?
WHEN
The search operation completes
THEN
If old log root is found, proceed with transfer initialization, otherwise terminate transfer process
Context: An old log root has been found for transfer
GIVEN
An old log root has been found for transfer
Applied to: Initialize Transfer Variables
WHEN
The system begins transfer processing
THEN
Set dependent segment found flag to true, initialize key value to zero, initialize counter to zero, and clear dependent segment storage area
Context: Transfer variables are initialized and old log root exists
GIVEN
Transfer variables are initialized and old log root exists
Applied to: Retrieve First Dependent Segment
WHEN
The system retrieves dependent segments using get next parent operation
THEN
If segment is found, increment counter and store segment in memory array, otherwise set dependent segment not found flag
Context: A dependent segment retrieval operation has completed
GIVEN
A dependent segment retrieval operation has completed
Applied to: More Segments Available?
WHEN
The system checks the operation status and counter limits
THEN
If status indicates success and counter is less than 100, continue retrieval, otherwise proceed to new log creation
Context: A dependent segment has been successfully retrieved
GIVEN
A dependent segment has been successfully retrieved
Applied to: Store Segment in Memory
WHEN
The segment data is available
THEN
Increment the storage counter and move the segment data to the corresponding position in the memory array
Context: All dependent segments have been retrieved and stored
GIVEN
All dependent segments have been retrieved and stored
Applied to: Create New Log Root with New CCN
WHEN
The system creates the new log structure
THEN
Format new log root with current CCN as key, current machine date, and record type code from input
Context: A new log root record has been formatted with current CCN
GIVEN
A new log root record has been formatted with current CCN
Applied to: Insert New Log Root
WHEN
The system performs the insert operation
THEN
Insert the log root record and if successful, retrieve it to establish database positioning
Context: New log root has been successfully inserted and dependent segments are stored in memory
GIVEN
New log root has been successfully inserted and dependent segments are stored in memory
Applied to: Process Each Stored Segment
WHEN
The system processes stored segments using a loop from 1 to 100
THEN
For each non-empty segment, initialize segment structure and move stored data to working segment
Context: A dependent segment is being processed for transfer
GIVEN
A dependent segment is being processed for transfer
Applied to: Update Segment Key
WHEN
The segment data is moved to working storage
THEN
Extract the dependent key from the segment and move it to the new key field for insertion
Context: A dependent segment has been prepared with updated key
GIVEN
A dependent segment has been prepared with updated key
Applied to: Insert Segment to New Log
WHEN
The system performs the insert operation
THEN
Insert the dependent segment as a child of the new log root record
Context: A dependent segment has been inserted into the new log structure
GIVEN
A dependent segment has been inserted into the new log structure
Applied to: More Segments to Transfer?
WHEN
The system checks the loop counter and segment availability
THEN
If counter is less than or equal to 100 and segment is not empty, continue processing, otherwise proceed to cleanup
Context: All dependent segments have been successfully transferred to new log structure
GIVEN
All dependent segments have been successfully transferred to new log structure
Applied to: Position to Old Log Root
WHEN
The system prepares to delete the old log structure
THEN
Use get hold unique operation to position on the old log root using the old CCN
Context: The system has positioned to the old log root location
GIVEN
The system has positioned to the old log root location
Applied to: Old Log Root Still Exists?
WHEN
The positioning operation completes
THEN
If status indicates successful positioning, proceed with deletion, otherwise complete transfer process
Context: The old log root has been located and transfer is complete
GIVEN
The old log root has been located and transfer is complete
Applied to: Delete Old Log Root and All Segments
WHEN
The system performs the delete operation
THEN
Delete the old log root record which cascades to remove all associated dependent segments
R-GCX105-cbl-00046 (+4) File: GCX105.cbl Delete Log Processing Merged 5 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Delete Log Processing':
  • Context - a delete log request is being processed:
    For Set CCN as Search Key:
    When the system prepares to search for existing log entries, then the train or us ccn from input is set as the search key for log root lookup.
  • Context - the ccn search key has been set:
    For Search for Existing Log Root Entry:
    When the system searches for the log root entry in the database, then the system retrieves the log root entry if it exists or determines it is not found.
  • Context - a search for log root entry has been completed:
    For Log Root Entry Found?:
    When the system evaluates the search results, then if log root entry is found, proceed with deletion; otherwise, no action is required.
  • Context - a log root entry exists for the specified ccn:
    For Delete Complete Log Structure:
    When the system processes the delete request, then the complete log structure including root and all detail records is deleted from the database.
  • Context - no log root entry exists for the specified ccn:
    For No Action Required - Log Not Found:
    When the system processes the delete request, then no deletion action is performed and processing continues normally.
👨‍💻 Technical ACs (Gherkin)
Context: A delete log request is being processed
GIVEN
A delete log request is being processed
Applied to: Set CCN as Search Key
WHEN
The system prepares to search for existing log entries
THEN
The Train or US CCN from input is set as the search key for log root lookup
Context: The CCN search key has been set
GIVEN
The CCN search key has been set
Applied to: Search for Existing Log Root Entry
WHEN
The system searches for the log root entry in the database
THEN
The system retrieves the log root entry if it exists or determines it is not found
Context: A search for log root entry has been completed
GIVEN
A search for log root entry has been completed
Applied to: Log Root Entry Found?
WHEN
The system evaluates the search results
THEN
If log root entry is found, proceed with deletion; otherwise, no action is required
Context: A log root entry exists for the specified CCN
GIVEN
A log root entry exists for the specified CCN
Applied to: Delete Complete Log Structure
WHEN
The system processes the delete request
THEN
The complete log structure including root and all detail records is deleted from the database
Context: No log root entry exists for the specified CCN
GIVEN
No log root entry exists for the specified CCN
Applied to: No Action Required - Log Not Found
WHEN
The system processes the delete request
THEN
No deletion action is performed and processing continues normally
R-GCX105-cbl-00051 (+5) File: GCX105.cbl Format Log Root Segment Merged 6 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Format Log Root Segment':
  • Context - a log root segment structure exists in memory:
    For Initialize Root Segment Structure:
    When the format log root process begins, then the log root segment structure is initialized to empty values and the input message structure is cleared.
  • Context - an input message contains a train or us ccn number:
    For Set Train/CCN as Primary Key & Set Train/CCN as Key Value:
    When formatting the log root segment, then the train or us ccn number from the input message is assigned as the primary key in the log root segment and the train or us ccn number from the input message is assigned as the key value in the log root segment.
  • Context - the system has access to the current machine date:
    For Set Current Load Date:
    When formatting the log root segment, then the current machine date in yymmdd format is assigned to the loaded date field in the log root segment.
  • Context - the system has access to the current machine century:
    For Set Current Load Century:
    When formatting the log root segment, then the current machine century is assigned to the loaded date century field in the log root segment.
  • Context - an input message contains a record type code:
    For Set Record Type Code:
    When formatting the log root segment, then the record type code from the input message is assigned to the record type field in the log root segment.
👨‍💻 Technical ACs (Gherkin)
Context: A log root segment structure exists in memory
GIVEN
A log root segment structure exists in memory
Applied to: Initialize Root Segment Structure
WHEN
The format log root process begins
THEN
The log root segment structure is initialized to empty values and the input message structure is cleared
Context: An input message contains a train or US CCN number
GIVEN
An input message contains a train or US CCN number
Applied to: Set Train/CCN as Primary Key & Set Train/CCN as Key Value
WHEN
Formatting the log root segment
THEN
The train or US CCN number from the input message is assigned as the primary key in the log root segment AND The train or US CCN number from the input message is assigned as the key value in the log root segment
Context: The system has access to the current machine date
GIVEN
The system has access to the current machine date
Applied to: Set Current Load Date
WHEN
Formatting the log root segment
THEN
The current machine date in YYMMDD format is assigned to the loaded date field in the log root segment
Context: The system has access to the current machine century
GIVEN
The system has access to the current machine century
Applied to: Set Current Load Century
WHEN
Formatting the log root segment
THEN
The current machine century is assigned to the loaded date century field in the log root segment
Context: An input message contains a record type code
GIVEN
An input message contains a record type code
Applied to: Set Record Type Code
WHEN
Formatting the log root segment
THEN
The record type code from the input message is assigned to the record type field in the log root segment
R-GCX105-cbl-00057 (+3) File: GCX105.cbl Insert Log Root Segment Merged 4 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Insert Log Root Segment':
  • Context - a formatted log root segment is ready for insertion into the log database:
    For Insert root segment into log database with duplicate handling:
    When the system attempts to insert the log root segment, then if insertion succeeds, the operation completes successfully, but if insertion fails due to duplicate key, the system retrieves the existing segment to maintain data consistency.
  • Context - the system is preparing to insert a log root segment:
    For Set Accept Status for Insert:
    When the insert operation is initiated, then the accept status must be set to 'ii' to indicate an insert operation.
  • Context - a log root segment insertion has been attempted and resulted in duplicate key status 'ii':
    For Insert Successful?:
    When the system detects the duplicate key condition, then the system must perform a retrieval operation to get the existing segment using the same key.
  • Context - a log root segment insert operation has been completed (either successful insert or duplicate key handling):
    For Record Insert Status:
    When the operation finishes, then the final status code must be recorded in the working storage indicator for the log root operation.
👨‍💻 Technical ACs (Gherkin)
Context: A formatted log root segment is ready for insertion into the log database
GIVEN
A formatted log root segment is ready for insertion into the log database
Applied to: Insert root segment into log database with duplicate handling
WHEN
The system attempts to insert the log root segment
THEN
If insertion succeeds, the operation completes successfully, but if insertion fails due to duplicate key, the system retrieves the existing segment to maintain data consistency
Context: The system is preparing to insert a log root segment
GIVEN
The system is preparing to insert a log root segment
Applied to: Set Accept Status for Insert
WHEN
The insert operation is initiated
THEN
The accept status must be set to 'II' to indicate an insert operation
Context: A log root segment insertion has been attempted and resulted in duplicate key status 'II'
GIVEN
A log root segment insertion has been attempted and resulted in duplicate key status 'II'
Applied to: Insert Successful?
WHEN
The system detects the duplicate key condition
THEN
The system must perform a retrieval operation to get the existing segment using the same key
Context: A log root segment insert operation has been completed (either successful insert or duplicate key handling)
GIVEN
A log root segment insert operation has been completed (either successful insert or duplicate key handling)
Applied to: Record Insert Status
WHEN
The operation finishes
THEN
The final status code must be recorded in the working storage indicator for the log root operation
R-GCX105-cbl-00061 (+25) File: GCX105.cbl Format Log Dependent Segment Merged 26 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Format Log Dependent Segment':
  • Context - a log dependent segment needs to be created:
    For Initialize Dependent Segment:
    When the format log dependent process begins, then the dependent segment structure is initialized to clear any previous data.
  • Context - input contains date and time information:
    For Set Date and Time Information:
    When formatting the log dependent segment, then the date is moved to the dependent segment date field and time is moved to the dependent segment time field.
  • Context - date and time information is available:
    For Generate Unique Key from Date/Time:
    When creating a log dependent segment, then a unique key is computed as nines complement minus the combined date-time value and assigned to the dependent segment key.
  • Context - input contains action code, user id, and sending transaction information:
    For Set Action Code and User Information:
    When formatting the log dependent segment, then the action code is moved to dependent segment action code field, acf2 id is moved to user code field, and sending transaction is moved to transaction field.
  • Context - action code is 'mmr':
    For Format Manual Release Message - MMR:
    When processing a manual release action, then the input message is moved to mmr message info structure and then to the dependent segment message field.
  • Context - action code is 'zzz':
    For Format Direct Message - ZZZ:
    When processing a direct message action, then the input message is moved directly to the dependent segment message field without additional formatting.
  • Context - action code is 'cat':
    For Format Cargo Added to Train - CAT:
    When processing a cargo added to train action, then the input message is moved to cat message info structure and then to the dependent segment message field.
  • Context - action code is 'cdt':
    For Format Cargo Deleted from Train - CDT:
    When processing a cargo deleted from train action, then the input message is moved to cdt message info structure and then to the dependent segment message field.
  • Context - action code is 'cfr':
    For Format Cargo Print Faxing - CFR:
    When processing a cargo print faxing action, then the input message is moved to cfr message info structure and then to the dependent segment message field.
  • Context - action code is 'cpr':
    For Format Cargo Print Merlin ID - CPR:
    When processing a cargo print merlin id action, then the input message is moved to cpr message info structure and then to the dependent segment message field.
  • Context - action code is 'cpz':
    For Format Cargo Print Zebra - CPZ:
    When processing a cargo print zebra action, then the input message is moved to cpz message info structure and then to the dependent segment message field.
  • Context - action code is 'ctp':
    For Format Cargo Transfer Print - CTP:
    When processing a cargo transfer print action, then the input message is moved to ctp message info structure and then to the dependent segment message field.
  • Context - action code is 'rno':
    For Format Cargo Renumber Old - RNO:
    When processing a cargo renumber old action, then the input message is moved to rno message info structure and then to the dependent segment message field.
  • Context - action code is 'rnn':
    For Format Cargo Renumber New - RNN:
    When processing a cargo renumber new action, then the input message is moved to rnn message info structure and then to the dependent segment message field.
  • Context - action code is 'mc':
    For Format Manual Cargo Change - MC:
    When processing a manual cargo change action, then the input message is moved to mc reason code field, bond type is moved to mc bond type field, and the complete mc message is moved to dependent segment message field.
  • Context - action code is 'tff':
    For Format Transfer From - TFF:
    When processing a transfer from action, then the input message is moved to tff message info structure and then to the dependent segment message field.
  • Context - action code is 'tft':
    For Format Transfer To - TFT:
    When processing a transfer to action, then the input message is moved to tft message info structure and then to the dependent segment message field.
  • Context - action code is 'md':
    For Format Manual Cargo Delete - MD:
    When processing a manual cargo delete action, then the input message is moved to md reason code field, bond type is moved to md bond type field, and the complete md message is moved to dependent segment message field.
  • Context - action code is 'hnf':
    For Format Equipment Hold Not Found - HNF:
    When processing an equipment hold not found action, then the input message is moved to hnf message equipment id field and the complete hnf message is moved to dependent segment message field.
  • Context - action code is 'hid':
    For Format Equipment Hold ID - HID:
    When processing an equipment hold id action, then the input message is moved to hid message equipment id field and the complete hid message is moved to dependent segment message field.
  • Context - action code is 'rid':
    For Format Equipment Release ID - RID:
    When processing an equipment release id action, then the input message is moved to rid message equipment id field and the complete rid message is moved to dependent segment message field.
  • Context - action code is 'szi':
    For Format Equipment Seize ID - SZI:
    When processing an equipment seize id action, then the input message is moved to szi message equipment id field and the complete szi message is moved to dependent segment message field.
  • Context - action code is 'szr':
    For Format Equipment Seize Release - SZR:
    When processing an equipment seize release action, then the input message is moved to szr message equipment id field and the complete szr message is moved to dependent segment message field.
  • Context - action code does not match any predefined codes:
    For Lookup Unknown Action Code in Table:
    When processing an unknown action code, then the system searches the log table for the action code and uses the corresponding message, or generates an error message with the unknown action code if not found.
  • Context - action code is 'ca' and bond type is not spaces:
    For Lookup Unknown Action Code in Table:
    When processing a cargo created automatically action with bond type, then the message is formatted as 'cargo created automatically tp:' concatenated with the bond type.
  • Context - a log dependent segment is being formatted:
    For Set Load Date and Time:
    When completing the dependent segment formatting, then the current machine date is moved to load date field and current machine time is moved to load time field.
👨‍💻 Technical ACs (Gherkin)
Context: A log dependent segment needs to be created
GIVEN
A log dependent segment needs to be created
Applied to: Initialize Dependent Segment
WHEN
The format log dependent process begins
THEN
The dependent segment structure is initialized to clear any previous data
Context: Input contains date and time information
GIVEN
Input contains date and time information
Applied to: Set Date and Time Information
WHEN
Formatting the log dependent segment
THEN
The date is moved to the dependent segment date field and time is moved to the dependent segment time field
Context: Date and time information is available
GIVEN
Date and time information is available
Applied to: Generate Unique Key from Date/Time
WHEN
Creating a log dependent segment
THEN
A unique key is computed as nines complement minus the combined date-time value and assigned to the dependent segment key
Context: Input contains action code, user ID, and sending transaction information
GIVEN
Input contains action code, user ID, and sending transaction information
Applied to: Set Action Code and User Information
WHEN
Formatting the log dependent segment
THEN
The action code is moved to dependent segment action code field, ACF2 ID is moved to user code field, and sending transaction is moved to transaction field
Context: Action code is 'MMR'
GIVEN
Action code is 'MMR'
Applied to: Format Manual Release Message - MMR
WHEN
Processing a manual release action
THEN
The input message is moved to MMR message info structure and then to the dependent segment message field
Context: Action code is 'ZZZ'
GIVEN
Action code is 'ZZZ'
Applied to: Format Direct Message - ZZZ
WHEN
Processing a direct message action
THEN
The input message is moved directly to the dependent segment message field without additional formatting
Context: Action code is 'CAT'
GIVEN
Action code is 'CAT'
Applied to: Format Cargo Added to Train - CAT
WHEN
Processing a cargo added to train action
THEN
The input message is moved to CAT message info structure and then to the dependent segment message field
Context: Action code is 'CDT'
GIVEN
Action code is 'CDT'
Applied to: Format Cargo Deleted from Train - CDT
WHEN
Processing a cargo deleted from train action
THEN
The input message is moved to CDT message info structure and then to the dependent segment message field
Context: Action code is 'CFR'
GIVEN
Action code is 'CFR'
Applied to: Format Cargo Print Faxing - CFR
WHEN
Processing a cargo print faxing action
THEN
The input message is moved to CFR message info structure and then to the dependent segment message field
Context: Action code is 'CPR'
GIVEN
Action code is 'CPR'
Applied to: Format Cargo Print Merlin ID - CPR
WHEN
Processing a cargo print Merlin ID action
THEN
The input message is moved to CPR message info structure and then to the dependent segment message field
Context: Action code is 'CPZ'
GIVEN
Action code is 'CPZ'
Applied to: Format Cargo Print Zebra - CPZ
WHEN
Processing a cargo print Zebra action
THEN
The input message is moved to CPZ message info structure and then to the dependent segment message field
Context: Action code is 'CTP'
GIVEN
Action code is 'CTP'
Applied to: Format Cargo Transfer Print - CTP
WHEN
Processing a cargo transfer print action
THEN
The input message is moved to CTP message info structure and then to the dependent segment message field
Context: Action code is 'RNO'
GIVEN
Action code is 'RNO'
Applied to: Format Cargo Renumber Old - RNO
WHEN
Processing a cargo renumber old action
THEN
The input message is moved to RNO message info structure and then to the dependent segment message field
Context: Action code is 'RNN'
GIVEN
Action code is 'RNN'
Applied to: Format Cargo Renumber New - RNN
WHEN
Processing a cargo renumber new action
THEN
The input message is moved to RNN message info structure and then to the dependent segment message field
Context: Action code is 'MC'
GIVEN
Action code is 'MC'
Applied to: Format Manual Cargo Change - MC
WHEN
Processing a manual cargo change action
THEN
The input message is moved to MC reason code field, bond type is moved to MC bond type field, and the complete MC message is moved to dependent segment message field
Context: Action code is 'TFF'
GIVEN
Action code is 'TFF'
Applied to: Format Transfer From - TFF
WHEN
Processing a transfer from action
THEN
The input message is moved to TFF message info structure and then to the dependent segment message field
Context: Action code is 'TFT'
GIVEN
Action code is 'TFT'
Applied to: Format Transfer To - TFT
WHEN
Processing a transfer to action
THEN
The input message is moved to TFT message info structure and then to the dependent segment message field
Context: Action code is 'MD'
GIVEN
Action code is 'MD'
Applied to: Format Manual Cargo Delete - MD
WHEN
Processing a manual cargo delete action
THEN
The input message is moved to MD reason code field, bond type is moved to MD bond type field, and the complete MD message is moved to dependent segment message field
Context: Action code is 'HNF'
GIVEN
Action code is 'HNF'
Applied to: Format Equipment Hold Not Found - HNF
WHEN
Processing an equipment hold not found action
THEN
The input message is moved to HNF message equipment ID field and the complete HNF message is moved to dependent segment message field
Context: Action code is 'HID'
GIVEN
Action code is 'HID'
Applied to: Format Equipment Hold ID - HID
WHEN
Processing an equipment hold ID action
THEN
The input message is moved to HID message equipment ID field and the complete HID message is moved to dependent segment message field
Context: Action code is 'RID'
GIVEN
Action code is 'RID'
Applied to: Format Equipment Release ID - RID
WHEN
Processing an equipment release ID action
THEN
The input message is moved to RID message equipment ID field and the complete RID message is moved to dependent segment message field
Context: Action code is 'SZI'
GIVEN
Action code is 'SZI'
Applied to: Format Equipment Seize ID - SZI
WHEN
Processing an equipment seize ID action
THEN
The input message is moved to SZI message equipment ID field and the complete SZI message is moved to dependent segment message field
Context: Action code is 'SZR'
GIVEN
Action code is 'SZR'
Applied to: Format Equipment Seize Release - SZR
WHEN
Processing an equipment seize release action
THEN
The input message is moved to SZR message equipment ID field and the complete SZR message is moved to dependent segment message field
Context: Action code does not match any predefined codes
GIVEN
Action code does not match any predefined codes
Applied to: Lookup Unknown Action Code in Table
WHEN
Processing an unknown action code
THEN
The system searches the log table for the action code and uses the corresponding message, or generates an error message with the unknown action code if not found
Context: Action code is 'CA' and bond type is not spaces
GIVEN
Action code is 'CA' and bond type is not spaces
Applied to: Lookup Unknown Action Code in Table
WHEN
Processing a cargo created automatically action with bond type
THEN
The message is formatted as 'CARGO CREATED AUTOMATICALLY TP:' concatenated with the bond type
Context: A log dependent segment is being formatted
GIVEN
A log dependent segment is being formatted
Applied to: Set Load Date and Time
WHEN
Completing the dependent segment formatting
THEN
The current machine date is moved to load date field and current machine time is moved to load time field
R-GCX105-cbl-00087 (+1) File: GCX105.cbl Process Manual Release Messages Merged 2 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Process Manual Release Messages':
  • Context - a log entry is being processed with an action code:
    For Check Action Code = 'MMR':
    When the action code equals 'mmr', then the system should extract the message information and format it as a manual release message structure.
  • Context - an action code has been identified as 'mmr':
    For Format MMR Message:
    When the message needs to be formatted, then the system should move the input message to mmr-message-info structure and then move the formatted mmr-message to the log detail message field.
👨‍💻 Technical ACs (Gherkin)
Context: A log entry is being processed with an action code
GIVEN
A log entry is being processed with an action code
Applied to: Check Action Code = 'MMR'
WHEN
The action code equals 'MMR'
THEN
The system should extract the message information and format it as a manual release message structure
Context: An action code has been identified as 'MMR'
GIVEN
An action code has been identified as 'MMR'
Applied to: Format MMR Message
WHEN
The message needs to be formatted
THEN
The system should move the input message to MMR-MESSAGE-INFO structure and then move the formatted MMR-MESSAGE to the log detail message field
R-GCX105-cbl-00089 File: GCX105.cbl Process Direct Message Entries
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Process Direct Message Entries':
  • Context - a log detail record is being formatted for insertion:
    For Move Input Message Directly to Log Message:
    When the action code from the input message equals 'zzz', then the input message is moved directly to the log detail message field without any formatting applied.
👨‍💻 Technical ACs (Gherkin)
Context: A log detail record is being formatted for insertion
GIVEN
A log detail record is being formatted for insertion
Applied to: Move Input Message Directly to Log Message
WHEN
The action code from the input message equals 'ZZZ'
THEN
The input message is moved directly to the log detail message field without any formatting applied
R-GCX105-cbl-00090 (+1) File: GCX105.cbl Process Cargo Train Operations Merged 2 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Process Cargo Train Operations':
  • Context - an input message contains cargo train operation data with action code 'cat':
    For Process Cargo Added to Train - CAT:
    When the system processes the cargo added to train operation, then the system extracts cargo information from the input message, formats it as a cat message, and stores the formatted message for the log entry.
  • Context - an input message contains cargo train operation data with action code 'cdt':
    For Process Cargo Deleted from Train - CDT:
    When the system processes the cargo deleted from train operation, then the system extracts cargo information from the input message, formats it as a cdt message, and stores the formatted message for the log entry.
👨‍💻 Technical ACs (Gherkin)
Context: An input message contains cargo train operation data with action code 'CAT'
GIVEN
An input message contains cargo train operation data with action code 'CAT'
Applied to: Process Cargo Added to Train - CAT
WHEN
The system processes the cargo added to train operation
THEN
The system extracts cargo information from the input message, formats it as a CAT message, and stores the formatted message for the log entry
Context: An input message contains cargo train operation data with action code 'CDT'
GIVEN
An input message contains cargo train operation data with action code 'CDT'
Applied to: Process Cargo Deleted from Train - CDT
WHEN
The system processes the cargo deleted from train operation
THEN
The system extracts cargo information from the input message, formats it as a CDT message, and stores the formatted message for the log entry
R-GCX105-cbl-00092 (+1) File: GCX105.cbl Process Cargo Print Operations Merged 2 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Process Cargo Print Operations':
  • Context - a log detail record is being processed:
    For Extract Cargo Fax Print Information:
    When the action code is 'cfr' (cargo fax print), then the system extracts the message as cfr message information and formats it as a cfr message for fax printing.
    For Extract Cargo Print Information:
    When the action code is 'cpr' (cargo print), then the system extracts the message as cpr message information and formats it as a cpr message for merlin id printing.
👨‍💻 Technical ACs (Gherkin)
Context: A log detail record is being processed
GIVEN
A log detail record is being processed
Applied to: Extract Cargo Fax Print Information
WHEN
The action code is 'CFR' (Cargo Fax Print)
THEN
The system extracts the message as CFR message information and formats it as a CFR message for fax printing
Applied to: Extract Cargo Print Information
WHEN
The action code is 'CPR' (Cargo Print)
THEN
The system extracts the message as CPR message information and formats it as a CPR message for Merlin ID printing
R-GCX105-cbl-00094 (+2) File: GCX105.cbl Process Cargo Renumbering Merged 3 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Process Cargo Renumbering':
  • Context - a cargo log entry is being processed:
    For Process RNO - Renumber From Operation:
    When the action code is 'rno' (renumber from operation), then the system should extract the original cargo information from the input message and format it as an rno message structure for logging.
    For Process RNN - Renumber To Operation:
    When the action code is 'rnn' (renumber to operation), then the system should extract the new cargo information from the input message and format it as an rnn message structure for logging.
  • Context - a cargo renumbering message has been formatted (either rno or rnn):
    For Store Formatted Message for Log:
    When the message formatting is complete, then the formatted message should be moved to the log detail message field for storage.
👨‍💻 Technical ACs (Gherkin)
Context: A cargo log entry is being processed
GIVEN
A cargo log entry is being processed
Applied to: Process RNO - Renumber From Operation
WHEN
The action code is 'RNO' (Renumber From Operation)
THEN
The system should extract the original cargo information from the input message and format it as an RNO message structure for logging
Applied to: Process RNN - Renumber To Operation
WHEN
The action code is 'RNN' (Renumber To Operation)
THEN
The system should extract the new cargo information from the input message and format it as an RNN message structure for logging
Context: A cargo renumbering message has been formatted (either RNO or RNN)
GIVEN
A cargo renumbering message has been formatted (either RNO or RNN)
Applied to: Store Formatted Message for Log
WHEN
The message formatting is complete
THEN
The formatted message should be moved to the log detail message field for storage
R-GCX105-cbl-00097 (+1) File: GCX105.cbl Process Cargo Transfer Operations Merged 2 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Process Cargo Transfer Operations':
  • Context - a log detail record is being processed for message formatting:
    For Extract Transfer To Message Info:
    When the action code is 'tft' indicating a transfer-to operation, then the system extracts the message information as tft message format and assigns it to the log detail message field.
  • Context - a log detail record is being processed for message formatting and the action code is not 'tft':
    For Extract Transfer From Message Info:
    When the action code is 'tff' indicating a transfer-from operation, then the system extracts the message information as tff message format and assigns it to the log detail message field.
👨‍💻 Technical ACs (Gherkin)
Context: A log detail record is being processed for message formatting
GIVEN
A log detail record is being processed for message formatting
Applied to: Extract Transfer To Message Info
WHEN
The action code is 'TFT' indicating a transfer-to operation
THEN
The system extracts the message information as TFT message format and assigns it to the log detail message field
Context: A log detail record is being processed for message formatting and the action code is not 'TFT'
GIVEN
A log detail record is being processed for message formatting and the action code is not 'TFT'
Applied to: Extract Transfer From Message Info
WHEN
The action code is 'TFF' indicating a transfer-from operation
THEN
The system extracts the message information as TFF message format and assigns it to the log detail message field
R-GCX105-cbl-00099 (+1) File: GCX105.cbl Process Manual Cargo Changes Merged 2 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Process Manual Cargo Changes':
  • Context - a log detail record is being processed with action code 'mc':
    For Check Action Code:
    When the system processes the manual cargo change action, then the system extracts the reason code from the input message, extracts the bond type from the input, and formats a manual cargo change message with both pieces of information.
  • Context - a log detail record is being processed with action code 'md':
    For Check Action Code:
    When the system processes the manual cargo deletion action, then the system extracts the reason code from the input message, extracts the bond type from the input, and formats a manual cargo deletion message with both pieces of information.
👨‍💻 Technical ACs (Gherkin)
Context: A log detail record is being processed with action code 'MC'
GIVEN
A log detail record is being processed with action code 'MC'
Applied to: Check Action Code
WHEN
The system processes the manual cargo change action
THEN
The system extracts the reason code from the input message, extracts the bond type from the input, and formats a manual cargo change message with both pieces of information
Context: A log detail record is being processed with action code 'MD'
GIVEN
A log detail record is being processed with action code 'MD'
Applied to: Check Action Code
WHEN
The system processes the manual cargo deletion action
THEN
The system extracts the reason code from the input message, extracts the bond type from the input, and formats a manual cargo deletion message with both pieces of information
R-GCX105-cbl-00101 (+4) File: GCX105.cbl Process Equipment Hold Operations Merged 5 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Process Equipment Hold Operations':
  • Context - an input message with action code 'hnf' and equipment information in the message field:
    For HNF - Equipment Not Found:
    When the system processes the equipment not found operation, then the equipment id is extracted from the input message and formatted into the hnf message structure, which is then stored as the log detail message.
  • Context - an input message with action code 'hid' and equipment information in the message field:
    For HID - Equipment Hold:
    When the system processes the equipment hold operation, then the equipment id is extracted from the input message and formatted into the hid message structure, which is then stored as the log detail message.
  • Context - an input message with action code 'rid' and equipment information in the message field:
    For RID - Equipment Release:
    When the system processes the equipment release operation, then the equipment id is extracted from the input message and formatted into the rid message structure, which is then stored as the log detail message.
  • Context - an input message with action code 'szi' and equipment information in the message field:
    For SZI - Equipment Seize:
    When the system processes the equipment seize operation, then the equipment id is extracted from the input message and formatted into the szi message structure, which is then stored as the log detail message.
  • Context - an input message with action code 'szr' and equipment information in the message field:
    For SZR - Equipment Seize Release:
    When the system processes the equipment seize release operation, then the equipment id is extracted from the input message and formatted into the szr message structure, which is then stored as the log detail message.
👨‍💻 Technical ACs (Gherkin)
Context: An input message with action code 'HNF' and equipment information in the message field
GIVEN
An input message with action code 'HNF' and equipment information in the message field
Applied to: HNF - Equipment Not Found
WHEN
The system processes the equipment not found operation
THEN
The equipment ID is extracted from the input message and formatted into the HNF message structure, which is then stored as the log detail message
Context: An input message with action code 'HID' and equipment information in the message field
GIVEN
An input message with action code 'HID' and equipment information in the message field
Applied to: HID - Equipment Hold
WHEN
The system processes the equipment hold operation
THEN
The equipment ID is extracted from the input message and formatted into the HID message structure, which is then stored as the log detail message
Context: An input message with action code 'RID' and equipment information in the message field
GIVEN
An input message with action code 'RID' and equipment information in the message field
Applied to: RID - Equipment Release
WHEN
The system processes the equipment release operation
THEN
The equipment ID is extracted from the input message and formatted into the RID message structure, which is then stored as the log detail message
Context: An input message with action code 'SZI' and equipment information in the message field
GIVEN
An input message with action code 'SZI' and equipment information in the message field
Applied to: SZI - Equipment Seize
WHEN
The system processes the equipment seize operation
THEN
The equipment ID is extracted from the input message and formatted into the SZI message structure, which is then stored as the log detail message
Context: An input message with action code 'SZR' and equipment information in the message field
GIVEN
An input message with action code 'SZR' and equipment information in the message field
Applied to: SZR - Equipment Seize Release
WHEN
The system processes the equipment seize release operation
THEN
The equipment ID is extracted from the input message and formatted into the SZR message structure, which is then stored as the log detail message
R-GCX105-cbl-00106 (+4) File: GCX105.cbl Process Equipment Not Found Merged 5 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Process Equipment Not Found':
  • Context - a log entry request is received with action code 'hnf':
    For Format Equipment Not Found Message:
    When the system processes the message formatting for the log detail record, then the equipment id from the input message is moved to the hnf message format and the formatted hnf message is assigned to the log detail message field.
  • Context - a log entry request is received with action code 'hid':
    For Format Equipment Not Found Message:
    When the system processes the message formatting for the log detail record, then the equipment id from the input message is moved to the hid message format and the formatted hid message is assigned to the log detail message field.
  • Context - a log entry request is received with action code 'rid':
    For Format Equipment Not Found Message:
    When the system processes the message formatting for the log detail record, then the equipment id from the input message is moved to the rid message format and the formatted rid message is assigned to the log detail message field.
  • Context - a log entry request is received with action code 'szi':
    For Format Equipment Not Found Message:
    When the system processes the message formatting for the log detail record, then the equipment id from the input message is moved to the szi message format and the formatted szi message is assigned to the log detail message field.
  • Context - a log entry request is received with action code 'szr':
    For Format Equipment Not Found Message:
    When the system processes the message formatting for the log detail record, then the equipment id from the input message is moved to the szr message format and the formatted szr message is assigned to the log detail message field.
👨‍💻 Technical ACs (Gherkin)
Context: A log entry request is received with action code 'HNF'
GIVEN
A log entry request is received with action code 'HNF'
Applied to: Format Equipment Not Found Message
WHEN
The system processes the message formatting for the log detail record
THEN
The equipment ID from the input message is moved to the HNF message format and the formatted HNF message is assigned to the log detail message field
Context: A log entry request is received with action code 'HID'
GIVEN
A log entry request is received with action code 'HID'
Applied to: Format Equipment Not Found Message
WHEN
The system processes the message formatting for the log detail record
THEN
The equipment ID from the input message is moved to the HID message format and the formatted HID message is assigned to the log detail message field
Context: A log entry request is received with action code 'RID'
GIVEN
A log entry request is received with action code 'RID'
Applied to: Format Equipment Not Found Message
WHEN
The system processes the message formatting for the log detail record
THEN
The equipment ID from the input message is moved to the RID message format and the formatted RID message is assigned to the log detail message field
Context: A log entry request is received with action code 'SZI'
GIVEN
A log entry request is received with action code 'SZI'
Applied to: Format Equipment Not Found Message
WHEN
The system processes the message formatting for the log detail record
THEN
The equipment ID from the input message is moved to the SZI message format and the formatted SZI message is assigned to the log detail message field
Context: A log entry request is received with action code 'SZR'
GIVEN
A log entry request is received with action code 'SZR'
Applied to: Format Equipment Not Found Message
WHEN
The system processes the message formatting for the log detail record
THEN
The equipment ID from the input message is moved to the SZR message format and the formatted SZR message is assigned to the log detail message field
R-GCX105-cbl-00111 (+3) File: GCX105.cbl Lookup Unknown Action Codes Merged 4 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Lookup Unknown Action Codes':
  • Context - an action code that needs message lookup and a log table with predefined action codes and messages:
    For Search Log Table for Action Code:
    When the system searches the log table for the action code, then if the action code is found in the table, the corresponding table message is used; if not found, the system continues to error handling.
  • Context - an action code that was not found in the log table during search:
    For Move Action Code to Error Message:
    When the table search completes without finding a match, then the unknown action code is moved to an error message field and the error message is used as the log message.
  • Context - an action code that exists in the log table with a corresponding message:
    For Move Table Message to Log Message:
    When the table search finds a matching action code entry, then the predefined message from the table entry is moved to the log message field.
  • Context - an action code of 'ca' and a bond type field that is not empty:
    For Format Special Cargo Message with Bond Type:
    When the system processes the cargo creation action, then a formatted message is created containing 'cargo created automatically tp:' followed by the bond type value.
👨‍💻 Technical ACs (Gherkin)
Context: An action code that needs message lookup and a log table with predefined action codes and messages
GIVEN
An action code that needs message lookup and a log table with predefined action codes and messages
Applied to: Search Log Table for Action Code
WHEN
The system searches the log table for the action code
THEN
If the action code is found in the table, the corresponding table message is used; if not found, the system continues to error handling
Context: An action code that was not found in the log table during search
GIVEN
An action code that was not found in the log table during search
Applied to: Move Action Code to Error Message
WHEN
The table search completes without finding a match
THEN
The unknown action code is moved to an error message field and the error message is used as the log message
Context: An action code that exists in the log table with a corresponding message
GIVEN
An action code that exists in the log table with a corresponding message
Applied to: Move Table Message to Log Message
WHEN
The table search finds a matching action code entry
THEN
The predefined message from the table entry is moved to the log message field
Context: An action code of 'CA' and a bond type field that is not empty
GIVEN
An action code of 'CA' and a bond type field that is not empty
Applied to: Format Special Cargo Message with Bond Type
WHEN
The system processes the cargo creation action
THEN
A formatted message is created containing 'CARGO CREATED AUTOMATICALLY TP:' followed by the bond type value
R-GCX105-cbl-00115 (+3) File: GCX105.cbl Insert Log Dependent Segment Merged 4 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Insert Log Dependent Segment':
  • Context - a log dependent segment is ready for insertion into the database:
    For Insert Log Dependent Segment:
    When the insert operation is attempted, then the segment should be successfully inserted into the log database.
  • Context - a log dependent segment insertion fails due to duplicate key error (status code 'ii'):
    For Handle Key Conflicts - Retry with Decremented Key:
    When the duplicate key conflict is detected, then the system should perform retry logic up to 50 times with decremented key values.
  • Context - a duplicate key error has occurred during insert operation:
    For Decrement Key Value by 1:
    When the retry logic is executed, then the key value should be decremented by 1 and used for the next insert attempt.
  • Context - multiple duplicate key conflicts occur during log dependent segment insertion:
    For Maximum Retries Reached:
    When the retry operation is performed 50 times, then the system should stop retrying and complete the operation.
👨‍💻 Technical ACs (Gherkin)
Context: A log dependent segment is ready for insertion into the database
GIVEN
A log dependent segment is ready for insertion into the database
Applied to: Insert Log Dependent Segment
WHEN
The insert operation is attempted
THEN
The segment should be successfully inserted into the log database
Context: A log dependent segment insertion fails due to duplicate key error (status code 'II')
GIVEN
A log dependent segment insertion fails due to duplicate key error (status code 'II')
Applied to: Handle Key Conflicts - Retry with Decremented Key
WHEN
The duplicate key conflict is detected
THEN
The system should perform retry logic up to 50 times with decremented key values
Context: A duplicate key error has occurred during insert operation
GIVEN
A duplicate key error has occurred during insert operation
Applied to: Decrement Key Value by 1
WHEN
The retry logic is executed
THEN
The key value should be decremented by 1 and used for the next insert attempt
Context: Multiple duplicate key conflicts occur during log dependent segment insertion
GIVEN
Multiple duplicate key conflicts occur during log dependent segment insertion
Applied to: Maximum Retries Reached
WHEN
The retry operation is performed 50 times
THEN
The system should stop retrying and complete the operation
R-GCX105-cbl-00119 (+3) File: GCX105.cbl Handle Key Conflicts Merged 4 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Handle Key Conflicts':
  • Context - a log detail record is being inserted into the database:
    For Duplicate Key Detected?:
    When the insertion fails due to a duplicate key conflict (status code 'ii'), then the system decrements the key value by 1 and retries the insertion operation.
  • Context - a duplicate key conflict occurs during log detail insertion:
    For Retry Count < 50?:
    When the system has already attempted to resolve the conflict multiple times, then the system performs up to 50 retry attempts before stopping the resolution process.
  • Context - a duplicate key conflict exists for a log detail record:
    For Decrement Key Value by 1:
    When the system needs to resolve the key conflict, then the system computes a new key by subtracting 1 from the current key value and updates the log detail segment key.
  • Context - a log detail record key has been decremented to resolve a duplicate key conflict:
    For Retry Insert Operation:
    When the system is ready to retry the insertion, then the system attempts to insert the log detail record using the modified key value.
👨‍💻 Technical ACs (Gherkin)
Context: A log detail record is being inserted into the database
GIVEN
A log detail record is being inserted into the database
Applied to: Duplicate Key Detected?
WHEN
The insertion fails due to a duplicate key conflict (status code 'II')
THEN
The system decrements the key value by 1 and retries the insertion operation
Context: A duplicate key conflict occurs during log detail insertion
GIVEN
A duplicate key conflict occurs during log detail insertion
Applied to: Retry Count < 50?
WHEN
The system has already attempted to resolve the conflict multiple times
THEN
The system performs up to 50 retry attempts before stopping the resolution process
Context: A duplicate key conflict exists for a log detail record
GIVEN
A duplicate key conflict exists for a log detail record
Applied to: Decrement Key Value by 1
WHEN
The system needs to resolve the key conflict
THEN
The system computes a new key by subtracting 1 from the current key value and updates the log detail segment key
Context: A log detail record key has been decremented to resolve a duplicate key conflict
GIVEN
A log detail record key has been decremented to resolve a duplicate key conflict
Applied to: Retry Insert Operation
WHEN
The system is ready to retry the insertion
THEN
The system attempts to insert the log detail record using the modified key value
R-GCX105-cbl-00123 (+4) File: GCX105.cbl Spawn Vista GUI Transaction Merged 5 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Spawn Vista GUI Transaction':
  • Context - a log record has been processed with a specific record type code and processing status indicators:
    For Start Vista GUI Transaction:
    When the record type code is 'cc' (canadian cargo) or 'uc' (us cargo) and both log root insertion and log dependent insertion were successful, then the system should initiate vista gui transaction processing.
  • Context - log root segment and log dependent segment have been successfully created and are available in memory:
    For Prepare Log Message for Vista:
    When vista gui transaction processing is initiated, then the system should move the log root segment to vista gui log root segment field and move the log dependent segment to vista gui log dependent segment field.
  • Context - vista gui message data has been prepared with log segments:
    For Initialize Vista Transaction:
    When vista transaction initialization is requested, then the system should move the vista input message to the vista transaction message structure and clear the communication status to prepare for message transmission.
  • Context - vista transaction has been initialized with prepared message data:
    For Send Log Message to Vista GUI:
    When message transmission to vista gui is requested, then the system should change the alternate pcb to prepare for message transmission and write the message to vista gui using the message code, message content, message length, and module name.
  • Context - log message has been successfully transmitted to vista gui system:
    For Complete Vista Transaction:
    When vista transaction completion is requested, then the system should purge the alternate pcb to complete the message transmission and finalize the vista gui transaction.
👨‍💻 Technical ACs (Gherkin)
Context: A log record has been processed with a specific record type code and processing status indicators
GIVEN
A log record has been processed with a specific record type code and processing status indicators
Applied to: Start Vista GUI Transaction
WHEN
The record type code is 'CC' (Canadian Cargo) or 'UC' (US Cargo) and both log root insertion and log dependent insertion were successful
THEN
The system should initiate Vista GUI transaction processing
Context: Log root segment and log dependent segment have been successfully created and are available in memory
GIVEN
Log root segment and log dependent segment have been successfully created and are available in memory
Applied to: Prepare Log Message for Vista
WHEN
Vista GUI transaction processing is initiated
THEN
The system should move the log root segment to Vista GUI log root segment field and move the log dependent segment to Vista GUI log dependent segment field
Context: Vista GUI message data has been prepared with log segments
GIVEN
Vista GUI message data has been prepared with log segments
Applied to: Initialize Vista Transaction
WHEN
Vista transaction initialization is requested
THEN
The system should move the Vista input message to the Vista transaction message structure and clear the communication status to prepare for message transmission
Context: Vista transaction has been initialized with prepared message data
GIVEN
Vista transaction has been initialized with prepared message data
Applied to: Send Log Message to Vista GUI
WHEN
Message transmission to Vista GUI is requested
THEN
The system should change the alternate PCB to prepare for message transmission and write the message to Vista GUI using the message code, message content, message length, and module name
Context: Log message has been successfully transmitted to Vista GUI system
GIVEN
Log message has been successfully transmitted to Vista GUI system
Applied to: Complete Vista Transaction
WHEN
Vista transaction completion is requested
THEN
The system should purge the alternate PCB to complete the message transmission and finalize the Vista GUI transaction
R-GCX105-cbl-00128 (+4) File: GCX105.cbl Find Existing Log Root Merged 5 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Find Existing Log Root':
  • Context - a transfer log operation is being performed:
    For Set Search Key to Old CCN:
    When the system needs to find an existing log root entry, then the search key is set to the old ccn value from the input message.
  • Context - the search key has been set to the old ccn:
    For Search Log Database for Root Entry:
    When the system executes the database search operation, then a database call is made to retrieve the log root segment using the search criteria.
  • Context - a database search for log root entry has been executed:
    For Root Entry Found?:
    When the system evaluates the search results, then if the database status code is blank spaces, the log root is considered found, otherwise it is considered not found.
  • Context - the database search returned a successful result with blank status code:
    For Set Status: Old Log Root Found:
    When the system processes the successful search result, then the old log root found indicator is set to true.
  • Context - the database search returned a non-successful result with non-blank status code:
    For Set Status: Old Log Root Not Found:
    When the system processes the unsuccessful search result, then the old log root not found indicator is set to true.
👨‍💻 Technical ACs (Gherkin)
Context: A transfer log operation is being performed
GIVEN
A transfer log operation is being performed
Applied to: Set Search Key to Old CCN
WHEN
The system needs to find an existing log root entry
THEN
The search key is set to the old CCN value from the input message
Context: The search key has been set to the old CCN
GIVEN
The search key has been set to the old CCN
Applied to: Search Log Database for Root Entry
WHEN
The system executes the database search operation
THEN
A database call is made to retrieve the log root segment using the search criteria
Context: A database search for log root entry has been executed
GIVEN
A database search for log root entry has been executed
Applied to: Root Entry Found?
WHEN
The system evaluates the search results
THEN
If the database status code is blank spaces, the log root is considered found, otherwise it is considered not found
Context: The database search returned a successful result with blank status code
GIVEN
The database search returned a successful result with blank status code
Applied to: Set Status: Old Log Root Found
WHEN
The system processes the successful search result
THEN
The old log root found indicator is set to true
Context: The database search returned a non-successful result with non-blank status code
GIVEN
The database search returned a non-successful result with non-blank status code
Applied to: Set Status: Old Log Root Not Found
WHEN
The system processes the unsuccessful search result
THEN
The old log root not found indicator is set to true
R-GCX105-cbl-00133 (+7) File: GCX105.cbl Retrieve Log Dependent Segments Merged 8 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Retrieve Log Dependent Segments':
  • Context - a transfer log operation is being performed:
    For Initialize Segment Counter to Zero:
    When the system begins retrieving dependent segments from the old log, then the segment counter is set to zero and dependent segment storage area is cleared.
  • Context - an old log root has been found and dependent segments need to be retrieved:
    For Get Next Log Dependent Segment:
    When the system requests the next dependent segment in sequence, then the system performs a get-next-parent operation to retrieve the next log dependent segment.
  • Context - a get-next-parent operation has been performed on log dependent segments:
    For Segment Found?:
    When the system checks the operation status, then if the status is successful (space), increment counter and store segment; otherwise set not-found flag.
  • Context - a log dependent segment has been successfully retrieved:
    For Increment Counter:
    When the segment needs to be processed and stored, then the working storage subscript counter is incremented by 1.
  • Context - a log dependent segment has been successfully retrieved and counter incremented:
    For Store Segment in Memory Array:
    When the segment needs to be preserved for transfer operation, then the entire log dependent segment is moved to the corresponding position in the working storage segment array.
  • Context - log dependent segments are being retrieved for transfer:
    For Counter < 100?:
    When the system checks if more segments can be processed, then if the counter is less than 100, continue retrieving; otherwise stop the retrieval process.
  • Context - the system is retrieving log dependent segments:
    For End - All Segments Retrieved:
    When no more dependent segments are found in the database, then the retrieval process ends and control returns to the calling procedure.
  • Context - the system is retrieving log dependent segments for transfer:
    For End - Maximum Limit Reached:
    When the segment counter reaches 100, then the retrieval process stops even if more segments exist in the database.
👨‍💻 Technical ACs (Gherkin)
Context: A transfer log operation is being performed
GIVEN
A transfer log operation is being performed
Applied to: Initialize Segment Counter to Zero
WHEN
The system begins retrieving dependent segments from the old log
THEN
The segment counter is set to zero and dependent segment storage area is cleared
Context: An old log root has been found and dependent segments need to be retrieved
GIVEN
An old log root has been found and dependent segments need to be retrieved
Applied to: Get Next Log Dependent Segment
WHEN
The system requests the next dependent segment in sequence
THEN
The system performs a get-next-parent operation to retrieve the next log dependent segment
Context: A get-next-parent operation has been performed on log dependent segments
GIVEN
A get-next-parent operation has been performed on log dependent segments
Applied to: Segment Found?
WHEN
The system checks the operation status
THEN
If the status is successful (space), increment counter and store segment; otherwise set not-found flag
Context: A log dependent segment has been successfully retrieved
GIVEN
A log dependent segment has been successfully retrieved
Applied to: Increment Counter
WHEN
The segment needs to be processed and stored
THEN
The working storage subscript counter is incremented by 1
Context: A log dependent segment has been successfully retrieved and counter incremented
GIVEN
A log dependent segment has been successfully retrieved and counter incremented
Applied to: Store Segment in Memory Array
WHEN
The segment needs to be preserved for transfer operation
THEN
The entire log dependent segment is moved to the corresponding position in the working storage segment array
Context: Log dependent segments are being retrieved for transfer
GIVEN
Log dependent segments are being retrieved for transfer
Applied to: Counter < 100?
WHEN
The system checks if more segments can be processed
THEN
If the counter is less than 100, continue retrieving; otherwise stop the retrieval process
Context: The system is retrieving log dependent segments
GIVEN
The system is retrieving log dependent segments
Applied to: End - All Segments Retrieved
WHEN
No more dependent segments are found in the database
THEN
The retrieval process ends and control returns to the calling procedure
Context: The system is retrieving log dependent segments for transfer
GIVEN
The system is retrieving log dependent segments for transfer
Applied to: End - Maximum Limit Reached
WHEN
The segment counter reaches 100
THEN
The retrieval process stops even if more segments exist in the database
R-GCX105-cbl-00141 (+1) File: GCX105.cbl Delete Old Log Entries Merged 2 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Delete Old Log Entries':
  • Context - a log root segment exists in the database for the old ccn and the transfer operation has been completed:
    For Remove Log Root Segment from Database:
    When the system initiates deletion of the old log root segment, then the log root segment is permanently removed from the gcslgrt database.
  • Context - a deletion operation is about to be performed:
    For Initialize Status Codes:
    When the system prepares for the deletion process, then all status codes and accept status indicators are cleared to initial state.
👨‍💻 Technical ACs (Gherkin)
Context: A log root segment exists in the database for the old CCN and the transfer operation has been completed
GIVEN
A log root segment exists in the database for the old CCN and the transfer operation has been completed
Applied to: Remove Log Root Segment from Database
WHEN
The system initiates deletion of the old log root segment
THEN
The log root segment is permanently removed from the GCSLGRT database
Context: A deletion operation is about to be performed
GIVEN
A deletion operation is about to be performed
Applied to: Initialize Status Codes
WHEN
The system prepares for the deletion process
THEN
All status codes and accept status indicators are cleared to initial state
R-GCX105-cbl-00143 (+4) File: GCX105.cbl Format Manual Release Messages Merged 5 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Format Manual Release Messages':
  • Context - a log entry is being processed:
    For Receive MMR Action Code:
    When the action code equals 'mmr', then the system identifies this as an mmr message type requiring special formatting.
  • Context - an mmr action code has been identified:
    For Extract Message from Input:
    When the message content needs to be processed, then the system extracts the message from the gcx105 input structure.
  • Context - a message has been extracted from the input for mmr processing:
    For Move Message to MMR Message Info Structure:
    When the message needs to be structured for mmr format, then the system moves the message content to the mmr message info structure.
  • Context - a message has been placed in the mmr message info structure:
    For Format MMR Message:
    When the message needs to be formatted according to mmr standards, then the system formats the message content into the standardized mmr message format.
  • Context - an mmr message has been properly formatted:
    For Store Formatted Message in Log Segment:
    When the formatted message needs to be persisted, then the system stores the formatted mmr message in the log detail segment message field.
👨‍💻 Technical ACs (Gherkin)
Context: A log entry is being processed
GIVEN
A log entry is being processed
Applied to: Receive MMR Action Code
WHEN
The action code equals 'MMR'
THEN
The system identifies this as an MMR message type requiring special formatting
Context: An MMR action code has been identified
GIVEN
An MMR action code has been identified
Applied to: Extract Message from Input
WHEN
The message content needs to be processed
THEN
The system extracts the message from the GCX105 input structure
Context: A message has been extracted from the input for MMR processing
GIVEN
A message has been extracted from the input for MMR processing
Applied to: Move Message to MMR Message Info Structure
WHEN
The message needs to be structured for MMR format
THEN
The system moves the message content to the MMR message info structure
Context: A message has been placed in the MMR message info structure
GIVEN
A message has been placed in the MMR message info structure
Applied to: Format MMR Message
WHEN
The message needs to be formatted according to MMR standards
THEN
The system formats the message content into the standardized MMR message format
Context: An MMR message has been properly formatted
GIVEN
An MMR message has been properly formatted
Applied to: Store Formatted Message in Log Segment
WHEN
The formatted message needs to be persisted
THEN
The system stores the formatted MMR message in the log detail segment message field
R-GCX105-cbl-00148 (+1) File: GCX105.cbl Format Direct Message Entries Merged 2 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Format Direct Message Entries':
  • Context - a log entry is being processed with action code 'zzz':
    For Check Action Code = 'ZZZ':
    When the system formats the log detail message, then the input message should be moved directly to the log message field without any formatting or transformation applied.
  • Context - the action code has been identified as 'zzz':
    For Move Input Message Directly to Log Message:
    When the message content needs to be stored in the log detail, then the original input message should be copied directly to the log detail message field without modification.
👨‍💻 Technical ACs (Gherkin)
Context: A log entry is being processed with action code 'ZZZ'
GIVEN
A log entry is being processed with action code 'ZZZ'
Applied to: Check Action Code = 'ZZZ'
WHEN
The system formats the log detail message
THEN
The input message should be moved directly to the log message field without any formatting or transformation applied
Context: The action code has been identified as 'ZZZ'
GIVEN
The action code has been identified as 'ZZZ'
Applied to: Move Input Message Directly to Log Message
WHEN
The message content needs to be stored in the log detail
THEN
The original input message should be copied directly to the log detail message field without modification
R-GCX105-cbl-00150 (+2) File: GCX105.cbl Format Cargo Train Operations Merged 3 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Format Cargo Train Operations':
  • Context - a cargo train operation with action code 'cat' is being processed:
    For Process CAT - Cargo Added to Train:
    When the system encounters action code 'cat' during message formatting, then the input message is moved to cat message format structure and then formatted into the log message field.
  • Context - a cargo train operation with action code 'cdt' is being processed:
    For Process CDT - Cargo Deleted from Train:
    When the system encounters action code 'cdt' during message formatting, then the input message is moved to cdt message format structure and then formatted into the log message field.
  • Context - a cargo train operation is being processed for message formatting:
    For Action Code?:
    When the system checks the action code value, then if action code is 'cat' then process as cargo added to train, else if action code is 'cdt' then process as cargo deleted from train.
👨‍💻 Technical ACs (Gherkin)
Context: A cargo train operation with action code 'CAT' is being processed
GIVEN
A cargo train operation with action code 'CAT' is being processed
Applied to: Process CAT - Cargo Added to Train
WHEN
The system encounters action code 'CAT' during message formatting
THEN
The input message is moved to CAT message format structure and then formatted into the log message field
Context: A cargo train operation with action code 'CDT' is being processed
GIVEN
A cargo train operation with action code 'CDT' is being processed
Applied to: Process CDT - Cargo Deleted from Train
WHEN
The system encounters action code 'CDT' during message formatting
THEN
The input message is moved to CDT message format structure and then formatted into the log message field
Context: A cargo train operation is being processed for message formatting
GIVEN
A cargo train operation is being processed for message formatting
Applied to: Action Code?
WHEN
The system checks the action code value
THEN
If action code is 'CAT' then process as cargo added to train, else if action code is 'CDT' then process as cargo deleted from train
R-GCX105-cbl-00153 (+3) File: GCX105.cbl Format Cargo Print Operations Merged 4 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Format Cargo Print Operations':
  • Context - a log detail record is being processed:
    For CFR - Cargo Print Faxing:
    When the action code is 'cfr', then the system extracts message information into cfr format and moves the formatted cfr message to the log detail message field.
    For CPR - Cargo Print Operations:
    When the action code is 'cpr', then the system extracts message information into cpr format and moves the formatted cpr message to the log detail message field.
    For CPZ - Merlin ID Printing:
    When the action code is 'cpz', then the system extracts message information into cpz format and moves the formatted cpz message to the log detail message field.
    For CTP - Cargo Train Print:
    When the action code is 'ctp', then the system extracts message information into ctp format and moves the formatted ctp message to the log detail message field.
👨‍💻 Technical ACs (Gherkin)
Context: A log detail record is being processed
GIVEN
A log detail record is being processed
Applied to: CFR - Cargo Print Faxing
WHEN
The action code is 'CFR'
THEN
The system extracts message information into CFR format and moves the formatted CFR message to the log detail message field
Applied to: CPR - Cargo Print Operations
WHEN
The action code is 'CPR'
THEN
The system extracts message information into CPR format and moves the formatted CPR message to the log detail message field
Applied to: CPZ - Merlin ID Printing
WHEN
The action code is 'CPZ'
THEN
The system extracts message information into CPZ format and moves the formatted CPZ message to the log detail message field
Applied to: CTP - Cargo Train Print
WHEN
The action code is 'CTP'
THEN
The system extracts message information into CTP format and moves the formatted CTP message to the log detail message field
R-GCX105-cbl-00157 (+3) File: GCX105.cbl Format Cargo Renumbering Operations Merged 4 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Format Cargo Renumbering Operations':
  • Context - a cargo renumbering request is received with action code 'rno':
    For Process RNO - Renumber Old Cargo:
    When the system processes the renumbering operation, then the message is formatted using rno message structure and stored in the log detail message field.
  • Context - a cargo renumbering request is received with action code 'rnn':
    For Process RNN - Renumber New Cargo:
    When the system processes the renumbering operation, then the message is formatted using rnn message structure and stored in the log detail message field.
  • Context - the action code is 'rno' and renumbering information exists in the input message:
    For Format RNO Message with Old Cargo Details:
    When the system formats the message for logging, then the input message is moved to rno message info structure and then to the log detail message field.
  • Context - the action code is 'rnn' and renumbering information exists in the input message:
    For Format RNN Message with New Cargo Details:
    When the system formats the message for logging, then the input message is moved to rnn message info structure and then to the log detail message field.
👨‍💻 Technical ACs (Gherkin)
Context: A cargo renumbering request is received with action code 'RNO'
GIVEN
A cargo renumbering request is received with action code 'RNO'
Applied to: Process RNO - Renumber Old Cargo
WHEN
The system processes the renumbering operation
THEN
The message is formatted using RNO message structure and stored in the log detail message field
Context: A cargo renumbering request is received with action code 'RNN'
GIVEN
A cargo renumbering request is received with action code 'RNN'
Applied to: Process RNN - Renumber New Cargo
WHEN
The system processes the renumbering operation
THEN
The message is formatted using RNN message structure and stored in the log detail message field
Context: The action code is 'RNO' and renumbering information exists in the input message
GIVEN
The action code is 'RNO' and renumbering information exists in the input message
Applied to: Format RNO Message with Old Cargo Details
WHEN
The system formats the message for logging
THEN
The input message is moved to RNO message info structure and then to the log detail message field
Context: The action code is 'RNN' and renumbering information exists in the input message
GIVEN
The action code is 'RNN' and renumbering information exists in the input message
Applied to: Format RNN Message with New Cargo Details
WHEN
The system formats the message for logging
THEN
The input message is moved to RNN message info structure and then to the log detail message field
R-GCX105-cbl-00161 (+1) File: GCX105.cbl Format Cargo Transfer Operations Merged 2 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Format Cargo Transfer Operations':
  • Context - a log detail record is being processed and the action code is 'tft':
    For Format TFT Transfer To Message:
    When the system processes the message formatting for the log entry, then the input message is moved to tft message format structure and the formatted tft message is stored in the log detail message field.
  • Context - a log detail record is being processed and the action code is 'tff':
    For Format TFF Transfer From Message:
    When the system processes the message formatting for the log entry, then the input message is moved to tff message format structure and the formatted tff message is stored in the log detail message field.
👨‍💻 Technical ACs (Gherkin)
Context: A log detail record is being processed and the action code is 'TFT'
GIVEN
A log detail record is being processed and the action code is 'TFT'
Applied to: Format TFT Transfer To Message
WHEN
The system processes the message formatting for the log entry
THEN
The input message is moved to TFT message format structure and the formatted TFT message is stored in the log detail message field
Context: A log detail record is being processed and the action code is 'TFF'
GIVEN
A log detail record is being processed and the action code is 'TFF'
Applied to: Format TFF Transfer From Message
WHEN
The system processes the message formatting for the log entry
THEN
The input message is moved to TFF message format structure and the formatted TFF message is stored in the log detail message field
R-GCX105-cbl-00163 (+1) File: GCX105.cbl Format Manual Cargo Changes Merged 2 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Format Manual Cargo Changes':
  • Context - a log detail record is being formatted and the action code is 'mc':
    For Process MC - Manual Cargo Change:
    When the system processes the manual cargo change action, then the system extracts the reason code from the message field and extracts the bond type from the input and formats the mc message with both reason code and bond type and stores the formatted message in the log dependent segment.
  • Context - a log detail record is being formatted and the action code is 'md':
    For Process MD - Manual Cargo Deletion:
    When the system processes the manual cargo deletion action, then the system extracts the reason code from the message field and extracts the bond type from the input and formats the md message with both reason code and bond type and stores the formatted message in the log dependent segment.
👨‍💻 Technical ACs (Gherkin)
Context: A log detail record is being formatted AND the action code is 'MC'
GIVEN
A log detail record is being formatted AND the action code is 'MC'
Applied to: Process MC - Manual Cargo Change
WHEN
The system processes the manual cargo change action
THEN
The system extracts the reason code from the message field AND extracts the bond type from the input AND formats the MC message with both reason code and bond type AND stores the formatted message in the log dependent segment
Context: A log detail record is being formatted AND the action code is 'MD'
GIVEN
A log detail record is being formatted AND the action code is 'MD'
Applied to: Process MD - Manual Cargo Deletion
WHEN
The system processes the manual cargo deletion action
THEN
The system extracts the reason code from the message field AND extracts the bond type from the input AND formats the MD message with both reason code and bond type AND stores the formatted message in the log dependent segment
R-GCX105-cbl-00165 (+4) File: GCX105.cbl Format Equipment Hold Operations Merged 5 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Format Equipment Hold Operations':
  • Context - an equipment hold operation is being processed:
    For HNF - Equipment Not Found:
    When the action code is 'hnf', then the system extracts the equipment id from the input message and formats it as an equipment not found message for the log dependent segment.
    For HID - Equipment Hold:
    When the action code is 'hid', then the system extracts the equipment id from the input message and formats it as an equipment held message for the log dependent segment.
    For RID - Equipment Release:
    When the action code is 'rid', then the system extracts the equipment id from the input message and formats it as an equipment released message for the log dependent segment.
    For SZI - Equipment Seize:
    When the action code is 'szi', then the system extracts the equipment id from the input message and formats it as an equipment seized message for the log dependent segment.
    For SZR - Equipment Seize Release:
    When the action code is 'szr', then the system extracts the equipment id from the input message and formats it as an equipment seize released message for the log dependent segment.
👨‍💻 Technical ACs (Gherkin)
Context: An equipment hold operation is being processed
GIVEN
An equipment hold operation is being processed
Applied to: HNF - Equipment Not Found
WHEN
The action code is 'HNF'
THEN
The system extracts the equipment ID from the input message and formats it as an equipment not found message for the log dependent segment
Applied to: HID - Equipment Hold
WHEN
The action code is 'HID'
THEN
The system extracts the equipment ID from the input message and formats it as an equipment held message for the log dependent segment
Applied to: RID - Equipment Release
WHEN
The action code is 'RID'
THEN
The system extracts the equipment ID from the input message and formats it as an equipment released message for the log dependent segment
Applied to: SZI - Equipment Seize
WHEN
The action code is 'SZI'
THEN
The system extracts the equipment ID from the input message and formats it as an equipment seized message for the log dependent segment
Applied to: SZR - Equipment Seize Release
WHEN
The action code is 'SZR'
THEN
The system extracts the equipment ID from the input message and formats it as an equipment seize released message for the log dependent segment
R-GCX105-cbl-00170 (+4) File: GCX105.cbl Lookup Unknown Action Code in Table Merged 5 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Lookup Unknown Action Code in Table':
  • Context - an action code needs to be processed and a log table with action code entries exists:
    For Search Log Table for Action Code:
    When the system searches the log table for the matching action code, then the system either finds the action code entry or reaches the end of the table without finding a match.
  • Context - an action code has been searched in the log table:
    For Create Error Message with Unknown Action Code:
    When the action code is not found in any table entry, then the system creates an error message containing the unknown action code.
    For Retrieve Message from Table Entry:
    When the action code matches an entry in the table, then the system retrieves the corresponding message text from that table entry.
  • Context - the action code is 'ca' and bond type field contains data:
    For Format Special Cargo Auto-Creation Message with Bond Type:
    When the system processes the message formatting, then the system creates a formatted message 'cargo created automatically tp:' concatenated with the bond type value.
  • Context - an action code lookup process needs to be performed:
    For Set Search Index to First Entry:
    When the system begins the lookup process, then the system sets the log table index to position 1 to start searching from the first entry.
👨‍💻 Technical ACs (Gherkin)
Context: An action code needs to be processed and a log table with action code entries exists
GIVEN
An action code needs to be processed and a log table with action code entries exists
Applied to: Search Log Table for Action Code
WHEN
The system searches the log table for the matching action code
THEN
The system either finds the action code entry or reaches the end of the table without finding a match
Context: An action code has been searched in the log table
GIVEN
An action code has been searched in the log table
Applied to: Create Error Message with Unknown Action Code
WHEN
The action code is not found in any table entry
THEN
The system creates an error message containing the unknown action code
Applied to: Retrieve Message from Table Entry
WHEN
The action code matches an entry in the table
THEN
The system retrieves the corresponding message text from that table entry
Context: The action code is 'CA' and bond type field contains data
GIVEN
The action code is 'CA' and bond type field contains data
Applied to: Format Special Cargo Auto-Creation Message with Bond Type
WHEN
The system processes the message formatting
THEN
The system creates a formatted message 'CARGO CREATED AUTOMATICALLY TP:' concatenated with the bond type value
Context: An action code lookup process needs to be performed
GIVEN
An action code lookup process needs to be performed
Applied to: Set Search Index to First Entry
WHEN
The system begins the lookup process
THEN
The system sets the log table index to position 1 to start searching from the first entry
R-GCX105-cbl-00175 (+2) File: GCX105.cbl Retry Insert with Decremented Key Merged 3 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Retry Insert with Decremented Key':
  • Context - a log detail record is being inserted into the database:
    For Duplicate Key Error?:
    When the insert operation returns a duplicate key status code 'ii', then the system should check for duplicate key error condition.
  • Context - a duplicate key error has been detected during log detail insertion:
    For Decrement Key Value by 1:
    When the system needs to generate a new unique key for retry, then the key value should be decremented by 1 from the current value.
  • Context - a new unique key has been generated after a duplicate key error:
    For Attempt Insert with New Key:
    When the system retries the log detail insertion, then the insert operation should be attempted using the new decremented key value.
👨‍💻 Technical ACs (Gherkin)
Context: A log detail record is being inserted into the database
GIVEN
A log detail record is being inserted into the database
Applied to: Duplicate Key Error?
WHEN
The insert operation returns a duplicate key status code 'II'
THEN
The system should check for duplicate key error condition
Context: A duplicate key error has been detected during log detail insertion
GIVEN
A duplicate key error has been detected during log detail insertion
Applied to: Decrement Key Value by 1
WHEN
The system needs to generate a new unique key for retry
THEN
The key value should be decremented by 1 from the current value
Context: A new unique key has been generated after a duplicate key error
GIVEN
A new unique key has been generated after a duplicate key error
Applied to: Attempt Insert with New Key
WHEN
The system retries the log detail insertion
THEN
The insert operation should be attempted using the new decremented key value
R-GCX105-cbl-00178 (+3) File: GCX105.cbl Search Log Table for Action Code Merged 4 Rules
Action Rules (from EDI)
👔 Business Narrative
Business Logic Rules for 'Search Log Table for Action Code':
  • Context - an action code that is not handled by the predefined message formatting cases:
    For Search Log Table for Matching Action Code:
    When the system searches the log table for the action code, then the system uses the corresponding message from the table if found.
  • Context - an action code that does not exist in the log table:
    For Generate Error Message with Unknown Action Code:
    When the table search completes without finding a match, then the system creates an error message containing the unknown action code.
  • Context - an action code of 'ca' and a non-blank bond type value:
    For Create Special Cargo Auto-Creation Message with Bond Type:
    When the message formatting process executes, then the system creates a message with text 'cargo created automatically tp:' followed by the bond type.
  • Context - a need to search the log table for an action code:
    For Set Search Index to 1:
    When the lookup process begins, then the search index is set to position 1.
👨‍💻 Technical ACs (Gherkin)
Context: An action code that is not handled by the predefined message formatting cases
GIVEN
An action code that is not handled by the predefined message formatting cases
Applied to: Search Log Table for Matching Action Code
WHEN
The system searches the log table for the action code
THEN
The system uses the corresponding message from the table if found
Context: An action code that does not exist in the log table
GIVEN
An action code that does not exist in the log table
Applied to: Generate Error Message with Unknown Action Code
WHEN
The table search completes without finding a match
THEN
The system creates an error message containing the unknown action code
Context: An action code of 'CA' and a non-blank bond type value
GIVEN
An action code of 'CA' and a non-blank bond type value
Applied to: Create Special Cargo Auto-Creation Message with Bond Type
WHEN
The message formatting process executes
THEN
The system creates a message with text 'CARGO CREATED AUTOMATICALLY TP:' followed by the bond type
Context: A need to search the log table for an action code
GIVEN
A need to search the log table for an action code
Applied to: Set Search Index to 1
WHEN
The lookup process begins
THEN
The search index is set to position 1