Quantcast
Channel: Forum Microsoft Identity Manager
Viewing all articles
Browse latest Browse all 6944

Custom Workflow - How to get requested changes to a multivalue attribute

$
0
0

I'm trying to create a custom workflow that updates groupmemberships in AD (this particular case can't be done via SyncRules, long story^^). For that I've created a new user attribute (in the portal) "memberOf".

Now I want to create an AuthZ-Workflow that gets triggered when this attribute is modified. That all works well. My problem is how to figure out which values were added and which were removed to the multi-value attribute.

I've tried this:

var requestParameters = ReadCurrentRequestActivity_CurrentRequest.ParseParameters<UpdateRequestParameter>();
using (TextWriter writer = File.CreateText(newValueFilePath))
{
    foreach (UpdateRequestParameter requestParameter in requestParameters)
    {
        writer.Write(requestParameter.PropertyName + ":");
        writer.WriteLine("Type: " + requestParameter.Operation);
        writer.WriteLine();
        writer.Write(requestParameter.Value);
        writer.WriteLine();
        writer.WriteLine();
    }
}

This correctly gives me all the values that were added and removed. I was assuming the "Operation" property would tell me if the value was added or remove. But it always is "Create".

So is there another "easy" way to figure this out? Two more complicated possibilities come to mind:

- using a "ReadResourceActivity" to get the old value and then "manually" compute the changes

- creating two different activity workflows, one for adding and one for removing; then I could create two seperate MPRs for the two cases

They would probably work, but I think there has to be a "better" way.

Thx


Viewing all articles
Browse latest Browse all 6944

Trending Articles