I wanted to use dirxml script instead of the traditional schema mapping
policy for one attribute (the attribute name is obtained from a GCV).

There are examples of this under the heading "Custom Schema Mapping
Policy: Example" in the docs
http://www.novell.com/documentation/...licytypes.html


I implemented this and in normal add/modify situations this seems to
work fine.

The problem is druing driver startup the attribute is not properly
renamed to the correct destination attribute as part of the init-params
operation that is sent to the driver shim.

On the engine side, the attr is called idvUserSatsID and should be
renamed to employeeNumber by DirXML Script policy in the schema mapping.
I can see from the trace that the do-rename-op-attr executes, but it
appears to do nothing.

The docs say do-rename-op-attr "Causes all elements that are children of
the current operation with the attr-name attribute equal to the name
specified by src-name to have attr-name set to dest-name."

The docs aren't clear if these elements must to be direct children of
the current operation or if they can be children at any level under the
current operation.

In the case of instance, query, modify, and add the attr-name is present
on a direct child of the current operation.

For init-params the element containing attr-name is not a direct child
of the operation.
|_init-params
| |driver-filter
| | |_allow-class
| | |_allow-attr

As I was unsure of exactly what the current operation contained at this
point in the driver startup, so I added a loop that traced out all
attr-name elements in the current operation immediately prior to the
do-rename-op-attr action.

level 3 trace of subscriber/filter init:

