eventhub/README_PATCH.md

34 lines
1.8 KiB
Markdown

# Patch: Tachograph file-session support for runtime event mixing
This patch extends the existing `event-evidence-mixing` implementation so it also supports events produced by uploaded tachograph file sessions.
## What changed
- `RuntimeEventMixingService` now treats `TACHOGRAPH_FILE_SESSION` and `COMPOSITE_TACHOGRAPH_FILE_SESSION` events as tachograph runtime evidence.
- File-session events do not always have a DB-style `extractionCode` such as `CARD_ACTIVITY` or `VU_ACTIVITY` in the raw payload.
- The mixing service now derives the equivalent extraction code from:
- source kind: `DRIVER_CARD` or `VEHICLE_UNIT`
- event domain: `DRIVER_ACTIVITY`, `POSITION`, `PLACE`, `BORDER_CROSSING`, `DRIVER_CARD`, etc.
- file-session external id / source-package kind.
## Supported derived mappings
| File-session event | Driver-card source | Vehicle-unit source |
|---|---|---|
| `DRIVER_ACTIVITY` | `CARD_ACTIVITY` | `VU_ACTIVITY` |
| `POSITION` | `CARD_POSITION` | `VU_POSITION` |
| `PLACE` | `CARD_PLACE` | `VU_PLACE` |
| `BORDER_CROSSING` | `CARD_BORDER_CROSSING` | `VU_BORDER_CROSSING` |
| `DRIVER_CARD` insert/withdraw | `CARD_VEHICLES_USED` | `IW_CYCLE` |
## Important behavior
- Duplicate file-session `CARD_ACTIVITY` / `VU_ACTIVITY` events are mixed the same way as persistent tachograph DB events.
- Duplicate file-session position/place/border events are also mixed the same way as persistent tachograph DB support evidence.
- `CARD_VEHICLES_USED` and `IW_CYCLE` are still not mixed; they remain accepted for separate vehicle-usage processing.
## Modified files
- `src/main/java/at/procon/eventhub/processing/eventprocessing/mixing/RuntimeEventMixingService.java`
- `src/test/java/at/procon/eventhub/processing/eventprocessing/mixing/RuntimeEventMixingServiceTest.java`