cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with externalizing value for Filter step (XPATH)

PiotrRadzki
Active Participant
0 Kudos

Dear All,

I'm having issue with externalizing XPATH value for Filter step in CPI. Once it's externalized through Content Modifier or directly in filter step I'm getting below error during runtime. Is there a way to externalized XPATH Filter value succesfuly in CPI iFlow?

Error Details

org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath: //RCVPRN = 'DEFIL'. Reason: javax.xml.xpath.XPathExpressionException: net.sf.saxon.trans.XPathException: Invalid character '&' in expression, cause: net.sf.saxon.trans.XPathException: Invalid character '&' in expression

BR, Piotr

Accepted Solutions (0)

Answers (1)

Answers (1)

MortenWittrock
Active Contributor

Hi Piotr

I could not reproduce this. I was able to externalize an XPath expression in a Filter step with no problems. The specific expression you show here would not work regardless, would it? The boolean expression should probably go inside a predicate.

Regards,

Morten

PioRad
Discoverer
0 Kudos

Hi Morten, thanks for checking, it was one of the examples that we tried during testing, finally we were able to use following XPATH:

/_-ABC_-DEF_DEBMAS[IDOC/EDI_DC40/RCVPRN = 'DEFIL']

but when we try to externalize it we get the same issues as above. So it works when this value is not externalized, but fails when it is externalized.

BR, Piotr

Ryan-Crosby
Active Contributor
0 Kudos

piotr_radzki I also was not able to replicate this - I tried a static filter and an externalized filter and they both worked as expected.

MortenWittrock
Active Contributor

Hi piotr.radzki.3iii

That's odd. It looks like the apostrophes are getting translated into the XML character entity, which messes up the XPath expression. But that doesn't happen for me (I used apostrophes as well, for that reason).

I guess you did already delete the filter entirely and create a new one with the same result? You might need to create a support incident for this.

Regards,

Morten

Ryan-Crosby
Active Contributor

piotr_radzki is this potentially an older flow where the filter step is executing differently and removing it from the flow and inserting the step again will solve your issue?

PiotrRadzki
Active Participant

ryan.crosby2 7a519509aed84a2c9e6f627841825b5a looks like it is solved, I noticed in externalized parameter that value contained ' instead of proper apostrophe (came from bad copy paste?). Additionally I recreated the Filter step to avoid potential issues that is related to moving iFlow from one tenant to another and using old version of Filter block. All in all it worked finally 🙂 Thanks to both of you!