[11/22/11 15:29:13.052]:AD-TestLab ST:Initializing subscriber shim.
[11/22/11 15:29:13.055]:AD-TestLab ST:Reading XML attribute
vnd.nds.stream://IDV-TREE-T/IDV/Services/IDM/DriverSet1/AD-TestLab#DirXML-ShimConfigInfo.
[11/22/11 15:29:13.057]:AD-TestLab ST:Reading XML attribute
vnd.nds.stream://IDV-TREE-T/IDV/Services/IDM/DriverSet1/AD-TestLab#DirXML-DriverStorage.
[11/22/11 15:29:13.058]:AD-TestLab ST:Applying policy:
%+C%14CIAMTADDCFG-smp%-C.
[11/22/11 15:29:13.059]:AD-TestLab ST: Mapping attr-name 'Full Name' to
'displayName'.
[11/22/11 15:29:13.059]:AD-TestLab ST: Mapping attr-name 'Given Name'
to 'givenName'.
[11/22/11 15:29:13.059]:AD-TestLab ST: Mapping attr-name 'L' to
'physicalDeliveryOfficeName'.
[11/22/11 15:29:13.059]:AD-TestLab ST: Mapping attr-name 'Login
Disabled' to 'dirxml-uACAccountDisable'.
[11/22/11 15:29:13.060]:AD-TestLab ST: Mapping attr-name 'Surname' to 'sn'.
[11/22/11 15:29:13.060]:AD-TestLab ST: Mapping class-name 'User' to 'user'.
[11/22/11 15:29:13.060]:AD-TestLab ST:Applying policy:
%+C%14CIAMTADFEIDE-smp%-C.
[11/22/11 15:29:13.061]:AD-TestLab ST: Mapping attr-name 'O' to 'o'.
[11/22/11 15:29:13.061]:AD-TestLab ST: Mapping class-name 'user' to 'user'.
[11/22/11 15:29:13.061]:AD-TestLab ST:Applying policy:
%+C%14CIAMTADFEIDE-smp-MatchAttr%-C.
[11/22/11 15:29:13.061]:AD-TestLab ST: Applying to init-params #1.
[11/22/11 15:29:13.062]:AD-TestLab ST: Evaluating selection criteria
for rule 'Matching attribute (to dest)'.
[11/22/11 15:29:13.062]:AD-TestLab ST: (if-local-variable 'fromNds'
not-equal "false") = TRUE.
[11/22/11 15:29:13.062]:AD-TestLab ST: (if-global-variable
'iamt.user.matching.attr' match ".+") = TRUE.
[11/22/11 15:29:13.063]:AD-TestLab ST: Rule selected.
[11/22/11 15:29:13.063]:AD-TestLab ST: Applying rule 'Matching
attribute (to dest)'.
[11/22/11 15:29:13.063]:AD-TestLab ST: Action:
do-for-each(arg-node-set(token-xpath("self::*//@attr-name"))).
[11/22/11 15:29:13.064]:AD-TestLab ST:
arg-node-set(token-xpath("self::*//@attr-name"))
[11/22/11 15:29:13.064]:AD-TestLab ST:
token-xpath("self::*//@attr-name")
[11/22/11 15:29:13.064]:AD-TestLab ST: Token Value: {@attr-name
= "displayName",@attr-name = "givenName",@attr-name =
"idvUserSatsID",@attr-name = "physicalDeliveryOfficeName",@attr-name =
"dirxml-uACAccountDisable",@attr-name = "o",@attr-name = "sn"}.
[11/22/11 15:29:13.064]:AD-TestLab ST: Arg Value: {@attr-name =
"displayName",@attr-name = "givenName",@attr-name =
"idvUserSatsID",@attr-name = "physicalDeliveryOfficeName",@attr-name =
"dirxml-uACAccountDisable",@attr-name = "o",@attr-name = "sn"}.
[11/22/11 15:29:13.065]:AD-TestLab ST: Performing actions for
local-variable(current-node) = @attr-name = "displayName".
[11/22/11 15:29:13.066]:AD-TestLab ST: Action:
do-trace-message(token-local-variable("current-node")).
[11/22/11 15:29:13.066]:AD-TestLab ST:
arg-string(token-local-variable("current-node"))
[11/22/11 15:29:13.066]:AD-TestLab ST:
token-local-variable("current-node")
[11/22/11 15:29:13.067]:AD-TestLab ST: Token Value:
"displayName".
[11/22/11 15:29:13.067]:AD-TestLab ST: Arg Value:
"displayName".
[11/22/11 15:29:13.067]:AD-TestLab ST:displayName
[11/22/11 15:29:13.067]:AD-TestLab ST: Performing actions for
local-variable(current-node) = @attr-name = "givenName".
[11/22/11 15:29:13.068]:AD-TestLab ST: Action:
do-trace-message(token-local-variable("current-node")).
[11/22/11 15:29:13.068]:AD-TestLab ST:
arg-string(token-local-variable("current-node"))
[11/22/11 15:29:13.068]:AD-TestLab ST:
token-local-variable("current-node")
[11/22/11 15:29:13.069]:AD-TestLab ST: Token Value:
"givenName".
[11/22/11 15:29:13.069]:AD-TestLab ST: Arg Value: "givenName".
[11/22/11 15:29:13.069]:AD-TestLab ST:givenName
[11/22/11 15:29:13.069]:AD-TestLab ST: Performing actions for
local-variable(current-node) = @attr-name = "idvUserSatsID".
[11/22/11 15:29:13.070]:AD-TestLab ST: Action:
do-trace-message(token-local-variable("current-node")).
[11/22/11 15:29:13.070]:AD-TestLab ST:
arg-string(token-local-variable("current-node"))
[11/22/11 15:29:13.070]:AD-TestLab ST:
token-local-variable("current-node")
[11/22/11 15:29:13.071]:AD-TestLab ST: Token Value:
"idvUserSatsID".
[11/22/11 15:29:13.071]:AD-TestLab ST: Arg Value:
"idvUserSatsID".
[11/22/11 15:29:13.071]:AD-TestLab ST:idvUserSatsID
[11/22/11 15:29:13.071]:AD-TestLab ST: Performing actions for
local-variable(current-node) = @attr-name = "physicalDeliveryOfficeName".
[11/22/11 15:29:13.072]:AD-TestLab ST: Action:
do-trace-message(token-local-variable("current-node")).
[11/22/11 15:29:13.072]:AD-TestLab ST:
arg-string(token-local-variable("current-node"))
[11/22/11 15:29:13.073]:AD-TestLab ST:
token-local-variable("current-node")
[11/22/11 15:29:13.073]:AD-TestLab ST: Token Value:
"physicalDeliveryOfficeName".
[11/22/11 15:29:13.073]:AD-TestLab ST: Arg Value:
"physicalDeliveryOfficeName".
[11/22/11 15:29:13.073]:AD-TestLab SThysicalDeliveryOfficeName
[11/22/11 15:29:13.074]:AD-TestLab ST: Performing actions for
local-variable(current-node) = @attr-name = "dirxml-uACAccountDisable".
[11/22/11 15:29:13.074]:AD-TestLab ST: Action:
do-trace-message(token-local-variable("current-node")).
[11/22/11 15:29:13.075]:AD-TestLab ST:
arg-string(token-local-variable("current-node"))
[11/22/11 15:29:13.075]:AD-TestLab ST:
token-local-variable("current-node")
[11/22/11 15:29:13.075]:AD-TestLab ST: Token Value:
"dirxml-uACAccountDisable".
[11/22/11 15:29:13.075]:AD-TestLab ST: Arg Value:
"dirxml-uACAccountDisable".
[11/22/11 15:29:13.076]:AD-TestLab ST:dirxml-uACAccountDisable
[11/22/11 15:29:13.076]:AD-TestLab ST: Performing actions for
local-variable(current-node) = @attr-name = "o".
[11/22/11 15:29:13.076]:AD-TestLab ST: Action:
do-trace-message(token-local-variable("current-node")).
[11/22/11 15:29:13.077]:AD-TestLab ST:
arg-string(token-local-variable("current-node"))
[11/22/11 15:29:13.077]:AD-TestLab ST:
token-local-variable("current-node")
[11/22/11 15:29:13.078]:AD-TestLab ST: Token Value: "o".
[11/22/11 15:29:13.078]:AD-TestLab ST: Arg Value: "o".
[11/22/11 15:29:13.078]:AD-TestLab ST
[11/22/11 15:29:13.078]:AD-TestLab ST: Performing actions for
local-variable(current-node) = @attr-name = "sn".
[11/22/11 15:29:13.079]:AD-TestLab ST: Action:
do-trace-message(token-local-variable("current-node")).
[11/22/11 15:29:13.079]:AD-TestLab ST:
arg-string(token-local-variable("current-node"))
[11/22/11 15:29:13.079]:AD-TestLab ST:
token-local-variable("current-node")
[11/22/11 15:29:13.080]:AD-TestLab ST: Token Value: "sn".
[11/22/11 15:29:13.080]:AD-TestLab ST: Arg Value: "sn".
[11/22/11 15:29:13.080]:AD-TestLab ST:sn
[11/22/11 15:29:14.633]:AD-IKTValdres PT: Action:
do-rename-op-attr("idvUserSatsID","employeeNumber").
[11/22/11 15:29:14.633]:AD-IKTValdres PT: Action: do-break().
[11/22/11 15:29:14.634]:AD-IKTValdres PT:Policy returned:
[11/22/11 15:29:14.634]:AD-IKTValdres PT:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Standard" version="4.0.1.1">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<init-params
src-dn="\IDV-TREE-T\IDV\Services\IDM\DriverSet1\AD-IKTValdres">
<authentication-info>
<server>REMOTE(hostname=10.105.240.33 port=8090
)AD-TEST.test.local</server>
<user>test/ServiceAccount_IDM</user>
<password><!-- content suppressed --></password>
</authentication-info>
<driver-filter>
<allow-class class-name="user">
<allow-attr attr-name="sAMAccountName"/>
<allow-attr attr-name="userPrincipalName"/>
<allow-attr attr-name="displayName"/>
<allow-attr attr-name="givenName"/>
<allow-attr attr-name="idvUserSatsID"/>
<allow-attr attr-name="physicalDeliveryOfficeName"/>
<allow-attr attr-name="dirxml-uACAccountDisable"/>
<allow-attr attr-name="o"/>
<allow-attr attr-name="sn"/>
</allow-class>
</driver-filter>
<publisher-state>

