Qbik Helpsys

Accessing global data items

Global data items can be accessed in a number of ways within WinGate:

  1. Global Data tab

    Items can be created, modified, and deleted by using the Global Data tab on the Data panel, located at Control Panel > Data in the WinGate Management console.

    The Global Data tab lists all of the global data items that have been created and displays their current values.

  2. Script

    When using a WinGate scripting system (such as the Lua or Javascript event processors) global data items can be created, read, modified, and deleted as required.

    In the script environment, the Data system publishes a global WinGate object called Data. This is the same object that is also visible in the Symbol browser dialog when viewing symbols associated with an event. The methods (functions) exposed by the Data object allow the creation, destruction and modification of data items. See the WinGate objects section below for the methods provided by the Data object.

  3. Custom Policy item

    The Data system also registers several custom policy items, the Data list lookup and the Data Boolean check, with the Policy system. These policy items allows for a convenient way to have a policy check whether the value of a piece of event data is on a specified global data list, or check the current state of a global boolean value.

    Read more about registered Data module items

  4. For developers

    All global data is published in the WinGate Schema. Components can perform the same tasks available from script using the Schema interface - a C language API.

WinGate objects

When using a WinGate script system (such as the Lua or Javascript event processors) or a configuration that has access to a Symbol browser, you can access these global data items using methods provided by the Data object. The Data object methods allow you to access, manipulate, and even delete the named global data item.

Data object

Member

Description

GetBool(Text BoolName)

Will retrieve the value of the named boolean.

GetCounter(Text CounterName)

  • Add(Number value)
  • Dec
  • Inc
  • Publish(Boolean Publish)
  • Reset(Number Value)
  • Set(Number Value)

Gets a global counter object by name, creating it if necessary.

A script could contain:

Data.GetCounter("testcount").Inc

This would increase the value of a global counter called testcount by 1 every time the condition occurred (e.g. if an HTTP request is made to a certain site, increment the global counter called testcount by 1).

GetList(Text ListName)

  • AddMember(Text Member)

  • Contains(Text Member)

  • Delete(Text Member)

Gets a global data list object by name, creating it if necessary

A script could contain:

Data.GetList("Banned search names").Contains("gambling")

In this example a global data list called Banned search names will be checked to see if the list contains the value gambling. It will return true if it is on the list.

GetString(Text StringName)

  • AsString
  • Contains(Text Search, Boolean CaseSensitive)
  • IsEmpty()
  • Replace(Text Search, Text Replace)

Get the named global data string (textual) value.

Data.ListExists(Text ListName)

Returns true if the specified List already exists.

Data.ResetCounters(Text MatchName)

Will reset all counters that match a certain string.

Global data item names

After they are created global data items are identified throughout WinGate by their type (e.g. a string, a boolean, a list etc), and the name you give them. Global data items of the same type must each have a unique name. If you create a new global data item with the same name as an existing item of the same type, then the new item will replace the old one.

Every global data item created requires a name. This is the unique identifier for the value, and is used when referring to the global data item from either script or via the Symbol Browser.

  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"