Adding Custom Properties

Top  Previous  Next

Every Device has a number of standard properties that control communications with hardware and server-side data processing, such as Synchronization Period or Use Extended Status. However, it may be necessary to associate some non-standard information with a Device. For example, IT infrastructure management tasks require a way to easily find out current physical location of a Device, i.e. building, floor and room number. AggreGate permits to add any custom data to any Device account or system resource using Common Data facility. This tutorial illustrates how to add Device Location info to every device within a certain AggreGate installation using AggreGate Client.

1. Creating a Common Table

First, we need to create a Common Table that will describe the format of our custom properties. A copy of this table will later be added to every Device account.

Double-click the Global Common Data node (st_commondata) to start table creation. Enter table properties as follows:

Table Name: location
Table Description: Device Location
Minimal number of records: 1 (because we are adding a non-tabular property)
Maximal number of records: 1

ht_custom_properties_1

Click OK to add create new common table. It will appear in the System Tree:

ht_custom_properties_2

2. Adding Location Fields to Common Table

If table configuration dialog did not pop up automatically after table creation, right-click on the newly created table and select Configure Common Table (cm_properties). Switch to Fields tab to start adding table fields.

Click on Add Row (dte_add_row) and enter field properties:

Name: building
Type: String
Description: Building
Extendable Selection Values: Yes

Click on Selection Values and enter several buildings. Here is an example:

ht_custom_properties_7

Leave other values at their defaults and add two other fields:

Name: floor
Type: String
Description: Floor

and

Name: room
Type: String
Description: Room

Here is what Fields table should look like:

ht_custom_properties_3

3. Assigning Device Location Table as a Custom Property

Now it's time to tell AggreGate Server that our new table is a Device's custom property. Switch to the Custom Properties tab and check Use common table as custom property.

At this point Validity Expression field will become editable. It specifies what contexts to associate our table with. Click on [...] button inside Validity Expression field to open Expression Builder.

4. Writing Validity Expression

In our case, the validity expression should resolve to TRUE for any Device context and to FALSE for all other contexts. Device Context article in the Context Reference states that context type for Device contexts has the following form:

 device.DEVICE_TYPE

It means that any context type starting with "device" matches the device context. Select startsWith function from a Functions drop-down list to insert it into the expression:

ht_custom_properties_4

According to the description of this function, it has two String parameters and returns TRUE if first string starts with a second ("prefix") string. Click inside function parameters and double-click Context Type in the Relative References area to add context type as a first parameter. Then manually add "device" string literal as a second parameter:

ht_custom_properties_5

Click OK twice to apply changes to Validity Expression and Common Table configuration. Now every Device in the system has its own Location property.

5. Editing Device Location

To access Device Location property of a certain Device, right-click on it and select Edit Custom Properties.

ht_custom_properties_6

Now you can fill in the Device Location tab:

ht_custom_properties_8