Skip to main content

MGCWardenGuardOperationsService

The Warden guard operations API (backend test-automation surface, slice S2): the per-record levers an operator pulls on the guard side of the product; break-glass hold release, the execution exception workbench (Take / Retry / Dismiss), the four route-recovery submit levers, reconfirmation Take, the two journal submit levers, the trade agreement submit and the duplicate override; each reachable over HTTP exactly as it is reachable from a click, and by exactly the same people. UI PARITY, per MGCWardenApiDispatch, applied per operation: * Every operation first asks canRun() on the SAME action menu item the client button runs, and returns Denied, having attempted nothing, when the caller lacks it. Denied is decided BEFORE the key is looked up, so a caller without the grant is not told whether the record exists. Then NotFound, then the action; in that order, always. * Ten of the thirteen actions run headless and go through MGCWardenApiDispatch::runAction; the menu item itself through MenuFunction, so the class, the entry-point security context and every governance row the action writes are the ones a click produces. The two that are multi-select in the client (exception Retry, reconfirmation Take) already fall back to the single _args.record() when there is no form caller, which is precisely the API's case. * Three are RunBase dialogs (break-glass, dismiss, duplicate override) and prompt() has no meaning on a service thread. For those the operation takes the dialog's fields as parameters and calls the code the dialog's OK button reaches: the manager for break-glass, whose run() is one manager call and a report of what the re-read found; a verdict this class asks of the action's own predicate (MGCWardenBreakGlassReleaseAction::releasedByThisCall) rather than restating; the action object itself for dismiss and the duplicate override, each of which carries a refusal that lives nowhere else; dismiss's status guard in run(), the override's three in validate() (see their newFromValues). All three are DirectRun actions (canRunInNewSession is false), so a click runs this same code inline in the caller's session. Several of these levers answer a no-op with an info or a warning rather than an error; a Take on a closed row, a Retry whose handler failed, a journal submit whose activation was swallowed by design, a break-glass on a hold already closed; and resultSince() reads a run with no error line as Completed. A test asserting on Status would then be told a claim or a route landed when it did not. So after the action runs, every operation re-reads the one fact the lever exists to change; through the predicate the lever family itself uses, where it has one; and reports Refused when that fact did not move, carrying the lever's own words plus one line naming what did not happen. Each operation's doc says exactly what its Completed guarantees. This never changes what the lever DID; it only stops the result claiming more. KEYS. Each operation takes the natural key of the data entity a test reads the record through: HoldId (WardenGovernanceHolds), ExceptionId (WardenExecutionExceptions), DiffSetId (WardenChangeDiffSets), RefTableId + RefRecId (WardenSalesGovernanceStates), SalesId + CustomerRequisition (WardenDuplicateOverrides). Where no entity existed when this was written the TABLE's natural key is used instead: PurchId for a firming request; one-to-one with the unique PurchTableIdx inside a company, and the value a test that firmed the order already holds; and RefTableId + RefRecId for journal governance state, its unique DocRefIdx, the same shape as the sales governance entity it mirrors. The trade agreement submit acts on the native journal header, keyed by its JournalNum. RecordKey echoes the key as OData entity-key text including the company; dataAreaId='usmf',HoldId='H-000001'; with any single quote inside a value doubled, so a harness can GET /data/Collection(RecordKey) with it as it stands. Every table here is per-company, so dataAreaId is always present. REASONS, AND WHAT IS NOT RECORDED. Both reason-coded dialogs collect ONE free-text Description255 field ("Reason code" for break-glass, "Dismissal reason" for dismiss). The operation's _reasonCode IS that field and is validated exactly as the dialog's value is; by the manager, which refuses a blank one; and it is cut at 255 characters, the width of the dialog control and of the column it lands in, with the cut said in Message. _comment is in the operation because the contract lists it, but NEITHER dialog has a second field, so a comment is accepted, never stored, and Message says so: the API records nothing a click could not have recorded, which is what keeps an API-driven release and a clicked one indistinguishable in the evidence. NEVER THROWS ACROSS THE BOUNDARY: every operation returns an MGCWardenApiResult, and every one of them runs only at ttsLevel 0, where its catch blocks can actually run.

Methods​

releaseHold​

