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.

4

1 回答 1

6

我使用从故障消息中拆分单个元素

<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>

...然后使用 concat 函数重新组装成非 XML 的东西。

于 2013-06-10T21:56:53.690 回答