Skip to main content

MGCWardenApiResult

The one result shape every Warden API service operation returns (the backend test-automation surface). A caller; an automated test above all; branches on Success and Status and never has to parse prose to learn what happened. STATUS VOCABULARY, closed and stable, so a test can assert on it: Completed; the operation ran and raised no error. Message carries any info/warning lines. Refused; a business rule said no (an Exception::Error with its message): a governance gate, a validation, a separation-of-duties check. This is usually the outcome a test is ASSERTING, so it is not a transport failure and Success is false only in the sense that the requested change did not happen. Denied; the caller cannot run the equivalent action in the client, so the API refuses it too (UI parity, MGCWardenApiDispatch::canRun). No work was attempted. NotFound; the record the caller named does not exist in the current company. Failed; anything else: an unexpected exception, a call made inside a transaction. RecordKey / RecordId identify the record the operation acted on or created, using the SAME natural key the corresponding data entity exposes, so a test can read the entity, call the operation, and read the entity again with one key throughout. The existing MGCWardenWorkItemService.approve/reject predate this contract and still return a plain string (shipped that shape); they are deliberately left unchanged rather than broken.

Methods​

parmSuccess​

  • Visibility: public
  • Returns: boolean
NameTypeOptionalDescription
_successbooleanYes

parmStatus​

  • Visibility: public
  • Returns: str
NameTypeOptionalDescription
_statusstrYes

parmMessage​

  • Visibility: public
  • Returns: str
NameTypeOptionalDescription
_messagestrYes

parmRecordKey​

  • Visibility: public
  • Returns: str
NameTypeOptionalDescription
_recordKeystrYes

parmRecordId​

  • Visibility: public
  • Returns: RefRecId
NameTypeOptionalDescription
_recordIdRefRecIdYes

construct​

Builds a result.

  • Visibility: public
  • Returns: MGCWardenApiResult The result.
NameTypeOptionalDescription
_successbooleanNoTrue when the requested change happened.
_statusstrNoOne of Completed, Refused, Denied, NotFound, Failed.
_messagestrYesHuman-readable detail; normally the captured infolog.
_recordKeystrYesNatural key of the record acted on or created.
_recordIdRefRecIdYesRecId of the record acted on or created, when known.