I encountered a strange problem in the weekend while trying to demo BPEL’s compare function. Expression used shown below:
xp20:compare(bpws:getVariableData(‘inputVariable’,'payload’,'/client:process/client:input’),’World’)=0
This resulted into XPath error at runtime. I realized the reason after looking at the error log.
getVariableData returns an XMLElement and we were trying to compare it against java.lang.String resulting in conversion error – oracle.xml.parser.v2.XMLElement cannot be cast to java.lang.String. To fix this issue, we need to use ora:getNodeValue function to extract string value from XMLElement.
Alternatively, BPEL implicitly does above steps if we use the expression:
bpws:getVariableData(‘inputVariable’,'payload’,'/client:process/client:input’) = ‘World’.
VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Permanent link to this post (103 words, 0 images, estimated 25 secs reading time)
Related posts
Recent Comments