Qbik Helpsys

Expression evaluator

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.

To use the Expression evaluator policy item:

  1. Select or create a policy to open a policy editor.
  2. In the Items section of the policy editor toolbox, select the Expression evaluator item and drag it on to the worksheet. This will open the Expression evaluator properties.
  3. 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.

    Note

    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:

    • Each statement should be seperated by either, a blank space, comma, or new line.
    • In the case where you wish to enter multiple evaluation statements (to produce a true or false result) only the result of the final statement will used to determine a Yes (true) or No (false) outcome for the policy item.
  4. Click OK to apply the changes to the Expression evaluator item and return to the worksheet.
  5. The Expression evaluator policy item will now blink, allowing you to give it a meaningful name so you can identify it easily in the policy evaluation flow.
  1. no comments yet...

Download helpfile

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:

  • event management (no quotes) will find all pages containing the words "event" OR "management"
  • "event management" (with quotes) will find all pages containing the phrase "event management"
  • +event -management will find all pages containing the word "event", AND NOT the word "management"