🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators ExecuteCurrentActionAgainOnce
This page was created by Stephanie on 2025-01-08. Last edited by Wikiadmin on 2026-07-29.

You can use ExecuteCurrentActionAgainOnce in a EAL action to retry the action that is currently executing, once; it is intended for ViewModel actions that need to recover from a transient failure such as a stale access token.

Purpose

ExecuteCurrentActionAgainOnce instructs the ViewModel to execute its current action again. The retry is limited to one additional execution.

Use it when the action can become valid after your failure handling has completed. A common case is a REST request whose access token is stale: handle the failed request in its OnFail logic, renew or otherwise correct the access token, and then retry the original action.

Syntax

selfVM.ExecuteCurrentActionAgainOnce

selfVM is the current ViewModel context. The operator retries the action currently being processed; it does not name or invoke a different action.

Retry a failed REST action

Place the operator in the failure logic for the request that should be retried.

  1. Create or edit the ViewModel action that performs the REST request.
  2. Add the logic that detects and handles the transient failure in the request's OnFail logic. For example, restore a valid access token when the failure is caused by a stale token.
  3. After the corrective logic, call selfVM.ExecuteCurrentActionAgainOnce.
  4. Ensure the action can complete successfully when it runs again with the corrected state.

Example structure:

-- REST request OnFail logic
-- Correct the stale access-token condition here
selfVM.ExecuteCurrentActionAgainOnce

When the current action fails, this logic requests one more execution of that same action. The retry gives the REST request another opportunity to run after the access-token condition has been corrected.

One-retry limit

The operator retries the current action once. Do not use it as a general loop for persistent failures.

For example, if the access token remains invalid after the retry, the action is not repeatedly retried by this operator. Make sure your failure logic handles errors that cannot be resolved by one retry.

When to use it

Situation Use ExecuteCurrentActionAgainOnce?
A REST request fails because its access token is stale, and failure logic can correct the token. Yes. Use it from the request's OnFail logic after correcting the condition.
The action needs to run a different named ViewModel action. No. This operator retries the current action only.
The failure is expected to persist and needs repeated attempts. No. The operator performs only one retry; handle the persistent failure explicitly.

Related operators

Use RemoteTurnkeyExecuteAction when working with a remote Turnkey session. For the broader action-language syntax and where actions run, see EAL.

See also