CoreRMO::Keep Top Candidates
Removes all but the top n ranked candidates from a candidate set. Used by Microsoft. Provisioning Framework (MPF).
XML Input Schema
The following code fragment shows the format for sending data to this procedure. For more information on individual elements and attributes, see the Elements and Attributes table.
<executeData>1..1 <candidates>1..1 <targetSet>1..1</targetSet> <category>1..1</category> <count>1..1</count> </candidates> </executeData>XML Output Schema
Keep Top Candidates does not return data.
Elements and Attributes
The following table describes the XML elements and attributes. Unless otherwise indicated, the data type is string.
Element Description, relationships, and attributes candidates Description:
Encapsulates data needed to interact with a candidate set.Parent:
executeDataChildren:
category (minOccurs="1" maxOccurs="1")
count (minOccurs="1" maxOccurs="1")
targetSet (minOccurs="1" maxOccurs="1")category Description:
Category of the object to consider: resourceInstance, resourceGroup, consumerInstance, or consumerGroup.Parent:
candidatescount Description:
Maximum number of elements of the specified category that should remain in the candidate set.Parent:
candidatesexecuteData Description:
Encapsulates the procedure's input data.Child:
candidates (minOccurs="1" maxOccurs="1")targetSet Description:
Name of the candidate set to remove candidates from.Parent:
candidatesExample
<request> <data/> <procedure> <execute procedure="Find Resources" namespace="CoreRMO"> <executeData> <resourceInstance> <typeName>IISServer</typeName> </resourceInstance> <candidates> <targetSet>serverSet</targetSet> </candidates> </executeData> </execute> <execute procedure="Random Rank Candidates" namespace="CoreRMO"> <executeData> <candidates> <targetSet>serverSet</targetSet> <category>resourceInstance</category> </candidates> </executeData> </execute> <execute procedure="Keep Top Candidates" namespace="CoreRMO"> <executeData> <candidates> <targetSet>serverSet</targetSet> <category>resourceInstance</category> <count>1</count> </candidates> </executeData> </execute> </procedure> </request>Remarks
Once this function is executed, only ranked candidates will remain in the candidate set. A lower rank value means a high rank; in the example below, Printer-A has a higher rank than Printer-B. Unranked candidates will be removed even if the set then contains less than n elements.
If multiple candidates share the same rank, and the rank is on the boundary of being included or excluded, the function non-deterministically chooses which candidate to include in the set. The following example illustrates the dilemma.
Count = 4
targetSet Category Candidate Rank Printers resourceInstance Printer-A 1 Printer-B 2 Printer-C 3 Printer-D 4 Printer-E 4 Printer-F 5 Printer-G 6 Printer-H 7 Since Printers D and E both have rank 4, the function will choose one of the printers to keep. This choice may not be random.
See Also
Top of Page
) 1999-2002 Microsoft Corporation. All rights reserved.