Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
mdadik Absent Member.
Absent Member.
607 views

retreive a SAP specfic value from nodeset table subtype

Hello,

I create a variable that retreives all parameter values from PARAMETER SAP table :
<do-set-local-variable name="lvSAPSiteCodeAll" scope="policy">
<arg-node-set>
<token-dest-attr name="sapParameters"/>
</arg-node-set>
</do-set-local-variable>

I have the following result into this variable :
<output>
<instance class-name="User" event-id="0" src-dn="\RCR410\986543">
<association>\\RCR410\986543</association>
<attr attr-name="sapParameters">
<value subtype="table" type="structured">
<component name="PARTXT">Personnel Country Grouping</component>
<component name="PARID">MOL</component>
<component name="PARVA">06</component>
</value>
<value subtype="table" type="structured">
<component name="PARTXT">Upper and lower case in source code: 'X' = lower, ' ' =upper</component>
<component name="PARID">SCL</component>
<component name="PARVA">X</component>
</value>
<value subtype="table" type="structured">
<component name="PARTXT">Plant</component>
<component name="PARID">WRK</component>
<component name="PARVA">F410</component>
</value>
</attr>
</instance>
<status event-id="0" level="success" type="driver-general">
<description>Subscriber Query Successful.</description>
</status>
</output>

I have all rows from my parameter table but I only want a specific value from the last record : put in a variable the PARVA value (F410) where the PARID is WRK.


Can you please help me in using xpath to do that ?
Many thanks in advance.
Labels (1)
0 Likes
13 Replies
Knowledge Partner
Knowledge Partner

Re: retreive a SAP specfic value from nodeset table subtype

On 7/24/2018 10:14 AM, mdadik wrote:
>
> Hello,
>
> I create a variable that retreives all parameter values from PARAMETER
> SAP table :
> <do-set-local-variable name="lvSAPSiteCodeAll" scope="policy">
> <arg-node-set>
> <token-dest-attr name="sapParameters"/>
> </arg-node-set>
> </do-set-local-variable>



Ok, because you used Dest Attriubute, your $lvSAPSiteCodeAll in XPATH is
a nodeset with three nodes, all value nodes.

It is possible you could do this one XPATH, but I find it simpler, to
loop to select the right one.

For Each lvSAPSiteCodeAll should loop over the value nodes.

if XPATH true $current-node/component[@name='PARID']/text()='WRK'
Then set local variable with XPATH of:
$current-node/component[@name='PARVA']

The XPATH to select it gets messy and hard to adjust, but the loop is
simpler, so long as you are not getting back stupid large tables of
values, in which case XPATH is way more efficient.

I am too lazy to work out the XPATH, but if you look at my article on
doing Map tokens via XPATH it is the same basic approach.

http://www.novell.com/communities/node/12261/using-xpath-reproduce-map-token


> I have the following result into this variable :
> <output>
> <instance class-name="User" event-id="0" src-dn="\RCR410\986543">
> <association>\\RCR410\986543</association>
> <attr attr-name="sapParameters">
> <value subtype="table" type="structured">
> <component name="PARTXT">Personnel Country
> Grouping</component>
> <component name="PARID">MOL</component>
> <component name="PARVA">06</component>
> </value>
> <value subtype="table" type="structured">
> <component name="PARTXT">Upper and lower case in source code:
> 'X' = lower, ' ' =upper</component>
> <component name="PARID">SCL</component>
> <component name="PARVA">X</component>
> </value>
> <value subtype="table" type="structured">
> <component name="PARTXT">Plant</component>
> <component name="PARID">WRK</component>
> <component name="PARVA">F410</component>
> </value>
> </attr>
> </instance>
> <status event-id="0" level="success" type="driver-general">
> <description>Subscriber Query Successful.</description>
> </status>
> </output>
>
> I have all rows from my parameter table but I only want a specific value
> from the last record : put in a variable the PARVA value (F410) where
> the PARID is WRK.
>
>
> Can you please help me in using xpath to do that ?
> Many thanks in advance.
>
>


0 Likes
Knowledge Partner
Knowledge Partner

Re: retreive a SAP specfic value from nodeset table subtype

attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()

or something like that. You'll have to play with the context to get it right.
0 Likes
mdadik Absent Member.
Absent Member.

Re: retreive a SAP specfic value from nodeset table subtype

Ok, thanks but where do I have to put that piece of code ?
0 Likes
Knowledge Partner
Knowledge Partner

Re: retreive a SAP specfic value from nodeset table subtype

mdadik;2484624 wrote:
Ok, thanks but where do I have to put that piece of code ?


Something like this:


<do-set-local-variable name="parva-value" scope="policy">
<arg-string>
<token-xpath expression='$instance-node-set-variable-goes-here/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()'/>
</arg-string>
</do-set-local-variable>


