CR to TMF Handoff
This page explains the manual caution report dispatch flow into TMF and was checked against the current code, not only the flowchart.
API Endpoints
POST /data/caution-report/trigger/dispatch-tmf
Bottom line
For manual Dispatch to TMF, the flowchart is mostly correct and closely matches the implementation in mvp2-data-service.
The main thing to understand is that this is an API-triggered handoff, not a background-only process. The user action in portal calls the dispatch endpoint directly, and the backend then creates the TMF work order, updates the local CR state, uploads attachments, and performs source-specific follow-up when needed.
When this flow is used
- when a user manually escalates or dispatches a Caution Report from the portal
- when the CR needs a downstream TMF work order
- when support or developers need to trace why a TMF work order was or was not created
What starts the handoff
The handoff starts from the portal CR details page when the user triggers the dispatch action.
From there:
- portal calls
POST data/caution-report/trigger/dispatch-tmf - data service loads the CR by id
- data service prepares TMF access token and target URL
- data service sends the TMF create work order request
- on success, local CR state is updated to
In-Progress
Main business flow
| Step | What the system does |
|---|---|
| Load CR | Finds the target Caution Report by id |
| Validate existence | Stops immediately if the CR does not exist |
| Resolve TMF connection | Chooses regress or normal TMF mode, gets APIM token, resolves TMF base URL |
| Retry access token errors | Retries if token generation returns Error, up to the implemented retry limit |
| Enrich cabinet/FDC data | If cabinetId is missing, tries to derive it from nearby FDC data |
| Build dispatch payload | Creates the TMF work order payload from CR fields and LOV values |
| Create TMF work order | Calls TMF createworkorder endpoint |
| Retry auth failures | Retries when TMF responds with 401, up to the implemented retry limit |
| Reject failed dispatch | Stops and audits failure if TMF returns non-200 |
| Create local CR activity | Saves returned TMF ticketId and activityId as local CR activity data |
| Update CR state | Stores TMF ticket info and updates local CR status to In-Progress |
| Upload attachments | Sends CR attachments to TMF after the work order is created |
| Update CR LOV status | Updates the CR status LOV record to In-Progress |
| Trigger GOTH follow-up | If source is GOTH, also pushes the status update to GOTH |
| Save audit and APIM logs | Writes success logs after the main dispatch flow finishes |
What data is used
The TMF payload is built from the Caution Report and its related LOV and area data. The current implementation pulls values such as:
- ticket number
- creation time
- ETTR
- requestor name and contact number
- diagnosis code and impacted symptom
- severity and urgency reason
- comment
- building and zone information
- latitude and longitude
- cabinet or nearby FDC-derived cabinet id
Confirmed runtime behavior
These parts are directly confirmed from code:
- the portal calls
data/caution-report/trigger/dispatch-tmf - the backend dispatch method is
triggerDispatchTMF(...) - token generation failure is retried
- TMF
401response is retried - successful TMF dispatch creates a local CR activity record
- successful TMF dispatch updates local CR status to
In-Progress - attachments are uploaded after the TMF work order is created
- GOTH-origin CRs trigger an extra downstream status update
Failure points
The main failure gates in the current implementation are:
- CR does not exist
- APIM token cannot be obtained successfully after retry attempts
- TMF create work order call returns non-
200 - GOTH status update fails for GOTH-sourced CRs
If one of these happens, the backend raises an error and logs the failure through the audit flow.
Important implementation nuance
One part of the flowchart should be read carefully: attachment handling.
In the current code, attachment upload happens after the TMF work order is already created and after the local CR has already been updated to In-Progress. If an attachment upload fails, the failure is logged and audited, but the code does not clearly roll back the already-created TMF work order or revert the CR status update.
So the safest business reading is:
- main TMF handoff success is decided by the TMF work order creation response
- attachment sync problems are follow-up failures, not clearly full-dispatch rollback failures
Flowchart verdict
The Dispatch to TMF flowchart is reliable for the main dispatch path.
It is accurate on the major decisions:
- CR must exist
- APIM access is required
- TMF create work order is the key success gate
- success leads to local activity creation and CR status change to
In-Progress - GOTH source has additional downstream behavior
The only caution is that attachment upload should be treated as a post-create follow-up step, because the implementation does not behave like a single all-or-nothing transaction.
Code references
intt-portal/src/app/components/pages/main-modules/cr/cr-details/cr-details.component.tsmvp2-data-service/src/modules/caution-report/caution-report.controller.tsmvp2-data-service/src/modules/caution-report/caution-report.service.ts