Multi-valued Attribute to a Single-valued String
Novell Cool Solutions: Tip
By William C Schneider
Digg This -
Posted: 16 Jun 2005
Converting a Multi-valued Attribute to a Single-valued, Comma-delimited String
The purpose of this rule is to populate the physicalDeliveryOfficeName in Active Directory (which is single-valued) with the roomNumber attribute from eDirectory (which is multi-valued). In the Exchange Global Address list, this value appears as "Office." Rather than arbitrarily picking a single value, we will just concatenate all values into a single string, separated by commas. This could be used for any string attribute.
You need to create a new rule set on the subscriber event transform. All of the following rules will be contained in that rule set.
1. Create a rule that will set up the needed values.
Figure A: Setup rule
You must include both conditions here in order to ensure all changes are processed. You are building a local variable that is a nodeset of the roomNumber attribute.
2. In the second rule, concatenate the values together using a "for each" action.
Figure B: Concatenated values
3. Test to see if a value was created in the first rule.
4. Test to make sure this is not a "remove all values" event by checking to see if a value is still present in the source.
Figure C: Testing for a valid value
5. In the "for each" section, create a local variable called lvRoomNumber.
Figure D: Local variable created
6. Set that variable to itself, followed by a comma, a space, and a special value called "current-node". The current-node is the attribute value for the specific increment the loop is on.
Figure E: Setting the variable
7. Strip the operation attribute and then add it back in with the new value created in the local variable. When adding it back in, you must use the verb "replace first" and remove the leading comma and space in the string.
Figure F: Setting the operation attribute
8. Create the final rule in this rule set, to test whether this is a "remove all values" event. If so, the rule deletes the destination attribute.
Figure G: Testing for "remove all values"
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com