Discriminators

Discriminators allow Service requests to be performed only on Engines that meet the discriminator’s requirements. To construct a discriminator, use the COM types PropertyDiscriminator and PropertyComparator. A PropertyDiscriminator is a collection of PropertyComparators, each of which expresses one requirement on Engines that must evaluate to true in order for the engine to qualify. See the COMDriver API reference for a full list of comparators and machine properties; it is located at [COMDriver installation]/docs/COMDriver/DSCOMDriverRef.doc.

The following Visual Basic code creates a new PropertyDiscriminator, which limits operation to machines with more than 200MB of free disk space, and the custom property foo equal to the value bar. It then submits a request to the add function with the PropertyDiscriminator.

Dim discrim As New PropertyDiscriminator
Dim pc As New PropertyComparator
pc.Init FREE_DISK_MB, "200", GREATER_THAN_EQ, False
discrim.Add pc
pc.Init "foo", "bar", EQUALS, False
discrim.Add pc
Dim args(1) As String
args(0) = "25"
args(1) = "75"
ID2 = service.submitWithArray("add", args, discrim)

The Init function of PropertyComparator initializes the comparator as comparison with a predefined Engine property, and takes four arguments:

name — A string representing the name of the Engine property.
value — A string representing the value of the Engine property.
op — The comparison method, from the enumeration DSComparatorType.
nullCompare — The result of the comparison when the value of the property is not defined on the Engine.

For more information about initializing PropertyComparator, see the COMDriver API reference ([COMDriver install dir]\docs). For more information about custom properties for Engines, refer to the “Using Conditions” topic of the TIBCO GridServer® Developer’s Guide.