Break-glass release of one governance hold. Mirrors MGCWardenBreakGlassRelease. The TIME BOX needs nothing here: MGCWardenBreakGlassExpiryBatch removes an expired grant, after which canRun() is false and the operation is Denied, exactly as the button disappears. COMPLETED GUARANTEES that this caller moved the hold from Active to BreakGlassReleased. THE VERDICT IS THE CLIENT'S OWN: MGCWardenBreakGlassReleaseAction::releasedByThisCall, the question the client's run() now asks before it says "released via break-glass". That line used to be unconditional, so this operation carried a private copy of the test rather than repeat the claim; with the client corrected there is one copy, and a click and a call cannot disagree about whether anything was released.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',HoldId='...'.
NameTypeOptionalDescription
_holdIdstrNoHoldId; the WardenGovernanceHolds entity key.
_reasonCodestrNoThe dialog's mandatory "Reason code" field.
_commentstrNoAccepted and NOT recorded: the dialog has no field for it.

releaseHoldCounted​

The releaseHold operation as its service endpoint runs it: runs releaseHold and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_holdIdstrNo
_reasonCodestrNo
_commentstrNo

takeException​

Assigns one execution exception to the caller. Mirrors MGCWardenExceptionTake, run headless through the menu item; it is single-select in the client too. COMPLETED GUARANTEES the row is now InProcess and assigned to the caller.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',ExceptionId='...'.
NameTypeOptionalDescription
_exceptionIdstrNoExceptionId; the WardenExecutionExceptions entity key.

takeExceptionCounted​

The takeException operation as its service endpoint runs it: runs takeException and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_exceptionIdstrNo

retryException​

Re-runs the failed operation recorded on one execution exception. Mirrors MGCWardenExceptionRetry, run headless through the menu item: with no form caller the action processes the single _args.record(), which is the one-row case of its multi-select. COMPLETED GUARANTEES the handler re-ran the operation successfully and the exception is now Resolved. That is not a duplicated guard: the client's read is the one that DECIDES, taken immediately before it acts because the workbench grid it is normally handed can be arbitrarily stale. This one only chooses the SENTENCE this operation refuses with, and a row that closes between the two simply refuses on the fresher of the two answers.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',ExceptionId='...'.
NameTypeOptionalDescription
_exceptionIdstrNoExceptionId; the WardenExecutionExceptions entity key.

retryExceptionCounted​

The retryException operation as its service endpoint runs it: runs retryException and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_exceptionIdstrNo

dismissException​

Reason-coded dismissal of one execution exception. Mirrors MGCWardenExceptionDismiss. The client action is a RunBase dialog with one "Dismissal reason" field, so this builds the action with that value (MGCWardenExceptionDismissAction::newFromValues) and runs ITS run(); the status guard, then MGCWardenExecutionExceptionManager::dismiss, which refuses a blank reason, then the client's own success line. IT USED TO CALL THE MANAGER ITSELF, and said here that it dismissed a row in any status because the client did. The client no longer does: only an open or in-process exception can be dismissed, since dismissing a resolved or already-dismissed one overwrote the only record of how it had been closed. It goes on running the action anyway, and the reason is REPORTING rather than enforcement: the manager's false carries no sentence, and this operation's contract is to come back Refused with words a caller can read. run() composes those words from a fresh read and throws them, which lands in the Refused catch below. COMPLETED GUARANTEES the exception was open or in process when the action looked and now reads Dismissed (re-read after the call).

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',ExceptionId='...'.
NameTypeOptionalDescription
_exceptionIdstrNoExceptionId; the WardenExecutionExceptions entity key.
_reasonCodestrNoThe dialog's mandatory "Dismissal reason" field.
_commentstrNoAccepted and NOT recorded: the dialog has no field for it.

dismissExceptionCounted​

The dismissException operation as its service endpoint runs it: runs dismissException and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_exceptionIdstrNo
_reasonCodestrNo
_commentstrNo

submitDeltaRoute​

Route-recovery lever: raises the Delta approval for one diff set. Mirrors MGCWardenDeltaApprovalSubmit, run headless through the menu item. Nothing here looks for another way in. The lever asks MGCWardenSubmitGuard::diffSetRouteRefusal of the diff set re-read under a pessimistic lock. The refusal is logged rather than thrown, and it comes back as Refused all the same. COMPLETED GUARANTEES the workflow runtime holds a live or decided approval with this diff set as its context (MGCWardenRouteExistenceCheck::approvalExists, re-asked after the submit). Because the lever now refuses a diff set that already had one, that approval is the one this call raised. An earlier CANCELED instance does not count as an approval, so it cannot stand in.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',DiffSetId='...'.
NameTypeOptionalDescription
_diffSetIdstrNoDiffSetId; the WardenChangeDiffSets entity key.

