none
Clear/delete attribute through Synchronization Rule

Answers

  • Can't wait any longer for elegant solution (if there is one :-), so ended up doing a traditional piece of MapAttributesForExport code -

     

     

                if (FlowRuleName.Equals("profilePath", StringComparison.InvariantCultureIgnoreCase))
                {
                    if (mventry["adOU"].IsPresent)
                    {
                        if (mventry["adOU"].StringValue.StartsWith("OU=W7Roaming", StringComparison.InvariantCultureIgnoreCase))
                            csentry["profilePath"].StringValue = string.Format(@"\\SERVERx\Profiles$\{0}\Roaming", mventry["accountName"].StringValue.ToUpper());
                        else
                            csentry["profilePath"].Delete();
                    }
                }
    

    This works like a charm - even combined with the rest of the attribute flow done through SR's; it just makes me sad that FIM SR's does hold this very needed feature. 


    Regards, Soren Granfeldt
    http://granfeldt.blogspot.com
    Thursday, September 22, 2011 7:19 PM

All replies

  • As Paul indicated in the end of that thread, when you specify the null in the second part of the IIF statement, it is interpreted as "do nothing".

    Are you intending the nullString to be the metaverse attribute value?  In the context of the sync rule, I believe the attribute might also have to be in the portal to be useable.  Are you flowing the nullString attribute out to the FIM Service/portal for the users as well as having it defined in the metaverse?

     

    Thursday, September 22, 2011 4:47 AM
  • Hi, Chris

    Thanks for your input; I've defined the attribute nullString in the metaverse and I'm not using the Null() function - I know that its two different things.

    It doesn't make sense to me that the attribute needs to be in the portal to be usable; what happens if you use traditional flow for some MA's - will you be unable to use those data from the MV? I'll give it a try through, but believe this more to be a bug (I'll have a peek into the FunctionLibrary.dll)

    More on this as I get further on in my tests.

     


    Regards, Soren Granfeldt
    http://granfeldt.blogspot.com
    Thursday, September 22, 2011 7:31 AM
  • @Chris,

    Just as I suspected it makes no different whether or not the nullString attribute is defined in the Portal - and it really doesn't make sense this SR is all about MV/Sync Service data.

    I had a peek into FunctionLibrary.dll and the IIF function seems to do exactly what I expect -

    public static object IIF(bool condition, object valueTrue, object valueFalse)
    {
        if (!condition)
        {
            return valueFalse;
        }
        return valueTrue;
    }
    

    So this is still puzzling me.

    Investigation continues - but since the customer is waiting, I may have to revert to traditional code to do an "real" Attr.Delete()


    Regards, Soren Granfeldt
    http://granfeldt.blogspot.com
    Thursday, September 22, 2011 8:10 AM
  • Can't wait any longer for elegant solution (if there is one :-), so ended up doing a traditional piece of MapAttributesForExport code -

     

     

                if (FlowRuleName.Equals("profilePath", StringComparison.InvariantCultureIgnoreCase))
                {
                    if (mventry["adOU"].IsPresent)
                    {
                        if (mventry["adOU"].StringValue.StartsWith("OU=W7Roaming", StringComparison.InvariantCultureIgnoreCase))
                            csentry["profilePath"].StringValue = string.Format(@"\\SERVERx\Profiles$\{0}\Roaming", mventry["accountName"].StringValue.ToUpper());
                        else
                            csentry["profilePath"].Delete();
                    }
                }
    

    This works like a charm - even combined with the rest of the attribute flow done through SR's; it just makes me sad that FIM SR's does hold this very needed feature. 


    Regards, Soren Granfeldt
    http://granfeldt.blogspot.com
    Thursday, September 22, 2011 7:19 PM
  • I can confirm this behavior. I also tried the nullString thingy in an IIF rule and nada. To me it still seems that a "flow null" function or "clear attribute" function would be a very nice thing to have.
    http://setspn.blogspot.com
    Friday, September 23, 2011 12:53 PM