The ExecuteAgentryTransaction method is called by the external process to request an edit transaction be instantiated and applied, i.e., to be processed, by the Agentry Client. In addition to the AgentryContext object, the method takes the name of the module in which the transaction is defined, the name of the transaction itself, and a reference to an AgentryPropertyVector containing the transaction property values to be set within the transaction.
The transaction to be processed must be an edit transaction and must be defined for the module MainObject, as it is instantiated in the context of that object. Add and delete transactions are not supported.
When a transaction is processed via as a result of a call to this method, the properties of that transaction are first initialized according to the initial value attributes of those properties, with the exception of “Rule - After Data Entry.” Next, any values passed to the method call are copied to the transaction properties, which will replace any initialization values that may be present. The transaction is then processed by the Agentry Client. Property values are then set for any properties which are initialized to “Rule - After data entry.” The current value of such properties are overwritten with the value returned by the rule. Finally the transaction is applied, which includes setting the values of the object properties targeted by the transaction properties, and the transaction itself is saved to the client device as a pending transaction.
bool ExecuteAgentryTransaction( AgentryContext* pCtx, const std::tstring& ModuleName, const std::tstring& TransactioName, const AgentryPropertyVector& properties)
- 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 transaction to be processed is defined.
- TransactionName - The name of the transaction to be processed by the Agentry Client.
- properties - Reference to an AgentryPropertyVector containing the property values to be set when the transaction is instantiated. See the section on the API data types for more details on AgentryPropertyVectors.
The Boolean return of this method indicates whether or not the transaction was found and processed. If this fails for any reason the function returns false and the named transaction will not be processed by the Agentry Client. The return value should always be checked and the external process should include logic to account for failed transaction processing.