submitDeltaRouteCounted​

The submitDeltaRoute operation as its service endpoint runs it: runs submitDeltaRoute and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_diffSetIdstrNo

submitExcludedClassRoute​

Route-recovery lever: raises the Excluded-class change approval for one diff set. Mirrors MGCWardenExcludedClassApprovalSubmit, run headless through the menu item. COMPLETED GUARANTEES what submitDeltaRoute's does: an approval exists for the diff set, and it is the one this call raised.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',DiffSetId='...'.
NameTypeOptionalDescription
_diffSetIdstrNoDiffSetId; the WardenChangeDiffSets entity key.

submitExcludedClassRouteCounted​

The submitExcludedClassRoute operation as its service endpoint runs it: runs submitExcludedClassRoute and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_diffSetIdstrNo

submitFirmingRoute​

Route-recovery lever: raises the Firming approval for one firming request. Mirrors MGCWardenFirmingApprovalSubmit, run headless through the menu item. Keyed by PurchId, resolved through MGCWardenFirmingRequest::findPurchTable; the table's one sanctioned lookup, over its unique PurchTableIdx; so a request whose purchase order no longer exists is NotFound here. COMPLETED GUARANTEES an approval exists with the firming request as its context (re-asked after the submit).

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',PurchId='...'.
NameTypeOptionalDescription
_purchIdstrNoThe firmed purchase order's PurchId.

submitFirmingRouteCounted​

The submitFirmingRoute operation as its service endpoint runs it: runs submitFirmingRoute and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_purchIdstrNo

submitSalesGovRoute​

Route-recovery lever: raises the Sales governance approval for one document's governance state. Mirrors MGCWardenSalesGovApprovalSubmit, run headless through the menu item. The lever refuses a governance state row whose document carries no active SALES GOVERNANCE hold; the hold is the evidence the route was required; and that refusal comes back as Refused with the lever's own message, as it does for the delta and excluded-class levers. THIS PARAGRAPH USED TO RECORD THE OPPOSITE: the client's main() had no hold guard and submitted any state row it was handed, including one for a quotation that never breached, whose approval then stamped a carry that suppressed evaluation of the derived order. It said the gap belonged in the lever, where both channels would get it, and that is where it was closed (MGCWardenSalesGovApprovalSubmitManager::holdRefusalText). Nothing is restated here: the API runs the same main() and so refuses exactly what it refuses. That test now comes before the feature test, and both are logged rather than thrown. Both still come back as Refused. COMPLETED GUARANTEES an approval exists for the CURRENT BREACH with the governance state as its context (re-asked after the submit). It is now asked over the active hold's window, the lever's own.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',RefTableId=n,RefRecId=n.
NameTypeOptionalDescription
_refTableIdRefTableIdNoRefTableId; first half of the WardenSalesGovernanceStates key.
_refRecIdRefRecIdNoRefRecId; second half of the WardenSalesGovernanceStates key.

submitSalesGovRouteCounted​

The submitSalesGovRoute operation as its service endpoint runs it: runs submitSalesGovRoute and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_refTableIdRefTableIdNo
_refRecIdRefRecIdNo

takeReconfirmation​

Claims one document awaiting reconfirmation for the caller. Mirrors MGCWardenReconfirmationTake, run headless through the menu item: with no form caller the action processes the single _args.record(), the one-row case of its multi-select. COMPLETED GUARANTEES the reconfirmation is still outstanding (Required) and the row is now assigned to the caller. The action SKIPS a row that is not Required rather than refusing it and reports the skip in an info summary, so the row is re-read and that case is Refused. As in the client, a claim is not an authority; nothing here touches the hold or lets the document confirm.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',RefTableId=n,RefRecId=n.
NameTypeOptionalDescription
_refTableIdRefTableIdNoRefTableId; first half of the WardenSalesGovernanceStates key.
_refRecIdRefRecIdNoRefRecId; second half of the WardenSalesGovernanceStates key.

takeReconfirmationCounted​

The takeReconfirmation operation as its service endpoint runs it: runs takeReconfirmation and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_refTableIdRefTableIdNo
_refRecIdRefRecIdNo

submitJournalReview​

