Skip to main content

MGCWardenPolicyLifecycleService

Policy lifecycle over HTTP (test-automation surface, S1): submit a draft for activation, clone a version to a new draft, and simulate a guard policy; for exactly the users who can do each in the client, by running exactly the code the client runs. Every operation returns MGCWardenApiResult and never throws across the service boundary. WHAT THIS SERVICE CAN NOT DO, AND WHY THAT IS THE DESIGN. There is no operation here that makes a version Active, and there must never be one. Every submit stops at PendingActivation with a native workflow instance started; the version becomes Active only when a DIFFERENT user approves that workflow's work item; in the client, or through MGCWardenWorkItemService.approve; and MGCWardenActivationSoDGate refuses the approval on both channels when the approver is the user who submitted. A test that needs an Active policy therefore performs the real two-person activation: author seeds a Draft through OData, calls submit* as the author, then approves as someone else. That is slower than a back door, and it is the only route whose passing test proves anything. SUBMIT AND NEW VERSION RUN THE MENU ITEM ITSELF. Each of the six submit managers and five new-version actions was read before its operation was written: main(Args) takes the record from Args, refuses through the infolog, and uses no dialog, prompt(), Box::, caller FormRun or FormDataUtil refresh. They therefore go through MGCWardenApiDispatch::runAction, which runs the same menu item through MenuFunction; the same class, the same entry-point security context, the same event-log rows and the same refusal messages as a click on the button. The submit managers used to test the status only on the record they were handed, which is the row this service looked up a moment earlier. So two calls, or a call racing a click, could each pass and raise a second activation workflow against one version. Each manager now re-reads the version with pessimisticlock inside the transaction that stamps it, and refuses a version that is no longer Draft (MGCWardenSubmitGuard::activationRefusal). That refusal is logged with error() rather than thrown, and runAction reads a logged error as Refused (MGCWardenApiDispatch::resultSince), so the result is Refused either way and nothing is thrown across the boundary. SIMULATE CANNOT, and calls its underlying logic instead. MGCWardenSimulateAction is a RunBase whose main() calls prompt() for the history window, and there is nobody to answer a dialog on a service thread. The operation takes the window as parameters, applies the action's own validate() rule, and calls MGCWardenSimulationRunner::run; the one method the action's run() calls; behind canRun() on the same MGCWardenSimulate menu item. They take no comment, because the client button takes none; the instance's comment is written by Warden and says the instance is a retirement. THE SUBMIT COMMENT IS ACCEPTED AND NOT RECORDED, because the client records none. The contract anticipated a workflow-submit comment dialog; there is none. The six activation buttons are plain action menu items whose submit managers call Workflow::activateFromWorkflowType with an empty comment, so writing the caller's text onto the workflow instance would make the API do something the client cannot. The parameter stays so the signature matches the contract, and when it is not empty the result message says it was not recorded rather than dropping it silently. A test that wants a comment on the workflow history supplies it on the approval, where both channels take one. KEYS. Every operation takes the natural key of the corresponding data entity; PolicyCode + PolicyVersion for the five policy entities, ObjectName + EntryVersion for MGCWardenAuditRegisterEntryEntity; and returns RecordKey as that entity's OData key predicate, for example dataAreaId='usmf',PolicyCode='GP-01',PolicyVersion=2, so a harness can read the row back with /data/WardenGuardPolicies({RecordKey}) and never has to invent a key format. The register table is shared across companies (SaveDataPerCompany = No), so its predicate has no dataAreaId. New version returns the key of the version it CREATED, because that is the row the test reads next.

Methods​

submitGuardPolicy​

Submits a draft (or simulating) guard control policy version to the Policy activation workflow. Mirrors MGCWardenPolicyActivationSubmit: runs MGCWardenPolicyActivationSubmitManager. The version ends PendingActivation; a different user must approve it.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is the submitted version's entity key.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenPolicyEntity.PolicyCode.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenPolicyEntity.PolicyVersion.
_commentstrNoAccepted for contract stability; not recorded, because the client submit captures no comment.

submitGuardPolicyCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo
_commentstrNo

submitSalesGovPolicy​

Submits a draft sales governance policy version to its activation workflow. Mirrors MGCWardenSalesGovPolicyActivationSubmit: runs MGCWardenSalesGovPolicyActivationSubmitManager, which admits Draft only. The version ends PendingActivation; a different user must approve it.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is the submitted version's entity key.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenSalesGovPolicyEntity.PolicyCode.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenSalesGovPolicyEntity.PolicyVersion.
_commentstrNoAccepted for contract stability; not recorded, because the client submit captures no comment.

submitSalesGovPolicyCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo
_commentstrNo

submitJournalPolicy​

