Skip to main content

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 classMGCWardenMissingQueueMonitor (caption Warden missing-queue SLA monitor)
Menu itemMGCWardenMissingMonitorMenuItem, label Aged-MISSING monitor
Menu pathSystem administration → Setup → Aged-MISSING monitor
Who may run itMGCWardenPolicyAuthorPriv (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 toggleWarden Count Governance (MGCWardenCountGovFeature, default off). Stands down when off: "Warden Count Governance is off; missing-queue monitoring skipped."
Company scopePer legal entity. It ages its own company's entries and reads its own company's recipient list
Scheduled by defaultNo. Nothing in the product creates a batch job for it
RecurrenceYou choose. No recurrence is stated in code or docs
Setup-gap rules that watch itNone. 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() returns true, 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:

WhereFieldLabelDefaultEffect
Count policy (System administration → Setup → Count governance policies)MissingSlaDaysMISSING SLA (days)14 on a new policySets 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)AlertRecipientsAlert recipientsBlankSemicolon-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"
  1. Toggle check. MGCWardenCountGovFeature::isOn().
  2. One transaction over every candidate. A candidate is an entry in state Quarantined whose SlaDate is set and strictly earlier than systemDateGet(). An entry whose SLA date is today ages tomorrow.
  3. For each candidate: State becomes Aged, and a CountGovernance event-log row is written on the count case ("Missing quarantine for count case … aged past its SLA date ….").
  4. After the commit, for each case aged: sendAgedAlert inserts one EventInbox row per recipient in AlertRecipients that matches a UserInfo.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.
  5. 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: AlertRecipients filled with user IDs of active users.

Inputs and outputs​

DirectionTableWhat
ReadsMGCWardenMissingQueueEntryQuarantined entries past their SLA date
ReadsMGCWardenCountCaseCase id, item, warehouse, location, delta, policy (for the log and the alert)
ReadsMGCWardenCountParameters, UserInfoAlertRecipients and recipient resolution
WritesMGCWardenMissingQueueEntryQuarantined → Aged
WritesMGCWardenEventLogOne CountGovernance row per aged entry
WritesEventInboxOne alert per aged entry per resolvable recipient
WritesMGCWardenExecutionExceptionOn 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) …"
InfologToggle-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 Quarantined or Aged. It therefore includes entries this monitor has not aged yet: a tile count with no Aged rows 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 happenedWhat you seeRecovery
Count Governance offInfo line; nothing agedSwitch the feature on
The pass failedAn Error exception as above; nothing aged in that runRead 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 alertedEntries are Aged; no alerts; no exceptionCheck AlertRecipients: blank, or tokens that are not user IDs (email addresses are skipped)
An alert failedEntry Aged; an Error exception on the count case saying the alert could not be raised or deliveredTell 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 ageIts 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 Quarantined entries as well as Aged ones. What is lost is the escalation: nobody is alerted and the queue does not show which entries have blown their SLA.
  • Retention. An Aged entry is never purged: MGCWardenCountRetention keeps its case, and MGCWardenRetentionCleanup keeps 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.