Quantcast
Channel: Microsoft Identity Manager forum
Viewing all articles
Browse latest Browse all 7443

RequestParameter update

$
0
0

In the example below I want to remove RequestParameter that contains the modification of the attribute called ModificationDate. I want to do this in a custom workflow activity. ModificationDate is a custom attribute on the Group resource.

RequestType currentRequest = this.ReadCurrentRequestActivity_CurrentRequest;
DateTime modificationDate = getModificationDate(currentRequest);

UpdateRequestParameter paramRequestParameters = new UpdateRequestParameter();
 paramRequestParameters.PropertyName = "RequestParameter";
 paramRequestParameters.Mode = UpdateMode.Remove;
 string s = "";
 s += "<RequestParameter xmlns:q1=\"http://microsoft.com/wsdl/types/\" ";
 s += "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
 s += "xsi:type=\"UpdateRequestParameter\"><Target>";
 s += currentRequest.Target.GetGuid().ToString();  // e.g. "0f8d8335-916f-4574-b6e4-286b879498a7"
 s += "</Target>";
 s += "<Calculated>false</Calculated><PropertyName>ModificationDate</PropertyName>";
 s += "<Value xsi:type=\"xsd:dateTime\">";
 s += modificationDate.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss");  // e.g. "2013-06-03T08:16:00";
 s += "</Value><Operation>Create</Operation>";
 s += "<Mode>Modify</Mode></RequestParameter>";
 paramRequestParameters.Value = s;

UpdateRequest.UpdateParameters = new UpdateRequestParameter[1];
 UpdateRequest.UpdateParameters[0] = paramRequestParameters;

...

private DateTime getModificationDate(RequestType currentRequest)
 {
     // Read ModificationDate from the request parameters
     ReadOnlyCollection<UpdateRequestParameter> requestParameters = currentRequest.ParseParameters<UpdateRequestParameter>();
     DateTime modificationDate = DateTime.MinValue;
     foreach (UpdateRequestParameter requestParameter in requestParameters)
     {
         if (requestParameter.PropertyName == "ModificationDate")
         {
             if (requestParameter.Value != null)
             {
                 modificationDate = ((DateTime)requestParameter.Value).ToLocalTime();
             }
         }
     }
     return modificationDate;
 }

This works and the Request resource seems to be updated correctly. In the request details I see that the request parameter ModificationDate is not available. Only parameter left is the change of the descriptipon attribute, which was done in this particular example.

The problem is, that after the request is processed, the ModificationDate is set on the Group resource.

Again, the request object does not contain ModificationDate in the RequestParameters. It seems that the RequestParameters cannot be changed, i.e. they are changed on the UI, but FIM request pipeline does not "see" this chenge. The strange thing is that I can update the RequestStatusDetail attribute of the request resource in the same way (as described inhttp://www.wapshere.com/missmiis/updating-requeststatusdetail).

The question is:
Is it possible to update RequestParameter attribute of the Request resource in a custom workflow activity?

Thanks in advance for your answers.

Milos




Viewing all articles
Browse latest Browse all 7443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>