Publishers can specify name/value
pairs that describe the package that is being published. Knowledge
of name/value pairs enables you to define filters for a subscriber
that determine the packages that are received. If an inclusion name/value
filter is defined for a subscriber, then the subscriber receives only
those packages that match the name/value filter.
To implement name/value
filters across your enterprise, the name/value pairs applied to packages
must agree with the name/value pairs that appear in subscriber filters.
Maintaining a global list of agreed-upon name/value pairs and including
definitions and usage information for each name/value pair enables
accurate package description and subscriber filtering in your enterprise.
The name/value filters
used in your enterprise depend on the types of packages that you publish
and on the types of subscribers that receive those packages. For example,
you could define a channel called Maintenance that includes e-mail
subscribers and an archive subscriber named MaintReports. You could
add a name/value filter to the subscriber definition for the MaintReports
archive subscriber that would refuse to accept packages that contain
a name/value pair of
noarchive
. For this
filter to be effective, packages published to the Maintenance channel
would need to include the
noarchive
name/value
pair in the appropriate way in order to keep unwanted packages out
of the MaintReports archive. A global list of name/value pairs would
help ensure that the filters and the packages both used the
noarchive
name/value pair appropriately.
A wide variety of syntax
options for name/value filters gives subscribers many filtering options,
including filtering based on logical relationships between multiple
name/value pairs.
A name/value pair is
expressed as either a name or a relationship between a name and a
value in the following form:
where
-
name is a variable to which a value can be assigned.
name is not case sensitive.
-
operator relates the variable to the value.
-
value is a character string or numeric value.
value is case sensitive.
The following table lists commonly used operators:
The following is an
example of a package description that uses name/value pairs that a
publisher has assigned to a published package:
market=(Mexico, US) type=report Quarter4 sales _priority_=low
Subscribers can write
meaningful filters if they know the conventions that a publisher uses
to describe packages. The following examples illustrate filter strings
that determine whether the preceding example entity would be selected
by the filter. If the package meets the filter conditions, then the
package is delivered to the subscriber.
market=(US, Asia, Europe)
No match. Because the
equals operator (=) is used, the subscriber values and the publisher
values that are assigned to the variable name MARKET must match exactly.
In this example, the subscriber filters for US, Asia, and Europe,
whereas the publisher assigns a value of Mexico and US. The conditions
for selection are not met. Therefore, the package is not delivered
to the subscriber.
No match. Because the
equals operator (=) is used, the subscriber values and the publisher
values that are assigned to the variable name MARKET must match exactly.
In this example, the subscriber values do not match the publisher
values because of case differences.
market=US | market=Asia | market=Mexico
No match. Because the
equals operator (=) is used, the subscriber values and the publisher
values that are assigned to the variable name MARKET must match exactly.
In this example, although the OR operator (|) might seem to cause
a matching condition, the equals operator (=) requires that each name/value
pair that is separated by an OR operator (|) match the publisher name/value
pair entirely. A match would result if the subscriber values were
written as follows: market=Mexico, US | market=Asia |
market=Mexico
The first name/value pair in the series
would match.
Match. Because the
equals operator (=) is used, the subscriber values and the publisher
values that are assigned to the variable name MARKET must match exactly.
In this example, the value set does match.
Match. Because the
equals operator (=) is used, the subscriber values and the publisher
values that are assigned to the variable name MARKET must match exactly.
In this example, the value set matches, regardless of the order of
values within the value set.
market?US & market?Asia & market?Mexico
No match. The conditions
that are specified in the subscriber name/value pair read: Variable
name MARKET must contain the values US and Asia and Mexico. The contains
comparison operator (?) identifies the eligible values for consideration.
In this example, although the publisher variable MARKET contains US
and Mexico, it does not also contain Asia. Because the logical AND
operator (&) is used, its condition is not satisfied.
market?US | market?Asia | market?Mexico
Match. The conditions
that are specified in the subscriber name/value pair read: Variable
name MARKET must contain the values US or Asia or Mexico. The contains
comparison operator (?) identifies the eligible values for consideration.
In this example, the publisher variable MARKET contains US, and the
logical OR operator (|) condition is satisfied.
No match. Because the
equals operator (=) is used, the subscriber values and the publisher
values that are assigned to the variable name QUARTER4 must match
exactly. In this example, because the publisher variable name QUARTER4
does not contain a value and the subscriber variable name QUARTER4
does contain a value of sales, the value sets do not match.
Match. Variable names
are not required to have values. In this example, because the publisher
variable name QUARTER4 does not have an assigned value and the subscriber
variable name QUARTER4 does not have an assigned value, the value
sets match.
No match. Two conditions
must be met. The equals operator (=) requires that the subscriber
values and the publisher values that are assigned to variable name
TYPE match. In this example, the first condition is met because both
the publisher and the subscriber assign the value report to variable
TYPE. However, the AND logical operator (&) requires that the
variable name TYPE also be assigned the value forecast. Because the
publisher variable name TYPE is not assigned a value of forecast,
the final condition is not met.
Match. Two conditions
must be met. The equals operator (=) requires that the subscriber
value and the publisher value that are assigned to variable name TYPE
match. In this example, the values match. Both assign the value report
to the variable name TYPE. The AND logical operator (&) also requires
that the variable name SALES match. Because both the publisher and
the subscriber identify a variable name sales with no assigned value,
the final condition is also met.