Aged-MISSING monitor
Moves quarantined MISSING-queue entries whose SLA date has passed to Aged, logs each one and alerts the configured recipients in the client. Count Governance (Package C).
At a glance
| Batch class | MGCWardenMissingQueueMonitor (caption Warden missing-queue SLA monitor) |
| Menu item | MGCWardenMissingMonitorMenuItem, label Aged-MISSING monitor |
| Menu path | System administration → Setup → Aged-MISSING monitor |
| Who may run it | MGCWardenPolicyAuthorPriv (Update grant) → MGCWardenPolicyAuthoringDuty → Warden guard administrator (MGCWardenGuardAdministrator), plus the platform's System administrator. The Warden count supervisor role does not get it. Also callable over the batch API as MGCWardenBatchService.runMissingMonitor, behind the same menu item |
| Feature toggle | Warden Count Governance (MGCWardenCountGovFeature, default off). Stands down when off: "Warden Count Governance is off; missing-queue monitoring skipped." |
| Company scope | Per legal entity. It ages its own company's entries and reads its own company's recipient list |
| Scheduled by default | No. Nothing in the product creates a batch job for it |
| Recurrence | You choose. No recurrence is stated in code or docs |
| Setup-gap rules that watch it | None. No rule reports it unscheduled, and no rule checks the count alert recipients (the RecipientsNoneResolve / RecipientsSomeResolve rules check the compliance parameters and sensitive-role overrides only) |
Purpose and business justification
When a count supervisor quarantines a shortage, Warden moves the stock to the policy's MISSING
location with a native transfer journal and opens a MISSING-queue entry with an SLA date
(MGCWardenCountCaseService stamps SlaDate = today + MissingSlaDays). Stock in MISSING is stock
nobody has decided about. This monitor is what makes an entry that has sat too long surface
instead of being forgotten: it marks it Aged and tells somebody.
Ageing is a signal, not a gate. A write-off or a return to stock is allowed on an entry that is either
Quarantined or Aged, so the monitor neither enables nor blocks any disposition.
How and when it is triggered
- Scheduled batch job, created by an administrator from the menu item's dialog. Nothing schedules it out of the box.
- Run now from the menu item.
canRunInNewSession()returnstrue, so an interactive run is marshalled to a second session for the same user. - Batch API:
MGCWardenBatchService.runMissingMonitor.
Configuration and scheduling options
Dialog. No fields. pack() returns conNull(); the dialog shows only the standard batch tab.
Settings it depends on:
| Where | Field | Label | Default | Effect |
|---|---|---|---|---|
| Count policy (System administration → Setup → Count governance policies) | MissingSlaDays | MISSING SLA (days) | 14 on a new policy | Sets the SLA date when stock is quarantined. Changing it affects only later quarantines. 0 means no grace period: the entry ages on the first run on any later day |
| Count parameters (System administration → Setup → Count governance parameters) | AlertRecipients | Alert recipients | Blank | Semicolon-separated user IDs. Each one that resolves to a user gets an in-client alert per aged entry. Blank means entries still age but nobody is alerted |
The alert is in-client only: a row on the recipient's alert list with a pop-up
(EventInbox.ShowPopup = Yes, SendEmail = No). No email is sent. A token that is not a user ID is
skipped silently.
Choosing a recurrence. An entry ages on the first run after its SLA date. The SLA is measured in days and the test is against the session date, so running more than once a day adds little; running less often delays the alert by up to the interval. Not confirmed: any stated recurrence.
What it does
run()
|- Count Governance off? -> info line, return
|- try
| ttsbegin
| for each MGCWardenMissingQueueEntry: State = Quarantined, SlaDate set, SlaDate < today
| State -> Aged
| event-log row on the count case (CountGovernance)
| remember the case for the alert
| ttscommit
| catch -> Error execution exception, nothing aged, nothing alerted
|- alertAged(): per aged case, after the commit
| sendAgedAlert(): one EventInbox row per resolvable recipient
| alert failed or missed a recipient -> Error execution exception on the case, warning
|- info "N entry(ies) aged past SLA"
- Toggle check.
MGCWardenCountGovFeature::isOn(). - One transaction over every candidate. A candidate is an entry in state
QuarantinedwhoseSlaDateis set and strictly earlier thansystemDateGet(). An entry whose SLA date is today ages tomorrow. - For each candidate:
StatebecomesAged, and aCountGovernanceevent-log row is written on the count case ("Missing quarantine for count case … aged past its SLA date …."). - After the commit, for each case aged:
sendAgedAlertinserts oneEventInboxrow per recipient inAlertRecipientsthat matches aUserInfo.id. The alert subject is "Missing stock aged past SLA: count case …" and the message names the item, warehouse and location, the delta and the SLA date. If the alert could not be raised at all, or could not be delivered to a recipient who is a user here, one Error execution exception is filed on the count case (its case id as document key) saying so, and the run warns. - Closing line: "Warden missing-queue monitor: N entry(ies) aged past SLA."
Transaction boundary. The ageing is one transaction: the state changes and the event-log rows
commit together or not at all. The alerts are written after it commits, so a failed alert never undoes the ageing. Until wave 27 the alert was
written inside the transaction, where the bare catches in sendAgedAlert cannot run, and one failed
alert insert rolled back the whole pass.
Error handling. A failure in the ageing (for example a failed event-log insert) rolls the pass back
and the outer catch, at ttsLevel 0, files "Missing-queue SLA monitoring failed; no entries were aged
in this run (retryable)."; nothing is alerted for that pass and the closing line says 0. A failed alert
is recorded per case, as above, and the entry stays Aged. Because a later run does not alert an entry
that is already Aged, that exception is the only record that the recipients were not told.
Concurrency. Not in MGCWardenBatchOverlapGuard's population. The ageing is one transaction over
forupdate reads, so a concurrent loser rolls back rather than ageing an entry twice
(MGCWardenBatchService class summary), and then files the failure exception.
Idempotency. Only Quarantined entries are candidates and each moves to Aged once, so an entry
is alerted once. A re-run alerts nobody about entries already aged, including one whose alert failed.
Dependencies and prerequisites
- Warden Count Governance on (GETTING_STARTED §4c).
- Quarantined entries, which exist only where an Active count policy names a MISSING location and a supervisor has quarantined a case.
- For alerts:
AlertRecipientsfilled with user IDs of active users.
Inputs and outputs
| Direction | Table | What |
|---|---|---|
| Reads | MGCWardenMissingQueueEntry | Quarantined entries past their SLA date |
| Reads | MGCWardenCountCase | Case id, item, warehouse, location, delta, policy (for the log and the alert) |
| Reads | MGCWardenCountParameters, UserInfo | AlertRecipients and recipient resolution |
| Writes | MGCWardenMissingQueueEntry | Quarantined → Aged |
| Writes | MGCWardenEventLog | One CountGovernance row per aged entry |
| Writes | EventInbox | One alert per aged entry per resolvable recipient |
| Writes | MGCWardenExecutionException | On a failed pass: severity Error, area Other, reason Other, no table, record or document key: "Missing-queue SLA monitoring failed; no entries were aged in this run (retryable)." On a failed alert: severity Error, area Other, reason Other, on the count case with its case id: "The aged-past-SLA alert for count case … could not be raised …" or "… could not be delivered to N count alert recipient(s) …" |
| Infolog | Toggle-off line, or the aged-count line; a warning per failed alert |
No run record and no business event.
Logging and monitoring
- Aged MISSING queue (System administration → Setup → Aged MISSING queue,
MGCWardenMissingQueue) lists the entries with their state; write-off and return to stock are done from here. - Warden Controls tile MISSING entries past SLA counts entries with an SLA date before today
that are still
QuarantinedorAged. It therefore includes entries this monitor has not aged yet: a tile count with noAgedrows behind it means the monitor is not running (USER_GUIDE §7). - Governance event log (System administration → Setup → Governance event log): one row per aged entry.
- Execution exceptions (System administration → Setup → Execution exceptions): failed passes, and aged entries whose alert failed.
- Batch job history: the closing info line.
Errors, recovery and troubleshooting
| What happened | What you see | Recovery |
|---|---|---|
| Count Governance off | Info line; nothing aged | Switch the feature on |
| The pass failed | An Error exception as above; nothing aged in that run | Read the batch log, fix the cause, run it again. The exception carries no retry handler, so Retry on the workbench only warns "No retry handler recorded"; the next scheduled run, or Run now, is the retry. Dismiss the exception once a run succeeds |
| Entries aged, nobody alerted | Entries are Aged; no alerts; no exception | Check AlertRecipients: blank, or tokens that are not user IDs (email addresses are skipped) |
| An alert failed | Entry Aged; an Error exception on the count case saying the alert could not be raised or delivered | Tell the recipients from the exception: no later run alerts that entry again. Dismiss the exception once they know |
| An entry past its SLA did not age | Its SLA date may be today (it ages tomorrow), blank, or the entry is no longer Quarantined |
After a failed pass the closing info line still prints, with a count of 0, because nothing was aged.
Re-running is safe: only Quarantined entries past their date are touched.
Impact on other functionality
- Nothing is blocked when the monitor does not run. Write-off and return to stock work on
Quarantinedentries as well asAgedones. What is lost is the escalation: nobody is alerted and the queue does not show which entries have blown their SLA. - Retention. An
Agedentry is never purged:MGCWardenCountRetentionkeeps its case, andMGCWardenRetentionCleanupkeeps the entry until it is written off or resolved (Count case retention cleanup, Warden retention cleanup). - Locks. One transaction holds every entry it ages until the ageing commits; the alert inserts come after it and hold none of those locks.
- Recipients' alert lists receive one pop-up alert per aged entry.
Related documentation
- Batch framework.
- Count consolidation run - a write-off's delta posts through it.
- Count case retention cleanup.
- Count supervisor.
- Getting started.