Forum Stats

  • 3,854,964 Users
  • 2,264,441 Discussions


Extract delimited text in Oracle BPM

Robinson J
Robinson J Member Posts: 7

Hi Experts

I have a payload within the BPM Process where a webservice returns me a list of approvers ex: tom,lee,Ben which are basically users. My requirement is to extract these users individually and assign to a node which is like target node below

Source Node

<xs:complexType name="approvalRouteByInvoiceNatureResponse">


      <xs:extension base="tns:messageValueObject">


          <xs:element type="xs:string" name="approvalRoute" minOccurs="0"/>

          <xs:element type="xs:boolean" name="autoApprove" minOccurs="0"/>

          <xs:element type="tns:integrationResponse" name="integrationResponse" minOccurs="0"/>

          <xs:element type="tns:statusResponse" name="statusResponse" minOccurs="0"/>





and the target node would look like

<?xml version="1.0" encoding="windows-1252" ?>

<xsd:schema xmlns:xsd=""




  <xsd:element name="ApprovalRoute">



    <xsd:element name="Approvers" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>





The reason being i would like to do some logic on each user,what will be the best way to get the individual users from the webservice ,

Thanks for Help



  • Martien van den Akker
    Martien van den Akker Member Posts: 2,777 Bronze Crown
    edited Oct 16, 2018 3:37AM


    You can transform them directly, using an XSLT. But, if you want to loop over the elements, and perform an action approver by approver, you should create a loop with a loop counter that selects each approver into a variable. Take a look at this article where I describe how I did it in PCS: It works exactly the same way in BPM.


  • d465f42a-f285-4724-b7d9-9bbf75085cf4
    edited Oct 16, 2018 3:57AM

    With Metastorm BPM v7 becoming 'Past Maintenance' in January 2018, users left on versions previous to the current OpenText MBPM v9, will run an ever-increasing risk that changes to their applications, infrastructure or operating systems will cause issues in business-critical BPM solutions.

  • Martien van den Akker
    Martien van den Akker Member Posts: 2,777 Bronze Crown
    edited Oct 16, 2018 4:49AM

    I'm sorry, but what does this have to do with the question? How is this related to Oracle BPM Suite?


  • Robinson J
    Robinson J Member Posts: 7
    edited Oct 16, 2018 11:37AM


    Thanks for the help but in your case , you already have a list, in my case I do not have a list, but a string which has comma delimited values. I need to extract each value and convert them to list of values, so that then i could then loop over them.

    I tried a few functions in XSLT like oraext:create-nodeset-from-delimited-string but no luck.

    I have the XSD of the List into which i would like to copy the extracted values.

    <?xml version="1.0" encoding="UTF-8"?>

    <schema attributeFormDefault="unqualified" elementFormDefault="qualified"



      <element name="ApproverList">



            <element name="approver" type="string" maxOccurs="unbounded"/>






    I then tried to have a XSLT like

    <xsl:variable name="approvers" select="/ns0:iprocess/ns0:inputList"/>

          <xsl:variable name="pos" select='oraext:create-nodeset-from-delimited-string(tns:approver,$approvers,",")'></xsl:variable>

          <xsl:for-each select="$pos">

            <xsl:variable name="counter" select="position()"/>


              <xsl:value-of select="$pos[$counter]"/>



    This function oraext:create-nodeset-from-delimited-string seems to work on SOA - BPEL with Copylist - copy rule in the Assign Operation . Any idea on how to acheive the same is highly appreciated.

    Thanks in Advance

  • Martien van den Akker
    Martien van den Akker Member Posts: 2,777 Bronze Crown
    edited Oct 17, 2018 3:21AM

    Oh, but then you have switched your source and target samples in your original question! That's how I interpretted it.

    In that case, you need to understand that XSLT is actually a functional programming language, which means that variables in XSLT are immutable.

    You can solve this by using recursion. See for intance especially the replace template. I think you need a template like:

    <xsl:template name="parseDelimitedString">  <xsl:param "delimitedStr"/>  <!--   <xsl:variable name="firstItem" select="substring-before($delimitedStr, ',')" />   <xsl:variable name="restDelimitedStr" select="substring-after($delimitedStr, ',')" />  <tns:approver>    <xsl:value-of select="$firstItem"/>  </tns:approver>  <xsl:call-template name="parseDelimitedString">    <xsl:with-param name="delimitedStr" select="$restDelimitedStr"/>  </xsl:call-template></xsl:template>

    That you can call with:

      <xsl:call-template name="parseDelimitedString">    <xsl:with-param name="delimitedStr" select="select="/ns0:iprocess/ns0:inputList"/>  </xsl:call-template>

    (Typed by heart, not tested)



    Robinson J
  • Robinson J
    Robinson J Member Posts: 7
    edited Oct 17, 2018 8:57AM


    Thanks a lot for the help, I just had to add the exit condition for the recursion and then could achieve my requirement.

      <xsl:template name="parseDelimitedString">

            <xsl:param name="delimitedStr"/>

            <!-- -->

            <xsl:variable name="firstItem" select="substring-before($delimitedStr, ',')"/>

            <xsl:variable name="restDelimitedStr" select="substring-after($delimitedStr, ',')"/>


                <xsl:value-of select="$firstItem"/>



            <xsl:when test="contains($restDelimitedStr, ',')">

                <xsl:call-template name="parseDelimitedString">

                    <xsl:with-param name="delimitedStr" select="$restDelimitedStr"/>





                  <xsl:value-of select="$restDelimitedStr"/>






  • Martien van den Akker
    Martien van den Akker Member Posts: 2,777 Bronze Crown
    edited Oct 17, 2018 9:51AM

    Yes indeed: forgot that: Recursion => always add an end condition!

    Nice that it works.