Forum Stats

  • 3,759,041 Users
  • 2,251,494 Discussions
  • 7,870,477 Comments

Discussions

Problem handling a list of elements in BPEL 2.0 transformation

Carlos A
Carlos A Member Posts: 10
edited Feb 26, 2020 10:33AM in Business Process Management Suite

These are the different versions of my work environment:

Jdeveloper v 11.1.1.6.0

BPEL 2.0

Oracle SOA server

I have a problem when I receive a list of elements in a BPEL transformation step. This transformation is obtaining data from a received SOAP element (from the input of the previous step) and its objective is to generate a new SOAP element, using it as the input of the next step, which communicates with other web service.

This is the structure of the SOAP element which is being received into the transformation:


<span class="pun"><</span><span class="pln">NameOfRequest  version</span><span class="pun">=</span><span class="str">"1.0"</span><span class="pln">  lang</span><span class="pun">=</span><span class="str">"es"</span><span class="pun">></span><span class="pln"> </span><span class="pun"><</span><span class="pln">idConv</span><span class="pun">></span><span class="lit">133</span><span class="pun"></</span><span class="pln">idConv</span><span class="pun">></span><span class="pln"> </span><span class="pun"><</span><span class="pln">gTram</span><span class="pun">></span><span class="pln"> </span><span class="pun"><</span><span class="pln">ns2</span><span class="pun">:</span><span class="pln">tipo</span><span class="pun">></span><span class="pln">TIPO1</span><span class="pun"></</span><span class="pln">ns2</span><span class="pun">:</span><span class="pln">tipo</span><span class="pun">></span><span class="pln"> </span><span class="pun"><</span><span class="pln">ns2</span><span class="pun">:</span><span class="pln">anyo</span><span class="pun">></span><span class="lit">2018</span><span class="pun"></</span><span class="pln">ns2</span><span class="pun">:</span><span class="pln">anyo</span><span class="pun">></span><span class="pln"> </span><span class="pun"><</span><span class="pln">ns2</span><span class="pun">:</span><span class="pln">numero</span><span class="pun">></span><span class="lit">1</span><span class="pun"></</span><span class="pln">ns2</span><span class="pun">:</span><span class="pln">numero</span><span class="pun">></span><span class="pln"> </span><span class="pun"></</span><span class="pln">gTram</span><span class="pun">></span><span class="pln"> </span><span class="pun"><</span><span class="pln">ns8</span><span class="pun">:</span><span class="pln">solicitud</span><span class="pun">></span><span class="pln"> </span><span class="pun"><</span><span class="pln">ns3</span><span class="pun">:</span><span class="pln">idSolicitud</span><span class="pun">></span><span class="lit">2</span><span class="pun"></</span><span class="pln">ns3</span><span class="pun">:</span><span class="pln">idSolicitud</span><span class="pun">></span><span class="pln"> </span><span class="pun"></</span><span class="pln">ns8</span><span class="pun">:</span><span class="pln">solicitud</span><span class="pun">></span><span class="pln"> </span><span class="pun"><</span><span class="pln">ns8</span><span class="pun">:</span><span class="pln">solicitud</span><span class="pun">></span><span class="pln"> </span><span class="pun"><</span><span class="pln">ns3</span><span class="pun">:</span><span class="pln">idSolicitud</span><span class="pun">></span><span class="lit">1</span><span class="pun"></</span><span class="pln">ns3</span><span class="pun">:</span><span class="pln">idSolicitud</span><span class="pun">></span><span class="pln"> </span><span class="pun"></</span><span class="pln">ns8</span><span class="pun">:</span><span class="pln">solicitud</span><span class="pun">></span><span class="pln"> </span><span class="pun"></</span><span class="pln">NameOfRequest</span><span class="pun">><br/><br/>In addition, these are the XSD structures:<br/><br/><code><span class="pun"><</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">complexType name</span><span class="pun">=</span><span class="str">"ComunicarAltaBdnsBySolicitudesRequestType_v1.0"</span><span class="pun">></span><span class="pln"><br/>   </span><span class="pun"><</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">complexContent</span><span class="pun">></span><span class="pln"><br/>   </span><span class="pun"><</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">extension base</span><span class="pun">=</span><span class="str">"cm:RequestMessageBaseType_v1.0"</span><span class="pun">></span><span class="pln"><br/>   </span><span class="pun"><</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">sequence</span><span class="pun">></span><span class="pln"><br/>   </span><span class="pun"><</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">element name</span><span class="pun">=</span><span class="str">"idConv"</span><span class="pln"> type</span><span class="pun">=</span><span class="str">"xsd:long"</span><span class="pln"> nillable</span><span class="pun">=</span><span class="str">"false"</span><span class="pun">/></span><span class="pln"><br/>   </span><span class="pun"><</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">element name</span><span class="pun">=</span><span class="str">"gTram"</span><span class="pln"> type</span><span class="pun">=</span><span class="str">"cgt:CodigoGrupoTramitacionType_v1.0"</span><span class="pln"> nillable</span><span class="pun">=</span><span class="str">"false"</span><span class="pln"> minOccurs</span><span class="pun">=</span><span class="str">"1"</span><span class="pun">/></span><span class="pln"><br/>   </span><span class="pun"><</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">element name</span><span class="pun">=</span><span class="str">"solicitud"</span><span class="pln"> type</span><span class="pun">=</span><span class="str">"cso:CodigoSolicitudType_v1.0"</span><span class="pln"> minOccurs</span><span class="pun">=</span><span class="str">"1"</span><span class="pln"> maxOccurs</span><span class="pun">=</span><span class="str">"unbounded"</span><span class="pun">/></span><span class="pln"><br/>   </span><span class="pun"></</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">sequence</span><span class="pun">></span><span class="pln"><br/>   </span><span class="pun"></</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">extension</span><span class="pun">></span><span class="pln"><br/>   </span><span class="pun"></</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">complexContent</span><span class="pun">></span><span class="pln"><br/></span><span class="pun"></</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">complexType</span><span class="pun">></span><span class="pln"><br/><br/></span><span class="pun"><</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">complexType name</span><span class="pun">=</span><span class="str">"CodigoSolicitudType_v1.0"</span><span class="pun">></span><span class="pln"><br/>   </span><span class="pun"><</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">sequence</span><span class="pun">></span><span class="pln"><br/>   </span><span class="pun"><</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">element name</span><span class="pun">=</span><span class="str">"idSolicitud"</span><span class="pln"> minOccurs</span><span class="pun">=</span><span class="str">"1"</span><span class="pln"> type</span><span class="pun">=</span><span class="str">"xsd:long"</span><span class="pun">/></span><span class="pln"><br/>   </span><span class="pun"></</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">sequence</span><span class="pun">></span><span class="pln"><br/>   </span><span class="pun"></</span><span class="pln">xsd</span><span class="pun">:</span><span class="pln">complexType</span><span class="pun">></span>

