Protocol Definitions
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
Protocol Definitions within the flext-target-oracle-wms project establish the structural contracts for integrating Singer-protocol data with Oracle WMS Cloud SaaS environments. These protocols define how data is transformed from source Singer messages into the specific shapes required by the WMS, and how batches of that data are subsequently loaded into destination sinks.
By utilizing Python's typing.Protocol and @runtime_checkable decorators, the system ensures that components like data transformers and table managers adhere to strict interface requirements. This decoupled architecture allows for high-performance batch operations and robust error handling as required by mission-critical enterprise integrations.
Sources: src/flext_target_oracle_wms/protocols.py:1-12, src/flext_target_oracle_wms/_utilities/helpers.py:1-15
Core Integration Protocols
The project organizes its integration contracts under the FlextTargetOracleWmsProtocols namespace, which inherits from core Meltano and Oracle protocols. This inheritance ensures consistency across the FLEXT ecosystem.
WmsDataLoading
The WmsDataLoading protocol defines the contract for any component responsible for pushing records into the Oracle WMS sink. It focuses on batch processing to optimize throughput.
The diagram shows the primary protocols used for data movement and structural conversion within the target.
| Protocol | Purpose | Key Method |
|---|---|---|
WmsDataLoading | Handles batch ingestion of records into the WMS. | load_data() |
DataTransformation | Converts individual Singer records into WMS-compliant JSON shapes. | transform_to_wms() |
Sources: src/flext_target_oracle_wms/protocols.py:15-38, tests/unit/test_quality.py:68-74
DataTransformation
This protocol enforces a contract for payload mapping. In practice, implementations like the WMSDataTransformer use this to handle field normalization, such as converting keys to uppercase and mapping Singer types to Oracle-friendly values.
Sources: src/flext_target_oracle_wms/protocols.py:31-38, src/flext_target_oracle_wms/_utilities/helpers.py:63-100
Implementation Interfaces
The protocols are implemented and validated through utility helpers and runtime checks. Key classes like WMSTableManager and WMSDataTransformer serve as the concrete logic behind these interface definitions.
Component Relationship Flow
The following flow illustrates how protocols govern the interaction between the Singer message stream and the final Oracle WMS destination.
The data flow from source Singer messages to Oracle WMS, mediated by protocol-compliant helpers.
Sources: src/flext_target_oracle_wms/_utilities/helpers.py:63-118, tests/unit/test_quality.py:86-105
Test Protocols
For quality assurance, the project utilizes a specialized TestsFlextTargetOracleWmsProtocols class. This extends the production protocols with test-specific namespaces (p.Wms.Tests.*), allowing for rigorous validation of component wiring without polluting the production surface.
Quality Gate Verification
The test suite explicitly checks for the existence and accessibility of these protocol definitions to ensure the target's "Quality Gates" are met before deployment.
| Test Method | Verification Target |
|---|---|
test_data_loading_protocol_exists | Validates WmsDataLoading availability. |
test_data_transformation_protocol_exists | Validates DataTransformation availability. |
test_p_is_protocols_class | Ensures the protocol namespace p is correctly bound. |
Sources: tests/protocols.py:15-32, tests/unit/test_quality.py:65-74
Summary
Protocol Definitions in flext-target-oracle-wms provide the foundational contracts required for enterprise-grade data synchronization. By standardizing WmsDataLoading and DataTransformation interfaces, the system maintains strict typing and modularity, enabling features like custom business rule converters and high-concurrency stream processing.