Create a set programmatically
In answering a recent question, I provided an example of how to create a set programmatically. Creating a set is no different than creating a group or person with one caveat. A set requires a display name and a filter. The display name is a simple string as expected, but the filter is a string that must contain a WS-Enumeration filter element. Looking at schema alone you – and I – would assume to simply provide the XPath filter in the attribute value. Instead you must wrap the XPath filter in the XML WS-Enumeration filter element.
Here is a working example from Release Candidate of ILM “2’ and the public client:
ResourceManagementObject rmObject = new ResourceManagementObject("Set");
rmObject["DisplayName"] = new ResourceManagementAttribute("DisplayName", "CreatedSet");
String newGroupId = transferClient.Create(rmObject);
Hope that helps!
Comment Notification
If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using
I am a Program Manager working at Microsoft Corporation in Redmond, WA.