I need to copy all the elements called solicitud into another SOAP structure (for a new request, after the current transformation).

I tried different procedures in the transformation step (for each, copy, copyList, append, etc.) but I'm not able to copy all the repetitions of solicitud elements. I tried even copying the content into a new variable an then assigning this variable to the target list.

The most positive result I achieved was to copy only one of the solicitud elements into the new SOAP call... but it's not enough for my purpose.

Any idea about how to copy all the elements?

Thanks in advance!

Best Answer

  • Carlos A
    Carlos A Member Posts: 10
    edited Dec 19, 2018 7:07AM Accepted Answer

    I solved the problem using the Transformation step instead of the Assign step.

    The correct procedure is the following one:

    1. Insert a new Transformation into the BPEL process.
    2. Select the input (sources) and the output (target) and create a new XSL file from the right buttons (the one which is a green +).
    3. Open the new XSL file and display all the elements from the source (on the left) and the target (on the right). This action is very important, if a part of the source data or the target data is not displayed, the elements will not be linked, generating a bad mapping.
    4. Link the elements form the source to the target and select YES if an auto-map message appears on the screen. This will insert for-each elements into the target part, copying all the elements of the source list into the target.

    Working in that way allows to copy elements with lists, which is not supported using the Assing operation of the BPEL.

    Hope it helps!

Answers

  • Hemanth Lakkaraju-Oracle
    Hemanth Lakkaraju-Oracle Member Posts: 412 Employee
    edited Dec 7, 2018 11:30AM

    call apply-templates from main template and  create a template for solciitud and use copy-of like below:

      <xsl:template match="ns8:solicitud">

        <xsl:copy-of select="."/>

      </xsl:template>

  • Carlos A
    Carlos A Member Posts: 10
    edited Dec 10, 2018 11:23AM

    I tried your idea but it's not working... the BPEL console says the apply-templates element is not valid.

    In addtion, the other error consists on it is not possible to use <xsl:template match="ns8:solicitud">, because the only accepted value for the match tag is "/".

    Regarding the creation of other template... is it a xsl file? What should be the content of this new file?

    Could you specify more about the procedure I have to follow, please?

    Thanks you so much.

  • Carlos A
    Carlos A Member Posts: 10
    edited Dec 19, 2018 7:07AM Accepted Answer

    I solved the problem using the Transformation step instead of the Assign step.

    The correct procedure is the following one:

    1. Insert a new Transformation into the BPEL process.
    2. Select the input (sources) and the output (target) and create a new XSL file from the right buttons (the one which is a green +).
    3. Open the new XSL file and display all the elements from the source (on the left) and the target (on the right). This action is very important, if a part of the source data or the target data is not displayed, the elements will not be linked, generating a bad mapping.
    4. Link the elements form the source to the target and select YES if an auto-map message appears on the screen. This will insert for-each elements into the target part, copying all the elements of the source list into the target.

    Working in that way allows to copy elements with lists, which is not supported using the Assing operation of the BPEL.

    Hope it helps!