<cookie>TVNEUwMAAAAI5Z0EGKnMAQAAAAAAAAAAKAAAACbDAQ AAAAAAAAAAAAAAAAAmwwEAAAAAAKBr2NI5hndEkVKOLFaW2yUB AAAAAAAAAAEAAAAAAAAAoGvY0jmGd0SRUo4sVpbbJSbDAQAAAA AA</cookie>
</publisher-state>
</init-params>
</input>
</nds>
[11/22/11 15:29:14.638]:AD-IKTValdres PT:Initializing publisher shim.
[11/22/11 15:29:14.638]:AD-IKTValdres PT:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Standard" version="4.0.1.1">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<init-params
src-dn="\IDV-TREE-T\IDV\Services\IDM\DriverSet1\AD-IKTValdres">
<authentication-info>
<server>REMOTE(hostname=10.105.240.33 port=8090
)AD-TEST.test.local</server>
<user>test/ServiceAccount_IDM</user>
<password><!-- content suppressed --></password>
</authentication-info>
<driver-filter>
<allow-class class-name="user">
<allow-attr attr-name="sAMAccountName"/>
<allow-attr attr-name="userPrincipalName"/>
<allow-attr attr-name="displayName"/>
<allow-attr attr-name="givenName"/>
<allow-attr attr-name="idvUserSatsID"/>
<allow-attr attr-name="physicalDeliveryOfficeName"/>
<allow-attr attr-name="dirxml-uACAccountDisable"/>
<allow-attr attr-name="o"/>
<allow-attr attr-name="sn"/>
</allow-class>
</driver-filter>
<publisher-state>

<cookie>TVNEUwMAAAAI5Z0EGKnMAQAAAAAAAAAAKAAAACbDAQ AAAAAAAAAAAAAAAAAmwwEAAAAAAKBr2NI5hndEkVKOLFaW2yUB AAAAAAAAAAEAAAAAAAAAoGvY0jmGd0SRUo4sVpbbJSbDAQAAAA AA</cookie>
</publisher-state>
</init-params>
</input>
</nds>
[11/22/11 15:29:14.642]:AD-IKTValdres PT:PublicationShim.init() returned:
[11/22/11 15:29:14.643]:AD-IKTValdres PT:
<nds dtdversion="4.0" ndsversion="8.x">
<output>
<status level="success"/>
</output>
</nds>

As you can see, there is an element which is a child of the current
operation that has an attr-name attribute equal to the name specified by
src-name - so I cannot see why do-rename-op-attr should not run in this
situation.

Is this a bug, or a feature? Any suggestions on a workaround?