Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SOA 12.1.3 - ORABPEL-02118 - The variable is not declared in the current scope

801588Sep 9 2015 — edited Sep 10 2015

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>"&lt;email&gt; &lt;ovdTriggeredDate&gt;16thFeb&lt;/ovdTriggeredDate&gt; &lt;request&gt; &lt;requestId&gt;1111&lt;/requestId&gt; &lt;service&gt;OVDOngoing&lt;/service&gt; &lt;action&gt;Retry&lt;/action&gt; &lt;client&gt;Batch&lt;/client&gt; &lt;delivery&gt;email&lt;/delivery&gt; &lt;locale&gt; &lt;countryCode&gt;US&lt;/countryCode&gt; &lt;languageCode&gt;English&lt;/languageCode&gt; &lt;/locale&gt; &lt;/request&gt; &lt;/email&gt;"</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

This post has been answered by 905250 on Sep 9 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 8 2015
Added on Sep 9 2015
3 comments
840 views