2

I have a BPEL process which catches any faults raised and assigns them to a variable:

<assign name="AssignFault">
  <copy>
    <from>ora:getFaultAsString()</from>
    <to>$myVariable</to>
  </copy>
</assign>

This puts the whole XML message, including tags, into the variable:

com.oracle.bpel.client.BPELFault: faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault}
messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage}
parts: {{
summary=<summary>oracle.fabric.common.FabricInvocationException: Unable to access the following endpoint(s): myServer/myService</summary>
,detail=<detail>Unable to access the following endpoint(s): myServer/myService</detail>
,code=<code>404</code>}

Is there any way of getting the individual element values, i.e. the text values contained in the "summary", "detail" and "code" tags? I'd like to assign the text of each to individual variables and do different stuff with them.

Thanks in advance for any assistance.

GarlicBread
  • 1,671
  • 8
  • 26
  • 49
  • I'm getting close to getting the individual elements by trying to use, for example: substring-before(substring-after(ora:getFaultAsString(), ""), ""). However, my IDE (JDeveloper 11.1.1.6.0) doesn't like the greater-than sign in the string "". – GarlicBread Jun 10 '13 at 05:19
  • 1
    Try to replace the greater sign with `>`. – nwellnhof Jun 10 '13 at 09:51

1 Answers1

6

I split the individual elements from the fault message using

<from>substring-before(substring-after(ora:getFaultAsString(), "&lt;code&gt;"), "&lt;/code&gt;")</from>
<from>substring-before(substring-after(ora:getFaultAsString(), "&lt;summary&gt;"), "&lt;/summary&gt;")</from>
<from>substring-before(substring-after(ora:getFaultAsString(), "&lt;detail&gt;"), "&lt;/detail&gt;")</from>

... and then reassembled into something non-XML using the concat function.

GarlicBread
  • 1,671
  • 8
  • 26
  • 49
  • 1
    If this solves your problem, feel free to mark it as an answer, so that the question is recorded as answered. There is nothing wrong in answering your own questions. – joergl Jun 11 '13 at 14:15
  • 1
    I intend to - I have to wait for 24 hours before I can mark it as such. – GarlicBread Jun 11 '13 at 20:19