Qbik Helpsys

Run Javascript script

License restriction: The Run Javascript script policy item is only available when using a WinGate Professional or WinGate Enterprise license.

The Run Javascript script policy item allows you to evaluate event data using Javascript expressions, in order to return a true (Yes) or false (No) result. This result can be used to determine which path the policy evaluation process should take.

You can structure the expressions that the Run Javascript script policy item should evaluate using common Javascript syntax. As with other policy items, you can select available data from the Symbol Browser to include in the script. These will provide the latest data at the time the script is processed in the policy.

To use the Run Javascript script:

  1. Select or create a policy to open a policy editor.
  2. On the Items section of the Toolbox, select the Run Javascript script item and drag it on to the worksheet. This will open the Run Javascript script properties.
  3. In between the curly brackets, enter the Javascript expressions that you wish the Run Javascript script policy item to evaluate in order to return a true or false result. By default return true is already entered as the return result in blue. If you wish the Run Javascript script policy item outcome to return false then change it accordingly. Obviously you will have to enter appropriate expressions to have the result return false.

    All code placed inside the curly brackets should conform to Javascript syntax rules. (e.g. each statement should be suffixed by a semi colon, variables declared correctly, using curly brackets when setting functions, statements etc.).

    You can insert event data into the Javascript expressions by placing the cursor at the desired location in the statement and clicking the Insert symbol button to open the Symbol Browser.

    Example 1

    Example 2

    In the examples shown above, the value of two pieces of event data (Session.ClientIP and Request.Port) are selected from the Symbol Browser. These are being checked by an If statement to see if they are equal to the two set values shown. In this expression, the Session.ClientIP must be equal to 192.168.0.4 AND the Request.Port must be equal to 369 for the decision to return true(YES).

  4. Once you have finished entering the Javascript expressions you require, click OK to return to the worksheet.
  5. The Run Javascript script 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"