Raises the banded journal review for one journal governance state. Mirrors MGCWardenJournalReviewSubmit, run headless through the menu item. That last is what refuses a second submit, including one made against a returned review, which is resubmitted from its work item instead. All three come back as Refused. Its submit() SWALLOWS an activation failure by design and the lever then only WARNS that no work item exists, so the operation asks the lever's own closing question; MGCWardenRouteExistenceCheck::approvalExistsForTypeSince on the state row, qualified by the template and the current review episode (verifyRoute, via submitJournal); and reports Refused when the runtime holds no approval. The row is SHARED with the reversal cycle, so the unqualified predicate this used to ask was satisfied by a live REVERSAL on the same journal; the operation reported Completed for a review nobody held.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',RefTableId=n,RefRecId=n.
NameTypeOptionalDescription
_refTableIdRefTableIdNoRefTableId of the journal governance state (DocRefIdx).
_refRecIdRefRecIdNoRefRecId of the journal governance state (DocRefIdx).

submitJournalReviewCounted​

The submitJournalReview operation as its service endpoint runs it: runs submitJournalReview and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_refTableIdRefTableIdNo
_refRecIdRefRecIdNo

submitJournalReversal​

Raises the journal reversal approval for one journal governance state. Mirrors MGCWardenJournalRevApprovalSubmit, run headless through the menu item. That is what refuses a second submit. Both come back as Refused. Its submit() SWALLOWS an activation failure by design (filing an execution exception) and the lever then only WARNS that no work item exists, so the operation asks the lever's own closing question; MGCWardenRouteExistenceCheck::approvalExistsForTypeSince on the state row, qualified by the template and asked over all time, because a reversal state row carries one cycle (verifyRoute, via submitJournal; this named the unqualified approvalExists until 2026-10-06); and reports Refused when the runtime holds no approval.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',RefTableId=n,RefRecId=n.
NameTypeOptionalDescription
_refTableIdRefTableIdNoRefTableId of the journal governance state (DocRefIdx).
_refRecIdRefRecIdNoRefRecId of the journal governance state (DocRefIdx).

submitJournalReversalCounted​

The submitJournalReversal operation as its service endpoint runs it: runs submitJournalReversal and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_refTableIdRefTableIdNo
_refRecIdRefRecIdNo

submitTradeAgreementJournal​

Mirrors MGCWardenTASubmitForApproval, run headless through the menu item with the PriceDiscAdmTable header; the list form's dataset. There is no single post-state to verify; "clean" and "gated" are both correct answers; so Message carries the action's sentence and a test asserts the verdict on the trade agreement gate state, not on Status. The Block-posture answer is the exception: it writes nothing to the gate state, so a test asserts it on the journal's event log instead.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',JournalNum='...'.
NameTypeOptionalDescription
_journalNumstrNoThe trade agreement journal's JournalNum.

submitTradeAgreementJournalCounted​

The submitTradeAgreementJournal operation as its service endpoint runs it: runs submitTradeAgreementJournal and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_journalNumstrNo

registerDuplicateOverride​

Registers a reason-coded duplicate customer-requisition override on one sales order. Mirrors MGCWardenDuplicateOverrideRegister. The client action is a RunBase dialog asking for the requisition and a reason, so this builds the action with those values (MGCWardenDuplicateOverrideAction::newFromValues) and runs ITS validate() then ITS run(); the same three refusals (no requisition, a requisition that duplicates nothing, an override already registered) plus registerOverride's blank-reason throw, and the same DuplicateOfSalesId derivation. The duplicate is never taken from the caller: the action derives it from what the requisition index holds, precisely so it cannot be retyped wrongly. A blank _customerRequisition takes the order's current requisition; the dialog's default. The reason is cut at 255 characters, the dialog field's width. COMPLETED GUARANTEES isSuppressedByOverride now answers true for this order and requisition, and RecordId is the override row. The action's run() only WARNS when the row did not take effect; the operation asks the same predicate and reports that case as Failed; nothing refused it, and yet the database did not keep it.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',SalesId='...',CustomerRequisition='...'.
NameTypeOptionalDescription
_salesIdstrNoSalesId; first half of the WardenDuplicateOverrides key.
_customerRequisitionstrNoCustomerRequisition; second half of the key; blank takes the order's own.
_reasonstrNoThe dialog's mandatory "Reason" field.

registerDuplicateOverrideCounted​

The registerDuplicateOverride operation as its service endpoint runs it: runs registerDuplicateOverride and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_salesIdstrNo
_customerRequisitionstrNo
_reasonstrNo