Submits a draft journal governance policy version to its activation workflow. Mirrors MGCWardenJournalPolicyActivationSubmit: runs MGCWardenJournalPolicyActivationSubmitManager, which admits Draft only. The version ends PendingActivation; a different user must approve it.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is the submitted version's entity key.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenJournalPolicyEntity.PolicyCode.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenJournalPolicyEntity.PolicyVersion.
_commentstrNoAccepted for contract stability; not recorded, because the client submit captures no comment.

submitJournalPolicyCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo
_commentstrNo

submitPriceGuardPolicy​

Submits a draft price guard policy version to its activation workflow. Mirrors MGCWardenPriceGuardPolicyActivationSubmit: runs MGCWardenPriceGuardPolicyActivationSubmitManager, which admits Draft only. The version ends PendingActivation; a different user must approve it.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is the submitted version's entity key.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenPriceGuardPolicyEntity.PolicyCode.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenPriceGuardPolicyEntity.PolicyVersion.
_commentstrNoAccepted for contract stability; not recorded, because the client submit captures no comment.

submitPriceGuardPolicyCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo
_commentstrNo

submitCountPolicy​

Submits a draft count governance policy version to its activation workflow. Mirrors MGCWardenCountPolicyActivationSubmit: runs MGCWardenCountPolicyActivationSubmitManager, which admits Draft only. The version ends PendingActivation; a different user must approve it.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is the submitted version's entity key.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenCountPolicyEntity.PolicyCode.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenCountPolicyEntity.PolicyVersion.
_commentstrNoAccepted for contract stability; not recorded, because the client submit captures no comment.

submitCountPolicyCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo
_commentstrNo

submitRegisterEntry​

Submits a draft Sensitivity Register entry version to the Register activation workflow. The entry ends PendingActivation; a different user must approve it.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is the submitted entry version's entity key (no dataAreaId: the register is shared).
NameTypeOptionalDescription
_objectNamestrNoMGCWardenAuditRegisterEntryEntity.ObjectName.
_entryVersionintNoMGCWardenAuditRegisterEntryEntity.EntryVersion.
_commentstrNoAccepted for contract stability; not recorded, because the client submit captures no comment.

submitRegisterEntryCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_objectNamestrNo
_entryVersionintNo
_commentstrNo

requestGuardPolicyRetirement​

Mirrors MGCWardenPolicyRetirementRequest: runs MGCWardenRetirementSubmitManager, which refuses anything but an Active version and a second request, and starts the family's activation workflow. The version stays Active; a DIFFERENT user must approve the work item through MGCWardenWorkItemService.approve, and only then is it Retired. Denied unless the caller could press Request retirement in the client.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is the version's entity key.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenPolicyEntity.PolicyCode.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenPolicyEntity.PolicyVersion.
_reasonstrNoRequired, as in the client's dialog: blank is Refused.

requestGuardPolicyRetirementCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo
_reasonstrNo

requestSalesGovPolicyRetirement​

Mirrors MGCWardenSalesGovPolicyRetirementRequest: runs MGCWardenRetirementSubmitManager, which refuses anything but an Active version and a second request, and starts the family's activation workflow. The version stays Active; a DIFFERENT user must approve the work item through MGCWardenWorkItemService.approve, and only then is it Retired. Denied unless the caller could press Request retirement in the client.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is the version's entity key.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenSalesGovPolicyEntity.PolicyCode.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenSalesGovPolicyEntity.PolicyVersion.
_reasonstrNoRequired, as in the client's dialog: blank is Refused.

requestSalesGovPolicyRetirementCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo
_reasonstrNo

requestJournalPolicyRetirement​

Mirrors MGCWardenJournalPolicyRetirementRequest: runs MGCWardenRetirementSubmitManager, which refuses anything but an Active version and a second request, and starts the family's activation workflow. The version stays Active; a DIFFERENT user must approve the work item through MGCWardenWorkItemService.approve, and only then is it Retired. Denied unless the caller could press Request retirement in the client.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is the version's entity key.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenJournalPolicyEntity.PolicyCode.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenJournalPolicyEntity.PolicyVersion.
_reasonstrNoRequired, as in the client's dialog: blank is Refused.

requestJournalPolicyRetirementCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo
_reasonstrNo

requestPriceGuardPolicyRetirement​

Mirrors MGCWardenPriceGuardPolicyRetirementRequest: runs MGCWardenRetirementSubmitManager, which refuses anything but an Active version and a second request, and starts the family's activation workflow. The version stays Active; a DIFFERENT user must approve the work item through MGCWardenWorkItemService.approve, and only then is it Retired. Denied unless the caller could press Request retirement in the client.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is the version's entity key.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenPriceGuardPolicyEntity.PolicyCode.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenPriceGuardPolicyEntity.PolicyVersion.
_reasonstrNoRequired, as in the client's dialog: blank is Refused.

requestPriceGuardPolicyRetirementCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo
_reasonstrNo

requestCountPolicyRetirement​

Mirrors MGCWardenCountPolicyRetirementRequest: runs MGCWardenRetirementSubmitManager, which refuses anything but an Active version and a second request, and starts the family's activation workflow. The version stays Active; a DIFFERENT user must approve the work item through MGCWardenWorkItemService.approve, and only then is it Retired. Denied unless the caller could press Request retirement in the client.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is the version's entity key.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenCountPolicyEntity.PolicyCode.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenCountPolicyEntity.PolicyVersion.
_reasonstrNoRequired, as in the client's dialog: blank is Refused.

requestCountPolicyRetirementCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo
_reasonstrNo

requestRegisterEntryRetirement​

Mirrors MGCWardenRegisterRetirementRequest: runs MGCWardenRetirementSubmitManager, which starts the Register activation workflow. The entry stays Active; a DIFFERENT user must approve the work item, and only then is it Retired. Denied unless the caller could press Request retirement in the client.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is the entry version's entity key (no dataAreaId: the register is shared).
NameTypeOptionalDescription
_objectNamestrNoMGCWardenAuditRegisterEntryEntity.ObjectName.
_entryVersionintNoMGCWardenAuditRegisterEntryEntity.EntryVersion.
_reasonstrNoRequired, as in the client's dialog: blank is Refused.

requestRegisterEntryRetirementCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_objectNamestrNo
_entryVersionintNo
_reasonstrNo

newGuardPolicyVersion​

Clones a guard control policy version; header, scope lines and field change matrix; to a new Draft.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; on Completed, RecordKey/RecordId identify the NEW draft version.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenPolicyEntity.PolicyCode of the version to copy.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenPolicyEntity.PolicyVersion of the version to copy.

newGuardPolicyVersionCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo

newSalesGovPolicyVersion​

Clones a sales governance policy version, with its threshold lines, to a new Draft.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; on Completed, RecordKey/RecordId identify the NEW draft version.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenSalesGovPolicyEntity.PolicyCode of the version to copy.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenSalesGovPolicyEntity.PolicyVersion of the version to copy.

newSalesGovPolicyVersionCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo

newJournalPolicyVersion​

Clones a journal governance policy version, with its band lines, to a new Draft.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; on Completed, RecordKey/RecordId identify the NEW draft version.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenJournalPolicyEntity.PolicyCode of the version to copy.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenJournalPolicyEntity.PolicyVersion of the version to copy.

newJournalPolicyVersionCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo

newPriceGuardPolicyVersion​

Clones a price guard policy version, with its scope lines, to a new Draft.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; on Completed, RecordKey/RecordId identify the NEW draft version.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenPriceGuardPolicyEntity.PolicyCode of the version to copy.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenPriceGuardPolicyEntity.PolicyVersion of the version to copy.

newPriceGuardPolicyVersionCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo

newCountPolicyVersion​

Clones a count governance policy version to a new Draft.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; on Completed, RecordKey/RecordId identify the NEW draft version.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenCountPolicyEntity.PolicyCode of the version to copy.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenCountPolicyEntity.PolicyVersion of the version to copy.

newCountPolicyVersionCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo

simulateGuardPolicy​

Simulate-before-activate: runs a guard control policy version against a window of document history and persists the would-have-blocked / routed / logged report. Mirrors MGCWardenSimulate. GUARD CONTROL POLICIES ONLY. WHY THIS DOES NOT GO THROUGH runAction. MGCWardenSimulateAction::main calls prompt() for the window, which cannot be answered on a service thread. So this operation takes the window as parameters and runs what the action runs after its dialog closes: the action's validate() rule (end not before start, reported with the same checkFailed message) and then MGCWardenSimulationRunner::run; still behind canRun() on MGCWardenSimulate, so the grant that decides who may press the button decides who may call this. Like the button, it does not look at the version's status and does not change it: simulating is a read of history plus a persisted report, never a lifecycle transition.

  • Visibility: public
  • Returns: MGCWardenApiResult The result. On Completed, RecordKey/RecordId identify the persisted MGCWardenSimulationRun; the table has no natural key, so RecordKey is its RecId as text. On any other status they identify the policy version named.
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNoMGCWardenPolicyEntity.PolicyCode.
_policyVersionMGCWardenPolicyVersionNumNoMGCWardenPolicyEntity.PolicyVersion.
_windowFromTransDateNoFirst day of the history window (inclusive); the dialog's Window from.
_windowToTransDateNoLast day of the history window (inclusive); the dialog's Window to.

simulateGuardPolicyCounted​

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

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_policyCodeMGCWardenPolicyCodeNo
_policyVersionMGCWardenPolicyVersionNumNo
_windowFromTransDateNo
_windowToTransDateNo