BAM – manually editing BTT XPath to return just the First instance?


We have a preference for using TPE for BAM tracking since it can be deployed independently of our orchestrations.

However, at one point in our process, we need to track a message payload property which has a 1:N relationship with the Root XML Element of the message.

Despite the 1:N relationship, extracting just the first value of this property will be sufficient for our tracking needs.

As usual, if we attempt to track this, then the following XLANG message is logged:

AmbiguousXPathException – The result set for the XPath expression … contains more than a single node

We have tried to modify the BTT XPath directly to select just the first instance of this Property

I’ve tried

‘XPath=”//*[local-name()=’Property’ and namespace-uri()='{URI}’ …]/[1]’ but then get the error “Expression must evaluate to a node-set”

and more simply
‘//Property[1]’ and ‘//Property[position() = 1]’
Give no error, but this doesn’t pull out my property either.

Lastly, can anyone explain the difference between the XPath and SomXPath in the BTT file?

Thanks in Advance!