The EvaluateAgentryRule method can be called by the external process to request a named rule be evaluated by the Agentry Client. Included in the parameters to this method are the internal names of the module in which the rule is contained and the name of the rule to be evaluated. Also included are the AgentryContext and a string parameter in which the return value of the rule will be captured.
Rules evaluated by the EvaluateAgentryRule method are evaluated in the context of the module MainObject of the same module in which the rule is defined. Any rule in the module may be evaluated via this method, with the rule’s return value provided as a string. This value can then be converted to other data types as needed within the external process.
bool EvaluateAgentryRule(AgentryContext* pCtx, const std::tstring& ModuleName, const std::tstring& RuleName, std::tstring& Value)
The Boolean return of this method indicates whether or not the rule was found and evaluated. If this fails for any reason the function returns false and the value of the Value parameter is a null string. The return value should always be checked before attempting to use the Value parameter and the external process should include logic to account for a failed rule evaluation.