The Expression evaluator policy item allows you to create logic statements (expressions) containing event data (WinGate objects), that will be evaluated when the item is processed by the policy.
The Expression evaluator can be made to return a Boolean true (Yes) or false (No) result by evaluating object property values. Depending on whether the statements finally evaluate to true or false will then determine the path that policy evaluation will take.
Alternatively, these statements can be simply made to perform an action using the various member functions available in WinGate objects.
In the Condition window, enter the statements to be evaluated in the form of an expression.
You can also insert relevant WinGate event data into the condition statement by using the Insert Symbol button to open the Symbol Browser.
e.g. Session.Request.Header["user-agent"].Contains("Gecko",0) NOR Session.Request.Server.Contains("Mozilla",0)
In this example if the user-agent field in header of the request from the client doesn't contain Gecko or Mozilla then the statement will evaluate to true (Yes). If the user-agent field of the header contains Gecko or Mozilla then the condition is said to evaluate to false (No).
If you wish to just have the statement perform an action, then uncheck the Resolve expression into true/false result option. The Expression evaluator policy item on the worksheet will change shape accordingly to a single output connector (since there will be no requirement for Yes/No paths). In the Expression evaluator example below, the DNSClient object method EmptyCache has been selected. This will cause WinGates DNS cache to be emptied each time this policy item is processed.
You can enter in as many statements as you wish, and it is possible to enter a combination of evaluation and action statements. However there are few points to note:
©2012 Qbik New Zealand Limited
no comments yet...
You can use basic Full-Text Searches against the page title and body to find matching articles. Use the following search modifiers to refine your query:
You can create a new account or reset your password at forum.wingate.com.