Selecting a Set of Objects

All ZOM services use a common mechanism for selecting objects on which to operate. This  mechanism consists of a series of one or more selection items that specify a set of objects to be processed by the service. This section provides an overview of object selection using a number of examples. Following sections contain detailed descriptions of all selection options that are possible.

Note: Keywording is described in Keywording Objects.

The following example contains a single selection criteria that indicates all objects of type EntitySet:

ZOMList +t Ent

The +t indicates selection by Type and Ent indicates only objects of type EntitySet are to be considered. In English, this example would literally read:

List the set of objects of type EntitySet.

The t in +t is the selection criteria; t meaning type. There are several different criteria you can use to select objects. In specifying the objects to process, each selection criteria you use must be prefixed with a set operator which is one of

+

plus sign, indicating a set union operation

-

minus sign, indicating a set minus operation

^

caret, indicating a set intersection operation

The first selection item establishes an initial set of objects and this set is further refined by any subsequent selections. The first selection item should always use a union operation (+) to establish an initial object set with which to work. This can seem overly mathematical, but the model of taking sets and operating on them becomes very useful as more complex selections are made.

For example, if you wanted to list the objects that are EntitySets as well as the objects that are Relationships, enter

ZOMList +t Ent +t Rel

This example selects the set of objects of type EntitySet and unions this set with the set of objects of type Relationship, then lists the objects in the resulting set.

Because both selections in the preceding example are by the same criteria (i.e., Type), you can express the selection in a simpler way:

ZOMList +t Ent, Rel

Here you have combined the two selection items "+t Ent" and "+t Rel" into a single selection by separating the two arguments by a comma (',').

Continuing with this example, if there was an object named "Customers" which you want to exclude from the listing, enter

ZOMList +t Ent, Rel -n Customers

The minus (-) operator causes the set operation "minus" to be applied. The selection criteria "n" means "name". The result of "-n Customers" is to remove objects with the name "Customers" from the set of objects selected so far. Since selection items are processed left to right, this example selects all objects of type EntitySet or Relationship, and then removes all objects named "Customers" from this set.

Alternately, you could select only those EntitySet or Relationship objects which also have been assigned the keyword "Sales_System":

ZOMList +t Ent, Rel ^k Sales_System

The caret (^) operator causes the set operation "intersection" to be applied. The selection criteria k means keyword. The result of "^k Sales_System" is to select only objects that have been assigned (by the user) the keyword "Sales_System" from the set of objects selected so far. Since selection items are processed left to right, this example selects all objects of type EntitySet or Relationship, and then selects all objects keyworded by "Sales_System" from this set.

Complex selections often cannot be done in a single ZOM command. If this occurs, use ZOM's keywording capability to first identify the objects on which to operate and then invoke the desired service using the keywords to select the desired objects. The next example uses keywording (and other techniques that have not been introduced yet) to select a particular set of objects. Although you might not be familiar with the specific syntax, this example gives you a flavor of how ZOM can handle arbitrarily complex object selections.

ZOMSet +n Cust* +itp ;k Used_By_Cust
 
ZOMSet +n Inv* +itp ;k Used_By_Inv
 
ZOMList +k Used_By_Cust ^k Used_By_Inv

This example has the effect of listing all objects that are used by objects whose names begin with "Cust" and are used by objects whose names begin with "Inv." (The first ZOMSet command assigns the keyword "Used_By_Cust" to all objects used by objects whose names begin with "Cust". The second ZOMSet command assigns the keyword "Used_By_Inv" to all objects used by objects whose names begin with "Inv". The ZOMSet service and the selection criteria and processing options used here are all explained in the following subsections.)

The power of the various selection criteria becomes much more potent in the context of these composite selections. However, there is a danger in this power. With ZOM, you can very easily select large numbers of objects for a ZOM service to process. Therefore, you should be very careful that only the desired objects are selected.

Until you become familiar with the use of these selection criteria, it is recommended you preview your selections by using the ZOMList service before using any ZOM service that performs update operations on the object involved.

The subsections below describe each of the various selection criteria available for selecting objects to be processed by a ZOM service.