assuming you want this in a local variable.
0 Likes
mdadik Absent Member.
Absent Member.

Re: retreive a SAP specfic value from nodeset table subtype

Thanks again, what is strange is when executing the code, the requested value from the nodeset is not retreived, bellow, my code section :

<do-set-local-variable name="lvSAPSiteCodeAll" scope="policy">
<arg-node-set>
<token-dest-attr name="sapParameters"/>
</arg-node-set>
</do-set-local-variable>
<do-set-local-variable name="parva-value" scope="policy">
<arg-string>
<token-xpath expression='$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()'/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable disabled="true" name="lvPARVA" scope="policy">
<arg-string>
<token-xpath expression='attr/value/component[text()="WRK"]/following-sibling::attr/value/component[@name="PARVA"]/text()'/>
</arg-string>
</do-set-local-variable>

Bellow the output in log file :

<output>
<instance class-name="User" event-id="0" src-dn="\MAND540\76543">
<association>\MAND540\USd76543</association>
<attr attr-name="sapParameters">
<value subtype="table" type="structured">
<component name="PARTXT">Personnel Country Grouping</component>
<component name="PARID">MOL</component>
<component name="PARVA">06</component>
</value>
<value subtype="table" type="structured">
<component name="PARTXT">Upper and lower case in source code: 'X' = lower, ' ' =upper</component>
<component name="PARID">SCL</component>
<component name="PARVA">X</component>
</value>
<value subtype="table" type="structured">
<component name="PARTXT">Plant</component>
<component name="PARID">WRK</component>
<component name="PARVA">F217</component>
</value>
</attr>
</instance>
<status event-id="0" level="success" type="driver-general">
<description>Subscriber Query Successful.</description>
</status>
</output>
</nds>
[07/24/18 22:13:55.936]:SAP User Management Driver APR ST: Token Value: {<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured"}.
[07/24/18 22:13:55.936]:SAP User Management Driver APR ST: Arg Value: {<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured"}.
[07/24/18 22:13:55.936]:SAP User Management Driver APR ST: Action: do-set-local-variable("parva-value",scope="policy",token-xpath("$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()")).
[07/24/18 22:13:55.937]:SAP User Management Driver APR ST: arg-string(token-xpath("$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()"))
[07/24/18 22:13:55.937]:SAP User Management Driver APR ST: token-xpath("$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()")
[07/24/18 22:13:55.937]:SAP User Management Driver APR ST: Token Value: "".
[07/24/18 22:13:55.938]:SAP User Management Driver APR ST: Arg Value: "".


When using a xpath simulator (http://xmltoolbox.appspot.com/xpathevaluator.html) with bellow xml field and xpath attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()
it gets as result the F217 value.
What can be wrong in my code ??

<attr attr-name="sapParameters">
<value subtype="table" type="structured">
<component name="PARTXT">Personnel Country Grouping</component>
<component name="PARID">MOL</component>
<component name="PARVA">06</component>
</value>
<value subtype="table" type="structured">
<component name="PARTXT">Upper and lower case in source code: 'X' = lower, ' ' =upper</component>
<component name="PARID">SCL</component>
<component name="PARVA">X</component>
</value>
<value subtype="table" type="structured">
<component name="PARTXT">Plant</component>
<component name="PARID">WRK</component>
<component name="PARVA">F217</component>
</value>
</attr>
0 Likes
Knowledge Partner
Knowledge Partner

Re: retreive a SAP specfic value from nodeset table subtype

mdadik;2484629 wrote:
Thanks again, what is strange is when executing the code, the requested value from the nodeset is not retreived, bellow, my code section :

<do-set-local-variable name="lvSAPSiteCodeAll" scope="policy">
<arg-node-set>
<token-dest-attr name="sapParameters"/>
</arg-node-set>
</do-set-local-variable>
<do-set-local-variable name="parva-value" scope="policy">
<arg-string>
<token-xpath expression='$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()'/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable disabled="true" name="lvPARVA" scope="policy">
<arg-string>
<token-xpath expression='attr/value/component[text()="WRK"]/following-sibling::attr/value/component[@name="PARVA"]/text()'/>
</arg-string>
</do-set-local-variable>

Bellow the output in log file :

<output>
<instance class-name="User" event-id="0" src-dn="\MAND540\76543">
<association>\MAND540\USd76543</association>
<attr attr-name="sapParameters">
<value subtype="table" type="structured">
<component name="PARTXT">Personnel Country Grouping</component>
<component name="PARID">MOL</component>
<component name="PARVA">06</component>
</value>
<value subtype="table" type="structured">
<component name="PARTXT">Upper and lower case in source code: 'X' = lower, ' ' =upper</component>
<component name="PARID">SCL</component>
<component name="PARVA">X</component>
</value>
<value subtype="table" type="structured">
<component name="PARTXT">Plant</component>
<component name="PARID">WRK</component>
<component name="PARVA">F217</component>
</value>
</attr>
</instance>
<status event-id="0" level="success" type="driver-general">
<description>Subscriber Query Successful.</description>
</status>
</output>
</nds>
[07/24/18 22:13:55.936]:SAP User Management Driver APR ST: Token Value: {<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured"}.
[07/24/18 22:13:55.936]:SAP User Management Driver APR ST: Arg Value: {<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured"}.
[07/24/18 22:13:55.936]:SAP User Management Driver APR ST: Action: do-set-local-variable("parva-value",scope="policy",token-xpath("$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()")).
[07/24/18 22:13:55.937]:SAP User Management Driver APR ST: arg-string(token-xpath("$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()"))
[07/24/18 22:13:55.937]:SAP User Management Driver APR ST: token-xpath("$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()")
[07/24/18 22:13:55.937]:SAP User Management Driver APR ST: Token Value: "".
[07/24/18 22:13:55.938]:SAP User Management Driver APR ST: Arg Value: "".


When using a xpath simulator (http://xmltoolbox.appspot.com/xpathevaluator.html) with bellow xml field and xpath attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()
it gets as result the F217 value.
What can be wrong in my code ??

<attr attr-name="sapParameters">
<value subtype="table" type="structured">
<component name="PARTXT">Personnel Country Grouping</component>
<component name="PARID">MOL</component>
<component name="PARVA">06</component>
</value>
<value subtype="table" type="structured">
<component name="PARTXT">Upper and lower case in source code: 'X' = lower, ' ' =upper</component>
<component name="PARID">SCL</component>
<component name="PARVA">X</component>
</value>
<value subtype="table" type="structured">
<component name="PARTXT">Plant</component>
<component name="PARID">WRK</component>
<component name="PARVA">F217</component>
</value>
</attr>


Context is everything. Post a level 3 trace of this so we can see exactly what's going where.
0 Likes
Knowledge Partner
Knowledge Partner

Re: retreive a SAP specfic value from nodeset table subtype

>> <do-set-local-variable name="parva-value" scope="policy">
>> <arg-string>
>> <token-xpath
>> expression='$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()'/>
>> </arg-string>
>> </do-set-local-variable>
>> <do-set-local-variable disabled="true" name="lvPARVA"
>> scope="policy">
>> <arg-string>
>> <token-xpath
>> expression='attr/value/component[text()="WRK"]/following-sibling::attr/value/component[@name="PARVA"]/text()'/>
>> </arg-string>
>> </do-set-local-variable>
>>


> Context is everything. Post a level 3 trace of this so we can see
> exactly what's going where.


David is correct. Context is everything.

Your XPATH is:
$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()

But as I had noted earlier, in the context of the result of a
Destination Attribute token (as distinct from a Query token's results)
stored in a nodeset, the nodeset begins with the value nodes.

So I THINK, your XPATH shoudl drop the attr.

$lvSAPSiteCodeAll/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()

I cannot remember (and would simply test) if you need the value either.
Since there are two or three nodes inside your nodeset all starting with
<value>.

Had you done a Query token, your nodeset would start with <instance>
nodes that had attr/value/component/text() nodes in them.

In fact, I have written all about this in an article:

Contexts:
https://www.netiq.com/communities/cool-solutions/xpath-and-context-node/


0 Likes
Highlighted
mdadik Absent Member.
Absent Member.

Re: retreive a SAP specfic value from nodeset table subtype

Here are level 3 logs for the rule where the code is executed
....
[07/24/18 23:09:45.457]:SAP User Management Driver APR ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.5.5.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<input>
<modify cached-time="20180724210945.412Z" class-name="User" event-id="testiam1b#20180724210945#1#1:3c4cbd50-7b52-48ce-f898-50bd4c3c527b#2" qualified-src-dn="O=data\OU=Users\OU=BL\uniqueID=RF76543" src-dn="\TREE-TEST\data\Users\BL\RF76543" src-entry-id="33152" timestamp="1532466585#2">
<association state="associated">\TRCMAND765\USdRF76543</association>
<modify-attr attr-name="attMainOU">
<remove-value>
<value timestamp="1532466239#2" type="dn">\TREE-TEST\data\Organizations\BL\51006174</value>
</remove-value>
<add-value>
<value timestamp="1532466585#2" type="dn">\TREE-TEST\data\Organizations\BL\51017392</value>
</add-value>
</modify-attr>
</modify>
</input>
</nds>
[07/24/18 23:09:46.158]:SAP User Management Driver APR ST:Subscriber processing modify for \TREE-TEST\data\Users\BL\RF76543.
[07/24/18 23:09:46.159]:SAP User Management Driver APR ST:Applying command transformation policies.
[07/24/18 23:09:46.159]:SAP User Management Driver APR ST:Applying policy: %+C%14CNOVLSAPUDCFG-sub-ctp-addLogicalSystemEntitlementUnavailable%-C.
[07/24/18 23:09:46.159]:SAP User Management Driver APR ST: Applying to modify #1.
[07/24/18 23:09:46.159]:SAP User Management Driver APR ST: Evaluating selection criteria for rule 'Set parameters'.
[07/24/18 23:09:46.160]:SAP User Management Driver APR ST: (if-operation equal "add") = FALSE.
[07/24/18 23:09:46.160]:SAP User Management Driver APR ST: (if-op-attr 'attMainOU' changing) = TRUE.
[07/24/18 23:09:46.160]:SAP User Management Driver APR ST: Rule selected.
[07/24/18 23:09:46.160]:SAP User Management Driver APR ST: Applying rule 'Set parameters'.
[07/24/18 23:09:46.161]:SAP User Management Driver APR ST: Action: do-set-local-variable("lvSiteCode",scope="policy",token-src-attr("attSiteCode",class-name="clsOrganization",arg-dn(token-src-attr("attMainOU",class-name="clsUser")))).
[07/24/18 23:09:46.161]:SAP User Management Driver APR ST: arg-string(token-src-attr("attSiteCode",class-name="clsOrganization",arg-dn(token-src-attr("attMainOU",class-name="clsUser"))))
[07/24/18 23:09:46.161]:SAP User Management Driver APR ST: token-src-attr("attSiteCode",class-name="clsOrganization",arg-dn(token-src-attr("attMainOU",class-name="clsUser")))
[07/24/18 23:09:46.162]:SAP User Management Driver APR ST: arg-dn(token-src-attr("attMainOU",class-name="clsUser"))
[07/24/18 23:09:46.162]:SAP User Management Driver APR ST: token-src-attr("attMainOU",class-name="clsUser")
[07/24/18 23:09:46.162]:SAP User Management Driver APR ST: Query from policy
[07/24/18 23:09:46.163]:SAP User Management Driver APR ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.5.5.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<input>
<query class-name="User" dest-dn="\TREE-TEST\data\Users\BL\RF76543" dest-entry-id="33152" scope="entry">
<read-attr attr-name="attMainOU"/>
</query>
</input>
</nds>
[07/24/18 23:09:46.164]:SAP User Management Driver APR ST: Pumping XDS to eDirectory.
[07/24/18 23:09:46.164]:SAP User Management Driver APR ST: Performing operation query for \TREE-TEST\data\Users\BL\RF76543.
[07/24/18 23:09:46.164]:SAP User Management Driver APR ST: --JCLNT-- \TREE-TEST\system\DriverSet455\SAP User Management Driver APR : Duplicating : context = 1707802724, tempContext = 1707802819
[07/24/18 23:09:46.166]:SAP User Management Driver APR ST: --JCLNT-- \TREE-TEST\system\DriverSet455\SAP User Management Driver APR : Calling free on tempContext = 1707802819
[07/24/18 23:09:46.167]:SAP User Management Driver APR ST: Query from policy result
[07/24/18 23:09:46.167]:SAP User Management Driver APR ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.5.5.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<output>
<instance class-name="User" qualified-src-dn="O=data\OU=Users\OU=BL\uniqueID=RF76543" src-dn="\TREE-TEST\data\Users\BL\RF76543" src-entry-id="33152">
<association state="associated">\TRCMAND765\USdRF76543</association>
<association state="associated">fanout2-Lu+1UmpYLUNQti7vtVJqWA==</association>
<association state="associated">fanout1-Lu+1UmpYLUNQti7vtVJqWA==</association>
<attr attr-name="attMainOU">
<value timestamp="1532466585#2" type="dn">\TREE-TEST\data\Organizations\BL\51017392</value>
</attr>
</instance>
<status level="success"></status>
</output>
</nds>
[07/24/18 23:09:46.168]:SAP User Management Driver APR ST: Token Value: "\TREE-TEST\data\Organizations\BL\51017392".
[07/24/18 23:09:46.169]:SAP User Management Driver APR ST: Arg Value: "\TREE-TEST\data\Organizations\BL\51017392".
[07/24/18 23:09:46.169]:SAP User Management Driver APR ST: Query from policy
[07/24/18 23:09:46.169]:SAP User Management Driver APR ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.5.5.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<input>
<query class-name="clsOrganization" dest-dn="\TREE-TEST\data\Organizations\BL\51017392" scope="entry">
<read-attr attr-name="attSiteCode"/>
</query>
</input>
</nds>
[07/24/18 23:09:46.170]:SAP User Management Driver APR ST: Pumping XDS to eDirectory.
[07/24/18 23:09:46.170]:SAP User Management Driver APR ST: Performing operation query for \TREE-TEST\data\Organizations\BL\51017392.
[07/24/18 23:09:46.170]:SAP User Management Driver APR ST: --JCLNT-- \TREE-TEST\system\DriverSet455\SAP User Management Driver APR : Duplicating : context = 1707802724, tempContext = 1707802819
[07/24/18 23:09:46.171]:SAP User Management Driver APR ST: --JCLNT-- \TREE-TEST\system\DriverSet455\SAP User Management Driver APR : Calling free on tempContext = 1707802819
[07/24/18 23:09:46.172]:SAP User Management Driver APR ST: Query from policy result
[07/24/18 23:09:46.172]:SAP User Management Driver APR ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.5.5.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<output>
<instance class-name="Organizational Unit" qualified-src-dn="O=data\OU=Organizations\OU=BL\OU=51017392" src-dn="\TREE-TEST\data\Organizations\BL\51017392" src-entry-id="67856">
<attr attr-name="attSiteCode">
<value timestamp="1516099295#7" type="string">001</value>
</attr>
</instance>
<status level="success"></status>
</output>
</nds>
[07/24/18 23:09:46.173]:SAP User Management Driver APR ST: Token Value: "001".
[07/24/18 23:09:46.173]:SAP User Management Driver APR ST: Arg Value: "001".
[07/24/18 23:09:46.174]:SAP User Management Driver APR ST: Action: do-set-local-variable("lvSAPSiteCodeAll",scope="policy",arg-node-set(token-dest-attr("sapParameters"))).
[07/24/18 23:09:46.174]:SAP User Management Driver APR ST: arg-node-set(token-dest-attr("sapParameters"))
[07/24/18 23:09:46.174]:SAP User Management Driver APR ST: token-dest-attr("sapParameters")
[07/24/18 23:09:46.174]:SAP User Management Driver APR ST: Query from policy
[07/24/18 23:09:46.175]:SAP User Management Driver APR ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.5.5.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<input>
<query class-name="User" scope="entry">
<association>\TRCMAND765\USdRF76543</association>
<read-attr attr-name="sapParameters"/>
</query>
</input>
</nds>
<source>
<product build="20141001_0729" instance="SAP User Management Driver APR" version="4.0.0.2">Identity Manager Driver for User Management of SAP Software</product>
<contact>NetIQ Corporation</contact>
</source>
<output>
<instance class-name="US" event-id="0" src-dn="\TRCMAND765\RF76543">
<association>\TRCMAND765\USdRF76543</association>
<attr attr-name="PARAMETER">
<value subtype="table" type="structured">
<component name="PARTXT">Personnel Country Grouping</component>
<component name="PARID">MOL</component>
<component name="PARVA">06</component>
</value>
<value subtype="table" type="structured">
<component name="PARTXT">Upper and lower case in source code: 'X' = lower, ' ' =upper</component>
<component name="PARID">SCL</component>
<component name="PARVA">X</component>
</value>
<value subtype="table" type="structured">
<component name="PARTXT">Plant</component>
<component name="PARID">WRK</component>
<component name="PARVA">F217</component>
</value>
</attr>
</instance>
<status event-id="0" level="success" type="driver-general">
<description>Subscriber Query Successful.</description>
</status>
</output>
</nds>
[07/24/18 23:09:47.290]:SAP User Management Driver APR ST: Token Value: {<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured"}.
[07/24/18 23:09:47.291]:SAP User Management Driver APR ST: Arg Value: {<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured"}.
[07/24/18 23:09:47.292]:SAP User Management Driver APR ST: Action: do-set-local-variable("parva-value",scope="policy",token-xpath("$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()")).
[07/24/18 23:09:47.293]:SAP User Management Driver APR ST: arg-string(token-xpath("$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()"))
[07/24/18 23:09:47.293]:SAP User Management Driver APR ST: token-xpath("$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()")
[07/24/18 23:09:47.294]:SAP User Management Driver APR ST: Token Value: "".
[07/24/18 23:09:47.294]:SAP User Management Driver APR ST: Arg Value: "".
[07/24/18 23:09:47.294]:SAP User Management Driver APR ST: Evaluating selection criteria for rule 'Add Logical System When Entitlement Unavailable'.
[07/24/18 23:09:47.295]:SAP User Management Driver APR ST: (if-global-variable 'drv.entitlement.UserAccount' not-equal "true") = FALSE.
[07/24/18 23:09:47.295]:SAP User Management Driver APR ST: (if-global-variable 'drv.entitlement.UserAccount' not-available) = FALSE.
[07/24/18 23:09:47.296]:SAP User Management Driver APR ST: Rule rejected.
[07/24/18 23:09:47.296]:SAP User Management Driver APR ST:Policy returned:
[07/24/18 23:09:47.297]:SAP User Management Driver APR ST:

....
0 Likes
Knowledge Partner
Knowledge Partner

Re: retreive a SAP specfic value from nodeset table subtype

mdadik;2484633 wrote:
Here are level 3 logs for the rule where the code is executed
....
[07/24/18 23:09:45.457]:SAP User Management Driver APR ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.5.5.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<input>
<modify cached-time="20180724210945.412Z" class-name="User" event-id="testiam1b#20180724210945#1#1:3c4cbd50-7b52-48ce-f898-50bd4c3c527b#2" qualified-src-dn="O=data\OU=Users\OU=BL\uniqueID=RF76543" src-dn="\TREE-TEST\data\Users\BL\RF76543" src-entry-id="33152" timestamp="1532466585#2">
<association state="associated">\TRCMAND765\USdRF76543</association>
<modify-attr attr-name="attMainOU">
<remove-value>
<value timestamp="1532466239#2" type="dn">\TREE-TEST\data\Organizations\BL\51006174</value>
</remove-value>
<add-value>
<value timestamp="1532466585#2" type="dn">\TREE-TEST\data\Organizations\BL\51017392</value>
</add-value>
</modify-attr>
</modify>
</input>
</nds>
[07/24/18 23:09:46.158]:SAP User Management Driver APR ST:Subscriber processing modify for \TREE-TEST\data\Users\BL\RF76543.
[07/24/18 23:09:46.159]:SAP User Management Driver APR ST:Applying command transformation policies.
[07/24/18 23:09:46.159]:SAP User Management Driver APR ST:Applying policy: %+C%14CNOVLSAPUDCFG-sub-ctp-addLogicalSystemEntitlementUnavailable%-C.
[07/24/18 23:09:46.159]:SAP User Management Driver APR ST: Applying to modify #1.
[07/24/18 23:09:46.159]:SAP User Management Driver APR ST: Evaluating selection criteria for rule 'Set parameters'.
[07/24/18 23:09:46.160]:SAP User Management Driver APR ST: (if-operation equal "add") = FALSE.
[07/24/18 23:09:46.160]:SAP User Management Driver APR ST: (if-op-attr 'attMainOU' changing) = TRUE.
[07/24/18 23:09:46.160]:SAP User Management Driver APR ST: Rule selected.
[07/24/18 23:09:46.160]:SAP User Management Driver APR ST: Applying rule 'Set parameters'.
[07/24/18 23:09:46.161]:SAP User Management Driver APR ST: Action: do-set-local-variable("lvSiteCode",scope="policy",token-src-attr("attSiteCode",class-name="clsOrganization",arg-dn(token-src-attr("attMainOU",class-name="clsUser")))).
[07/24/18 23:09:46.161]:SAP User Management Driver APR ST: arg-string(token-src-attr("attSiteCode",class-name="clsOrganization",arg-dn(token-src-attr("attMainOU",class-name="clsUser"))))
[07/24/18 23:09:46.161]:SAP User Management Driver APR ST: token-src-attr("attSiteCode",class-name="clsOrganization",arg-dn(token-src-attr("attMainOU",class-name="clsUser")))
[07/24/18 23:09:46.162]:SAP User Management Driver APR ST: arg-dn(token-src-attr("attMainOU",class-name="clsUser"))
[07/24/18 23:09:46.162]:SAP User Management Driver APR ST: token-src-attr("attMainOU",class-name="clsUser")
[07/24/18 23:09:46.162]:SAP User Management Driver APR ST: Query from policy
[07/24/18 23:09:46.163]:SAP User Management Driver APR ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.5.5.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<input>
<query class-name="User" dest-dn="\TREE-TEST\data\Users\BL\RF76543" dest-entry-id="33152" scope="entry">
<read-attr attr-name="attMainOU"/>
</query>
</input>
</nds>
[07/24/18 23:09:46.164]:SAP User Management Driver APR ST: Pumping XDS to eDirectory.
[07/24/18 23:09:46.164]:SAP User Management Driver APR ST: Performing operation query for \TREE-TEST\data\Users\BL\RF76543.
[07/24/18 23:09:46.164]:SAP User Management Driver APR ST: --JCLNT-- \TREE-TEST\system\DriverSet455\SAP User Management Driver APR : Duplicating : context = 1707802724, tempContext = 1707802819
[07/24/18 23:09:46.166]:SAP User Management Driver APR ST: --JCLNT-- \TREE-TEST\system\DriverSet455\SAP User Management Driver APR : Calling free on tempContext = 1707802819
[07/24/18 23:09:46.167]:SAP User Management Driver APR ST: Query from policy result
[07/24/18 23:09:46.167]:SAP User Management Driver APR ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.5.5.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<output>
<instance class-name="User" qualified-src-dn="O=data\OU=Users\OU=BL\uniqueID=RF76543" src-dn="\TREE-TEST\data\Users\BL\RF76543" src-entry-id="33152">
<association state="associated">\TRCMAND765\USdRF76543</association>
<association state="associated">fanout2-Lu+1UmpYLUNQti7vtVJqWA==</association>
<association state="associated">fanout1-Lu+1UmpYLUNQti7vtVJqWA==</association>
<attr attr-name="attMainOU">
<value timestamp="1532466585#2" type="dn">\TREE-TEST\data\Organizations\BL\51017392</value>
</attr>
</instance>
<status level="success"></status>
</output>
</nds>
[07/24/18 23:09:46.168]:SAP User Management Driver APR ST: Token Value: "\TREE-TEST\data\Organizations\BL\51017392".
[07/24/18 23:09:46.169]:SAP User Management Driver APR ST: Arg Value: "\TREE-TEST\data\Organizations\BL\51017392".
[07/24/18 23:09:46.169]:SAP User Management Driver APR ST: Query from policy
[07/24/18 23:09:46.169]:SAP User Management Driver APR ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.5.5.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<input>
<query class-name="clsOrganization" dest-dn="\TREE-TEST\data\Organizations\BL\51017392" scope="entry">
<read-attr attr-name="attSiteCode"/>
</query>
</input>
</nds>
[07/24/18 23:09:46.170]:SAP User Management Driver APR ST: Pumping XDS to eDirectory.
[07/24/18 23:09:46.170]:SAP User Management Driver APR ST: Performing operation query for \TREE-TEST\data\Organizations\BL\51017392.
[07/24/18 23:09:46.170]:SAP User Management Driver APR ST: --JCLNT-- \TREE-TEST\system\DriverSet455\SAP User Management Driver APR : Duplicating : context = 1707802724, tempContext = 1707802819
[07/24/18 23:09:46.171]:SAP User Management Driver APR ST: --JCLNT-- \TREE-TEST\system\DriverSet455\SAP User Management Driver APR : Calling free on tempContext = 1707802819
[07/24/18 23:09:46.172]:SAP User Management Driver APR ST: Query from policy result
[07/24/18 23:09:46.172]:SAP User Management Driver APR ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.5.5.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<output>
<instance class-name="Organizational Unit" qualified-src-dn="O=data\OU=Organizations\OU=BL\OU=51017392" src-dn="\TREE-TEST\data\Organizations\BL\51017392" src-entry-id="67856">
<attr attr-name="attSiteCode">
<value timestamp="1516099295#7" type="string">001</value>
</attr>
</instance>
<status level="success"></status>
</output>
</nds>
[07/24/18 23:09:46.173]:SAP User Management Driver APR ST: Token Value: "001".
[07/24/18 23:09:46.173]:SAP User Management Driver APR ST: Arg Value: "001".
[07/24/18 23:09:46.174]:SAP User Management Driver APR ST: Action: do-set-local-variable("lvSAPSiteCodeAll",scope="policy",arg-node-set(token-dest-attr("sapParameters"))).
[07/24/18 23:09:46.174]:SAP User Management Driver APR ST: arg-node-set(token-dest-attr("sapParameters"))
[07/24/18 23:09:46.174]:SAP User Management Driver APR ST: token-dest-attr("sapParameters")
[07/24/18 23:09:46.174]:SAP User Management Driver APR ST: Query from policy
[07/24/18 23:09:46.175]:SAP User Management Driver APR ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.5.5.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<input>
<query class-name="User" scope="entry">
<association>\TRCMAND765\USdRF76543</association>
<read-attr attr-name="sapParameters"/>
</query>
</input>
</nds>
<source>
<product build="20141001_0729" instance="SAP User Management Driver APR" version="4.0.0.2">Identity Manager Driver for User Management of SAP Software</product>
<contact>NetIQ Corporation</contact>
</source>
<output>
<instance class-name="US" event-id="0" src-dn="\TRCMAND765\RF76543">
<association>\TRCMAND765\USdRF76543</association>
<attr attr-name="PARAMETER">
<value subtype="table" type="structured">
<component name="PARTXT">Personnel Country Grouping</component>
<component name="PARID">MOL</component>
<component name="PARVA">06</component>
</value>
<value subtype="table" type="structured">
<component name="PARTXT">Upper and lower case in source code: 'X' = lower, ' ' =upper</component>
<component name="PARID">SCL</component>
<component name="PARVA">X</component>
</value>
<value subtype="table" type="structured">
<component name="PARTXT">Plant</component>
<component name="PARID">WRK</component>
<component name="PARVA">F217</component>
</value>
</attr>
</instance>
<status event-id="0" level="success" type="driver-general">
<description>Subscriber Query Successful.</description>
</status>
</output>
</nds>
[07/24/18 23:09:47.290]:SAP User Management Driver APR ST: Token Value: {<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured"}.
[07/24/18 23:09:47.291]:SAP User Management Driver APR ST: Arg Value: {<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured",<value> @subtype = "table" @type = "structured"}.
[07/24/18 23:09:47.292]:SAP User Management Driver APR ST: Action: do-set-local-variable("parva-value",scope="policy",token-xpath("$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()")).
[07/24/18 23:09:47.293]:SAP User Management Driver APR ST: arg-string(token-xpath("$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()"))
[07/24/18 23:09:47.293]:SAP User Management Driver APR ST: token-xpath("$lvSAPSiteCodeAll/attr/value/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()")
[07/24/18 23:09:47.294]:SAP User Management Driver APR ST: Token Value: "".
[07/24/18 23:09:47.294]:SAP User Management Driver APR ST: Arg Value: "".
[07/24/18 23:09:47.294]:SAP User Management Driver APR ST: Evaluating selection criteria for rule 'Add Logical System When Entitlement Unavailable'.
[07/24/18 23:09:47.295]:SAP User Management Driver APR ST: (if-global-variable 'drv.entitlement.UserAccount' not-equal "true") = FALSE.
[07/24/18 23:09:47.295]:SAP User Management Driver APR ST: (if-global-variable 'drv.entitlement.UserAccount' not-available) = FALSE.
[07/24/18 23:09:47.296]:SAP User Management Driver APR ST: Rule rejected.
[07/24/18 23:09:47.296]:SAP User Management Driver APR ST:Policy returned:
[07/24/18 23:09:47.297]:SAP User Management Driver APR ST:

....



So your trace shows one problem. Your query is for sapParameters. Your return document has PARAMETER. You'll need to fix that so that the return attribute is sapParameters.


<do-set-local-variable name="x" scope="policy">
<arg-string>
<token-xpath expression='$lvSAPSiteCodeAll/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()'/>
</arg-string>
</do-set-local-variable>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">Result: </token-text>
<token-local-variable name="x"/>
</arg-string>
</do-trace-message>
0 Likes
Knowledge Partner
Knowledge Partner

Re: retreive a SAP specfic value from nodeset table subtype

On 7/25/2018 2:44 PM, dgersic wrote:
> So your trace shows one problem. Your query is for sapParameters. Your
> return document has PARAMETER. You'll need to fix that so that the
> return attribute is sapParameters.


Good catch David! I missed that one. Clearly it went through the schema
map to get changed outbound, odd that it did not map back inbound.


<token-xpath
expression='$lvSAPSiteCodeAll/component[text()="WRK"]/following-sibling::component[@name="PARVA"]/text()'/>

That looks correct.

0 Likes
mdadik Absent Member.
Absent Member.

Re: retreive a SAP specfic value from nodeset table subtype

dgersic;2484724 wrote:
So your trace shows one problem. Your query is for sapParameters. Your return document has PARAMETER. You'll need to fix that so that the return attribute is sapParameters.



Hello,

Thanks for your reply but the mapping is correct, in my schema mapping, I have sapParameters (eDirectory) / PARAMETER (SAP).
When requesting sapParameter, it is normal to have PARAMETER in the nodeset.
0 Likes
Knowledge Partner
Knowledge Partner

Re: retreive a SAP specfic value from nodeset table subtype

mdadik;2484746 wrote:
Hello,

Thanks for your reply but the mapping is correct, in my schema mapping, I have sapParameters (eDirectory) / PARAMETER (SAP).
When requesting sapParameter, it is normal to have PARAMETER in the nodeset.


At least in Designer's simulation, if you query for source-attr sapParmeter, and get something else back, your resulting nodeset variable is empty. So adjust as needed to make it work.
0 Likes
Knowledge Partner
Knowledge Partner

Re: retreive a SAP specfic value from nodeset table subtype

On 7/24/2018 3:54 PM, mdadik wrote:
>
> Ok, thanks but where do I have to put that piece of code ?


Depends on where/what you need it.

So you have your

<do-set-local-variable name="lvSAPSiteCodeAll" scope="policy">
<arg-node-set>
<token-dest-attr name="sapParameters"/>
</arg-node-set>
</do-set-local-variable>

Ok, next is what I suggested or David, then you will have a variable
with the value in it, to do with as you see fit.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.