Toggling Boolean Attribute Values
Novell Cool Solutions: Tip
Digg This -
Posted: 17 Nov 2005
A reader asked the following question:
"I'm mapping Password Required in eDirectory to dirxml-uACPasswordNotRequired in AD. These attributes are logically opposite in the directories, so I have to negate the value coming from the source before setting it in the destination.
In examining the trace, it appears that the IDM engine performs a modification of a Boolean attribute with a <remove-value> followed by an <add-value>. Is this always the case?
Assuming that Boolean attributes are always modified with a remove/add combination, the best way that I've been able to find to 'toggle' the value of the Boolean attribute is with an XPATH expression that NOTs the value of the <add-value> node. Just to be safe, I remove all destination values before setting it to the toggled value.
Is there a simpler or better way to toggle these Boolean values?"
Here's the response from Forum expert Father Ramon, the Patron(izing) Saint of DirXML ...
Your best bet is probably to put the following rule in both the input and output transformations:
<rule> <description>toggle dirxml-uACPasswordNotRequired</description> <conditions/> <actions> <do-reformat-op-attr name="dirxml-uACPasswordNotRequired"> <arg-value type="state"> <token-xpath expression='string(string($current-value) = "false")'/> </arg-value> </do-reformat-op-attr> </actions> </rule>
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com