Open topic with navigation

TIBCO GridServer® 7.1.0

# 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.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO GridServer®

Copyright © 2001-2022. TIBCO Software Inc. All Rights Reserved.