Skip to content

XPath Search Filter

Nilesh Ghodekar edited this page Feb 28, 2018 · 4 revisions

XPath Search Filter

FIM / MIM XPath Filter Dialect allows you to issue queries to the FIM Service via WS-enumeration Enumerate messages.

While the XPath Search filters used in WAL activities must confirm to the specification of FIM XPath Filter Dialect, WAL allows you to construct the search filter dynamically in the following two different ways.

String Resolution for XPath Search Filter

The search filter starts with a "/" followed by a string of characters that is not a valid WAL function expression. Any lookup in the filter is resolved and replaced with its actual value at the run time to form the actual search filter. e.g. for a search filter defined as /Group[DisplayName = '[//Target/OfficeLocation] Administrators'], if the value of the target's office location is London, the query issued to FIM Service will be /Group[DisplayName = 'London Administrators'].

Expression Resolution for XPath Search Filter

The search filter starts with a "/" followed by a string of characters that is a valid WAL function expression. The function expression is resolved and replaced with its actual value at the run time to form the actual search filter. e.g. for a search filter defined as /"Group[DisplayName = '" + [//Target/OfficeLocation] + " Administrators']", if the value of the target's office location is London, the query issued to FIM Service will be /Group[DisplayName = 'London Administrators'].

While the previous example uses the string concatenation function of WAL, you can use any other functions when defining your search filter. e.g. /"Group[DisplayName = '" + IIF(IsPresent([//Target/OfficeLocation]), [//Target/OfficeLocation], "UK") + " Administrators']".

If the expression resolves to "/", it gets treated as a null search filter returning zero resources. e.g. /IIF(IsPresent([//WorkflowData/LocationCode]),"xLocation[xLocationCode = '"+ [//WorkflowData/LocationCode] +"']", Null()).

Implementation Guidance

Care should be taken to ensure that the resulting search filter is not only a valid XPath syntax but a valid FIM XPath Filter Dialect as well. If you expect that the value of a lookup may contain characters that must be escaped to conform to the XPath syntax, it is your responsibility to do at the desing time. e.g. in one of the previous examples, the serach filter should be defined as /Group[DisplayName = "[//Target/OfficeLocation] Administrators"] (that is with double quotes instead of single quotes), if the value of the target's office location is expected to have an apostrophe in it as in "King's Cross". For a more complex escaping needs, you can use ReplaceString function as appropriate when defining your search filter.

Clone this wiki locally