scenario:
---------
i am working on a driver, which among other things is supposed to set a
driver-scoped variable with numeric values from a mapping table
according to group membership changes. i want to "count" if any group
membership changes occur for further processing (the value of the set
variables uniquely identifies which group a user was added to or removed
from). i stumbled over different behaviour in that the policy seemed to
process removals different from additions to groups, in that even no
addition was made, the match for the node-set ..xpath.../add-value
matched nodes. the trace shows that no match is found

Code:
--------------------

07:57:14 1ECC Drvrs: applicationx ST: token-xpath("./modify-attr[@attr-name="Group Membership"]/add-value/value/text()")
07:57:14 1ECC Drvrs: applicationx ST: Token Value: {}.
07:57:14 1ECC Drvrs: applicationx ST: Arg Value: {}.

--------------------


, but afterwards the processing continues with found
remove-value/value/text() - nodes (which is a mismatch).


i recognized that

Code:
--------------------

<modify>
<modify-attr>
<remove-value>
<value></value>
</remove-value>
</modify-attr>
</modify>

--------------------

had a different timestamp-attribute on the modify-element copared with
the add-value operation. 0#0


i added xml-attr (for the trace in designer still does not really
output more than the few last lines) to the policy for simulation in
designer and that showed that if the timestamp from
<modify><modify-attr><add-value>... was used in the
<modify><modify-attr><remove-value>... input document the result was as
expected (no more mismatch).

in short: what´s going on?

policy:
-------

Code:
--------------------

<description>calculate application groupmembership changes</description>
<!-- determine which groups the user is being added resp. removed from and write variables for xsl to add to the output-file -->
<conditions>
<and>
<if-class-name mode="nocase" op="equal">User</if-class-name>
<if-op-attr name="Group Membership" op="changing"/>
</and>
</conditions>
<actions>
<!-- Begin Test f. Simulation -->
<!-- initialize Counter as Integer -->
<do-set-local-variable name="var_Counter">
<arg-string>
<token-text>0</token-text>
<!-- <token-xpath expression="number(0)"/> -->
</arg-string>
</do-set-local-variable>
<!-- loop through all possible group modifications (multi-group allocation in one (single) operation) -->
<do-for-each>
<arg-node-set>
<token-xpath expression='./modify-attr[@attr-name="Group Membership"]/add-value/value/text()'/>
</arg-node-set>
<arg-actions>
<do-set-local-variable name="var_GroupCounter">
<arg-string>
<token-map dest="column_GroupCode" src="column_GroupName" table="\[root]\comp\ress\driversetx\applicationx\comp_sub_mappin gtable_tivgroups">
<token-parse-dn length="1" src-dn-format="src-dn" start="-1">
<token-local-variable name="current-node"/>
</token-parse-dn>
</token-map>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="var_Result_add" scope="driver">
<arg-string>
<token-xpath expression="$var_Counter + $var_GroupCounter"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="var_Counter">
<arg-string>
<token-xpath expression="number($var_Result_add)"/>
</arg-string>
</do-set-local-variable>
</arg-actions>
</do-for-each>
<do-trace-message color="brpurple" level="1">
<arg-string>
<token-text xml:space="preserve"> Rule: calculate application groupmembership changes </token-text>
</arg-string>
</do-trace-message>
<do-trace-message color="brpurple" level="1">
<arg-string>
<token-text xml:space="preserve"> SRC-DN: </token-text>
<token-src-dn/>
<token-text xml:space="preserve"> | TreiberName: </token-text>
<token-global-variable name="dirxml.auto.driverdn"/>
</arg-string>
</do-trace-message>
<do-trace-message color="brpurple" level="1">
<arg-string>
<token-text xml:space="preserve"> Details: User was added to applicationGruppen . 2 = applicationBasic, 4 = applicationFull, 8 = applicationNotes (</token-text>
<token-local-variable name="var_Result_add"/>
<token-text>) </token-text>
</arg-string>
</do-trace-message>
<do-set-xml-attr name="tivgroup_add" expression=".">
<arg-string>
<token-text>$var_Result_add$</token-text>
</arg-string>
</do-set-xml-attr>
<!-- reinitialize Counter as Integer -->
<do-set-local-variable name="var_Counter">
<arg-string>
<token-text>0</token-text>
<!-- <token-xpath expression="number(0)"/> -->
</arg-string>
</do-set-local-variable>
<do-for-each>
<arg-node-set>
<token-xpath expression='./modify-attr[@attr-name="Group Membership"]/remove-value/value/text()'/>
</arg-node-set>
<arg-actions>
<do-set-local-variable name="var_GroupCounter">
<arg-string>
<token-map dest="column_GroupCode" src="column_GroupName" table="\[root]\comp\ress\driversetx\applicationx\comp_sub_mappin gtable_tivgroups">
<token-parse-dn length="1" src-dn-format="src-dn" start="-1">
<token-local-variable name="current-node"/>
</token-parse-dn>
</token-map>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="var_Result_remove" scope="driver">
<arg-string>
<token-xpath expression="$var_Counter + $var_GroupCounter"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="var_Counter">
<arg-string>
<token-xpath expression="number($var_Result_remove)"/>
</arg-string>
</do-set-local-variable>
</arg-actions>
</do-for-each>
<do-trace-message color="brpurple" level="1">
<arg-string>
<token-text xml:space="preserve"> Rule: calculate application groupmembership changes</token-text>
</arg-string>
</do-trace-message>
<do-trace-message color="brpurple" level="1">
<arg-string>
<token-text xml:space="preserve"> SRC-DN: </token-text>
<token-src-dn/>
<token-text xml:space="preserve"> | TreiberName: </token-text>
<token-global-variable name="dirxml.auto.driverdn"/>
</arg-string>
</do-trace-message>
<do-trace-message color="brpurple" level="1">
<arg-string>
<token-text xml:space="preserve"> Details: User was added to User was removed from applicationGruppen. 2 = applicationBasic, 4 = applicationFull, 8 = applicationNotes (</token-text>
<token-local-variable name="var_Result_remove"/>
<token-text>) </token-text>
</arg-string>
</do-trace-message>
<do-set-xml-attr name="tivgroup_remove" expression=".">
<arg-string>
<token-text>$var_Result_remove$</token-text>
</arg-string>
</do-set-xml-attr>
<!-- End Test f. Simulation -->
</actions>
</rule>

--------------------


--
florianz
------------------------------------------------------------------------
florianz's Profile: http://forums.novell.com/member.php?userid=210
View this thread: http://forums.novell.com/showthread.php?t=406555