IDM - does object exist

Some times one need to know if an object exist, that could be a group, container, or what ever. There is a very easy way to do this using XPath and the query processor:

<do-if>
<arg-conditions>
<and>
<if-xpath op="true">query:readObject($srcQueryProcessor,'',$lv_objectDN,'','')</if-xpath>
</and>
</arg-conditions>
<arg-actions>
<do-set-local-variable name="lv_objectExist" scope="policy">
<arg-string>
<token-text xml:space="preserve">TRUE</token-text>
</arg-string>
</do-set-local-variable>
</arg-actions>
<arg-actions>
<do-set-local-variable name="lv_objectExist" scope="policy">
<arg-string>
<token-text xml:space="preserve">FALSE</token-text>
</arg-string>
</do-set-local-variable>
</arg-actions>
</do-if>

Remember that if you want to query the destination, then you have to use $destQueryProcessor.

Comments

Popular posts from this blog

Apple AirPort Express and Digital Jitter..

EIZO Colornavigator - Data Access Error

Using Borg backup across SSH with sshkeys