Studio MVEL xpath() Cannot Resolve a count() When the Namespace Argument Is Packed Inside the Expression String
What does "MVEL Expression Error : unable to resolve property" mean in Workday Studio?
An Eval step tried to count nodes in a report response and Studio reported that it could not resolve the property. The XPath and the namespace declaration were written as one quoted string inside count(), so MVEL never saw a valid two-argument call.
Quick fix
Rewrite the call so the XPath and the namespace binding are separate arguments, for example parts[0].xpath('count(/wd:Report_Data/wd:Report_Entry/wd:Position_ID)', 'wd urn:com.workday.report/bsvc'), then redeploy the assembly.
Permanent fix
Keep one worked example of the two-argument xpath() form in your assembly template and copy from it rather than retyping. Any expression that returns a scalar, such as count() or string-length(), still takes the namespace binding as the second argument, and getting that wrong is the most common cause of an unresolved property in an Eval step.
Troubleshooting
- Read the property name in the error text literally. It echoes the whole call back to you, so compare it character by character against the two-argument form xpath('<expression>', '<prefix> <uri>').
- Count the quotes. The namespace pair belongs in its own argument outside the XPath string, not inside the parentheses of count().
- Confirm the prefix you declare matches the prefix used in the path. A report response served by RaaS uses wd bound to the report namespace, which is not the same URI as the bsvc service namespace.
- Reduce the expression to a bare node select with no count() and run it. If the bare select resolves, the fault is in how count() was assembled rather than in the path.
- Print the part you are querying to a Log step first and confirm the response really is the report XML, not a SOAP envelope wrapping it.