Developer

ExecuteAgentryAction

The ExecuteAgentryAction method is called to request the Agentry Client execute an action. In addition to the AgentryConext, the method takes parameters specifying the name of the module in which the action to be executed is defined, as well as the name of the action itself. The action is always executed in the context of the module MainObject. The action being executed, therefore, must be defined for the MainObject or for no object. SubAction steps executing actions for other objects can be defined within the action executed by the method should it be necessary to execute an action for a different object type.

Actions may not be executed immediately under certain conditions; specifically, if another action is currently being executed. In such cases the action is queued by the Agentry Client to be executed as soon as it is able. The method will return true in such a case and the action will be executed when the first opportunity arises. The Agentry Client contains only a single action queue in which all queued actions are stored until executed. The other primary situation in which actions can be queued relates to Push Actions. Actions are executed from this queue in a first in-first out order.

Actions will not be executed and the method will return false if the Agentry Client is currently running, but the user has not yet completed the login process successfully, e.g., the login screen is currently displayed, the server selection screen is displayed, etc.; or if the named action or module cannot be found within the business logic currently running on the Agentry Client.

Prototype

bool ExecuteAgentryAction(											AgentryContext* pCtx,
											const std::tstring& ModuleName,
											const std::tstring& ActionName)

Parameters

  • pCtx - Pointer to the AgentryContext object returned by a call made to the AgentryInitialize() method.
  • ModuleName - The name of the module definition within the Agentry application project in which the action to be executed is defined.
  • ActionName - The name of the action to be executed by the Agentry Client.

Return Value

The Boolean return of this method indicates whether or not the action was found and either executed or placed in the pending actions queue to be executed when possible. If this fails for any reason the function returns false and the named action will not be executed by the Agentry Client. The return value should always be checked and the external process should include logic to account for a failed action execution.