Setting Extended Attributes on Request resource

Feb 27, 2012 at 8:15 PM

A client wants to extended their Request object to hold a "Reason for Request" string attribute. 

This string will be available to the Owners to help determine if the Request should be approved or not.

I need a way to add multiple Requests for a Person resource to multiple Group resources, along with the text of the "Reason for Request".

The ReasonForRequest would not be a static string, but entered by the Requestor from the UI...

Code stub:


using (Microsoft.ResourceManagement.Client.DefaultClient client = 
		new DefaultClient(CredentialCache.DefaultNetworkCredentials))
    foreach (string groupID in requests)
        foreach (RmResource rmResource in client.Enumerate("/Group[ObjectID='" + groupID + "']"))
            RmGroup rmGroup = rmResource as RmGroup;
            if (rmGroup != null)
                using (RmResourceChanges transaction = new RmResourceChanges(rmGroup))
                        // ToDo:
			// Modify the request message of the Put method:
			//   PutRequest resourceEPrequest = this.requestFactory.CreatePutRequest(transaction);
			//   RmAttributeName requestAttrName = new RmAttributeName("ReasonForRequest");
			//   RmAttributeValue requestAttrValue = new RmAttributeValue(false);
			//   requestAttrValue.Value = "because I said so...";
			//   resourceEPrequest.Attributes.Add(requestAttrName, requestAttrValue);
			//   this.wsTransferClient.Put(resourceEPrequest, out response);
			//   return true;
		        // Current:

I'm not sure if the WsTransfer schema request validation would even allow an additional attribute.  Has anyone else ever modified a request message?




Mar 2, 2012 at 2:01 PM

Since you asked the same question on the forum, I propose that we continue this discussion there, as others might be able to help: