I am trying to read a structured attribute from GroupWise and extract
one of the component values, boxSizeLimit,
and then store this value on the User record in an attribute that I
created in eDirectory by extending the schema.
I can see the data I want in the trace but I can't get the component
value assigned to the local variable.
I'm suspecting that I have to manipulate the data coming back from the
query to get it into a string format since I can't define
the local variable as a structured attribute type.

Here is the rule from my Command Transformation Policy.
<rule>
<description>Read the mailbox limit from GroupWise</description>
<conditions>
<and/>
</conditions>
<actions>
<do-set-local-variable name="GW-DISCARD" scope="policy">
<arg-node-set>
<token-dest-attr class-name="User" name="DiscardSettings"/>
</arg-node-set>
</do-set-local-variable>
<do-if>
<arg-conditions>
<and>
<if-xpath
op="true">$GW-DISCARD/attr[@attr-name="DiscardSettings"]/value/component[@name='field']/text()='boxSizeLimit'</if-xpath>
</and>
</arg-conditions>
<arg-actions>
<do-set-local-variable name="GW-DISCARD-MBSIZE" scope="policy">
<arg-string>
<token-xpath
expression="$GW-DISCARD/attr[@attr-name=&quot;DiscardSettings&quot;]/value/component[@name=&apos;value&apos;]/text()"/>
</arg-string>
</do-set-local-variable>
</arg-actions>
<arg-actions/>
</do-if>
</actions>
</rule>

Here is the section of the level 3 trace where the rule is executed.

[11/09/12 12:05:03.037]:GW ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.0.1.0">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<modify cached-time="20121109180502.691Z" class-name="User"
event-id="vcedirtest1#20121109180502#2#1:4d2036e8-b1c1-4fa2-1daa-e836204dc1b1"
qualified-src-dn="O=CHC\OU=MPS\CN=CE001741"
src-dn="\PSOFT-FP\CHC\MPS\CE001741" src-entry-id="38579"
timestamp="1352484302#2">
<association
state="associated">mps-dom.mps-po.CE001741{106}FB8E5901-17F0-0000-83DF-F6DE532A26F4</association>
<modify-attr attr-name="Description">
<remove-value>
<value timestamp="1350670581#2" type="string">Applix 46783 -
moved to MPS 11/11/99 JQ
Perinatal Services,
Requested 12/17/98..</value>
</remove-value>
<add-value>
<value timestamp="1352484302#2" type="string">Applix 46783 -
moved to MPS 11/11/99 JQ
Perinatal Services,
Requested 12/17/98.DRP.</value>
</add-value>
</modify-attr>
</modify>
</input>
</nds>
[11/09/12 12:05:03.051]:GW ST:Applying policy:
%+C%14CCHC-GW-MailBoxSizeLimits-sub-ctp%-C.
[11/09/12 12:05:03.052]:GW ST: Applying to modify #1.
[11/09/12 12:05:03.052]:GW ST: Evaluating selection criteria for rule
'Process only Users'.
[11/09/12 12:05:03.054]:GW ST: (if-class-name not-equal "User") =
FALSE.
[11/09/12 12:05:03.055]:GW ST: Rule rejected.
[11/09/12 12:05:03.055]:GW ST: Evaluating selection criteria for rule
'Process only Modifies'.
[11/09/12 12:05:03.056]:GW ST: (if-operation not-equal "modify") =
FALSE.
[11/09/12 12:05:03.057]:GW ST: Rule rejected.
[11/09/12 12:05:03.058]:GW ST: Evaluating selection criteria for rule
'Read the mailbox limit from GroupWise'.
[11/09/12 12:05:03.059]:GW ST: Rule selected.
[11/09/12 12:05:03.060]:GW ST: Applying rule 'Read the mailbox limit
from GroupWise'.
[11/09/12 12:05:03.061]:GW ST: Action:
do-set-local-variable("GW-DISCARD",scope="policy",arg-node-set(token-dest-attr("DiscardSettings",class-name="User"))).
[11/09/12 12:05:03.063]:GW ST:
arg-node-set(token-dest-attr("DiscardSettings",class-name="User"))
[11/09/12 12:05:03.064]:GW ST:
token-dest-attr("DiscardSettings",class-name="User")
[11/09/12 12:05:03.066]:GW ST: Query from policy
[11/09/12 12:05:03.066]:GW ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.0.1.0">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<query class-name="User" scope="entry">

<association>mps-dom.mps-po.CE001741{106}FB8E5901-17F0-0000-83DF-F6DE532A26F4</association>
<read-attr attr-name="DiscardSettings"/>
</query>
</input>
</nds>

.................................................. ...........
Here is the document being returned from GroupWise
.................................................. ...........

[11/09/12 12:05:03.618]:GW ST: Resolving association
references.
[11/09/12 12:05:03.619]:GW ST: Query from policy result
[11/09/12 12:05:03.620]:GW ST:
<nds dtdversion="2.0" ndsversion="8.x">
<source>
<product build="20090305_0422" instance="GroupWise Driver"
version="3.5.3 (linux)">DirXML Driver for GroupWise</product>
<contact>Novell, Inc.</contact>
</source>
<output>
<instance class-name="User" event-id="0"
src-dn="mps-dom.mps-po.CE001741">

<association>mps-dom.mps-po.CE001741{106}FB8E5901-17F0-0000-83DF-F6DE532A26F4</association>
<attr attr-name="DiscardSettings">
<value type="structured">
<component name="lock-level">7</component>
<component name="value">ManualDeleteArchive</component>
<component name="field">mailDelete</component>
</value>
<value type="structured">
<component name="value">30</component>
<component name="field">mailDays</component>
</value>
<value type="structured">
<component name="lock-level">7</component>
<component name="value">ManualDeleteArchive</component>
<component name="field">appointmentDelete</component>
</value>
<value type="structured">
<component name="value">14</component>
<component name="field">appointmentDays</component>
</value>
<value type="structured">
<component name="lock-level">7</component>
<component name="value">AutoPurgeAfterTrashDays</component>
<component name="field">trashPurge</component>
</value>
<value type="structured">
<component name="value">7</component>
<component name="field">trashDays</component>
</value>
<value type="structured">
<component name="lock-level">2</component>
<component name="value">1</component>
<component name="field">userLimitSet</component>
</value>
<value type="structured">
<component name="value">512</component>
<component name="field">boxSizeLimit</component>
</value>
<value type="structured">
<component name="value">95</component>
<component name="field">boxThresholdLimit</component>
</value>
<value type="structured">
<component name="value">51200000</component>
<component name="field">messageSendLimit</component>
</value>
<value type="structured">
<component name="lock-level">0</component>
<component name="value">0</component>
<component name="field">boxLimitAppliesToCache</component>
</value>
<value type="structured">
<component name="lock-level">0</component>
<component name="value">0</component>
<component
name="field">enableBoxThresholdNotification</component>
</value>
<value type="structured">
<component name="lock-level">0</component>
<component name="value">0</component>
<component name="field">enableBoxSizeNotification</component>
</value>
</attr>
</instance>
<status event-id="0" level="success"/>
</output>
</nds>
[11/09/12 12:05:03.659]:GW ST: Token Value: {<value> @type =
"structured",<value> @type = "structured",<value> @type =
"structured",<value> @type = "structured",<value> @type =
"structured",<value> @type = "structured",<value> @type =
"structured",<value> @type = "structured",<value> @type =
"structured",<value> @type = "structured",<value> @type =
"structured",<value> @type = "structured",<value> @type =
"structured"}.
[11/09/12 12:05:03.665]:GW ST: Arg Value: {<value> @type =
"structured",<value> @type = "structured",<value> @type =
"structured",<value> @type = "structured",<value> @type =
"structured",<value> @type = "structured",<value> @type =
"structured",<value> @type = "structured",<value> @type =
"structured",<value> @type = "structured",<value> @type =
"structured",<value> @type = "structured",<value> @type =
"structured"}.
[11/09/12 12:05:03.671]:GW ST: Action: do-if().
[11/09/12 12:05:03.672]:GW ST: Evaluating conditions.
[11/09/12 12:05:03.673]:GW ST: (if-xpath true
"$GW-DISCARD/attr[@attr-name="DiscardSettings"]/value/component[@name='field']/text()='boxSizeLimit'")
= FALSE.
[11/09/12 12:05:03.675]:GW ST: Performing else actions.
[11/09/12 12:05:03.675]:GW ST: Evaluating selection criteria for rule
'Mailbox Size Entitlement:set maximum mailbox size'.
[11/09/12 12:05:03.677]:GW ST: (if-entitlement 'gwDiskLimit'
changing) = FALSE.
[11/09/12 12:05:03.678]:GW ST: Rule rejected.
[11/09/12 12:05:03.679]:GW ST:Policy returned:
[11/09/12 12:05:03.679]:GW ST:


--
puot7808
------------------------------------------------------------------------
puot7808's Profile: https://forums.netiq.com/member.php?userid=393
View this thread: https://forums.netiq.com/showthread.php?t=46127