Hi,
I am trying to run a sample code for converting input XML to XSD inside BPEL (SOA Suite 12.1.3).
1. xsd file
<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.email.org"
targetNamespace="http://www.email.org" elementFormDefault="qualified">
<xsd:element name="email">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ovdTriggeredDate" type="xsd:string" minOccurs="1"/>
<xsd:element name="request" type="RequestType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="RequestType">
<xsd:sequence>
<xsd:element name="requestId" type="xsd:long" minOccurs="1"/>
<xsd:element name="service" type="xsd:string" minOccurs="1"/>
<xsd:element name="action" type="xsd:string" minOccurs="1"/>
<xsd:element name="client" type="xsd:string" minOccurs="1"/>
<xsd:element name="delivery" type="xsd:string" minOccurs="0"/>
<xsd:element name="locale" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
2. BPEL code
<variable name="emailVar" element="ns3:email"/> // variable of type XSD
<variable name="emailDataVar" type="xsd:string"/>
<assign name="Assign2">
<copy>
<from>"<email> <ovdTriggeredDate>16thFeb</ovdTriggeredDate> <request> <requestId>1111</requestId> <service>OVDOngoing</service> <action>Retry</action> <client>Batch</client> <delivery>email</delivery> <locale> <countryCode>US</countryCode> <languageCode>English</languageCode> </locale> </request> </email>"</from>
<to>$emailDataVar</to>
</copy>
<copy>
<from>ora:parseEscapedXML(ora:getContentAsString(bpws:getVariableData('$emailDataVar')))</from>
<to>$emailVar</to>
</copy>
</assign>
</detail>
Getting following exception when I run the app.
<detail>
XPath expression failed to execute.
An error occurs while processing the XPath expression; the expression is ora:parseEscapedXML(ora:getContentAsString(bpws:getVariableData('$emailDataVar'))).
The XPath expression failed to execute; the reason was: ORABPEL-02118
Variant not found.
The variable "$emailDataVar" is not declared in the current scope. All variables must be declared in the scope before being accessed. Component DN is "default/Project1!1.0*soa_c1383edb-7f32-4860-8d21-82d312a0e1da/BPELProcess1" and corresponding Instance Id is 20,042
This was an internal error. The flow was not generated correctly by the BPEL compiler.
Contact Oracle Support Services. Please provide component definition of "default/Project1!1.0*soa_c1383edb-7f32-4860-8d21-82d312a0e1da/BPELProcess1" and audit trail of instance id 20,042 using enterprise manager console.
.Check the detailed root cause described in the exception message text and verify that the XPath query is correct.
-------------------------------------
There is one solution I found in forum that we need add the following code in bpel. (BPEL variable access problem - ORABPEL-02118)
<configurations>
<property name="keepGlobalVariables">true</property>
</configurations>
But when I add <configurations> in 12.1.3 BPEL , editor is showing 'Element configurations is not supported'.
Appreciate your quick help.
Thank You,
Cdhar