3.0 KiB
3.0 KiB
Filename-Based Job Matching Implementation
Overview
The SatLoc job matching logic has been updated to prioritize job ID extraction from log file names over internal SatLoc records (Swathing Setup). This provides more reliable and consistent job identification across different SatLoc systems.
Filename Patterns Supported
1. Direct JOB Pattern
Format: JOB[jobId]
Example: JOB146 HK4704.log → Job ID: 146
2. Falcon System Pattern (with underscore/space)
Format: [10 digits yymmddhhmm][separator][jobId]
Examples:
2507140724SatlocG4_b4ef.log→ Job ID:b4ef2508021622SatlocG4_8948A.log→ Job ID:8948A2025091512 CROP001.log→ Job ID:CROP001
3. Bantom2 System Pattern
Format: [8 digits date]_JOB[jobId]
Example: 20250915_JOB789_field1.log → Job ID: 789_field1
Implementation Changes
1. SatLocLogParser
- Added
extractJobIdFromFileName()method - Enhanced
parseFile()to extract filename job ID - Updated
createApplicationDetail()to prioritize filename job ID - Added fields:
filenameJobId,swathingJobId,jobLongLabelNamefor tracking
2. SatLocApplicationProcessor
- Updated job matching to use filename-based job ID as primary source
- Enhanced comments to reflect filename-based priority
- Maintained backward compatibility with record-based job IDs
3. Partner Sync Worker
- Already passes
logFileNamein task data - Context building includes filename for processing
Data Structure Changes
Application Details
New fields added to ApplicationDetail records:
{
satlocJobId, // Primary job ID (filename-based or jobLongLabelName fallback)
filenameJobId, // Job ID extracted from filename
swathingJobId, // Job ID from Swathing Setup (120) record (reference only)
jobLongLabelName, // Long label name from Swathing Setup (fallback source)
aircraftId // From System Setup (100)
}
Job Matching Priority
- Primary:
filenameJobId- extracted from log file name - Fallback:
jobLongLabelName- from Swathing Setup (120) records - Reference:
swathingJobId- numeric job ID from Swathing Setup (for reference only)
Benefits
- Reliability: Filename-based extraction is more consistent across systems
- System Compatibility: Supports multiple SatLoc system naming conventions
- Backward Compatibility: Falls back to record-based extraction
- Traceability: Maintains both filename and record-based job IDs for auditing
Testing
The implementation has been tested with various filename patterns and confirmed working:
- Pattern recognition accuracy: 100% for supported formats
- Fallback behavior: Functional when filename extraction fails
- Application detail creation: All job ID sources properly tracked
Usage in Partner Sync
When processing partner logs:
- Log filename is passed in task data
- Parser extracts job ID from filename during parsing
- Application processor uses filename job ID for job matching
- Both filename and record-based job IDs are stored for reference