Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8943313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:44:36+00:00 2026-06-15T11:44:36+00:00

Just to rephrase the question I am using the WSO2 BPS server to run

  • 0

Just to rephrase the question
I am using the WSO2 BPS server to run a business process to invoke a RestProxy service on the WSO2 ESB. I get a response back through an output variable called LVCounterOut. The LVCounterOut is a message type based variable and the response is in XML format as shown below:

<message>
 <payload>
  <Response>
     <Terminal>
       <Name>RValue</Name>
       <Value>0.000000</Value>
     </Terminal>
     <Terminal>
       <Name>SValue</Name>
       <Value>**1.000000**</Value>
     </Terminal>
  </Response>
 </payload>
</message>

Ho can I assign an atomic value in the above variable to the output variable of the business process. For example in the above response I would like to assign the numeric part of the “Value” node that is “1.0000000” which would be in string format to an output variable of the process. The next question would be is how to convert this string value into an integer so that i can use it in an If control in my Business process. for example “If Value > 10″ invoke ServiceA else invoke ServiceB”.

Here is what i have already tried to do to assign the output from the LVCounterOut variable to the output variable “ProcessOutput”.

<bpel:assign validate="no" name="AssignProxyOut">
        <bpel:copy>
            <bpel:from>
                <bpel:literal>
                    <tns:LVCounterProcessResponse xmlns:tns="http://wso2.org/bps/sample" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><tns:return>tns:return</tns:return>

                    </tns:LVCounterProcessResponse>
                </bpel:literal>
            </bpel:from>
            <bpel:to variable="ProcessOutput" part="payload"></bpel:to>
        </bpel:copy>
        <bpel:copy>
            <bpel:from>
              <![CDATA[$LVCounterOut.payload/ns:Response/ns:Terminal[2]/ns:Value/text()]]>
            </bpel:from>
            <bpel:to part="payload" variable="ProcessOutput">
                <bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:return]]></bpel:query>
            </bpel:to>
        </bpel:copy>
    </bpel:assign>

When i run the business process on the BPS server using tryit I get the following error

[2012-11-20 16:41:59,882] ERROR - BpelEngineImpl - Scheduled job failed; jobDetail=JobDetails( instanceId: null mexId: hqejbhcnphr7rsjnbxjhrs processId:
 {http://wso2.org/bps/sample}LVSelectProcess-127 type: INVOKE_INTERNAL channel: null correlatorId: null correlationKeySet: null retryCount: null inMem:
false detailsExt: {enqueue=false}) java.lang.ClassCastException: java.lang.String cannot be cast to org.w3c.dom.Node at
org.jaxen.dom.DocumentNavigator.getChildAxisIterator(DocumentNavigator.java:152)
at org.jaxen.util.DescendantAxisIterator.next(DescendantAxisIterator.java:129)

I assume that the use of XPATH here is wrong or am i going about totally the wrong way? I do apologies but XML and XPATH are not my strongest point and i am still trying to get to grips with it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:44:37+00:00Added an answer on June 15, 2026 at 11:44 am

    For anyone who does come across a similar problem, i have solved this query as follows:

    To extract atomic values from the output message variable of an invoked service you can use

    bpel:getVaribleData(varName, partName, xpathStr) function.

    This function is not defined in WS-BPEL-2.0 specification. But this works in WSO2-BPS and Apache-ODE. It can be used to extract a set of elements from a variable, using a XPath expression.

    eg –

    <bpel:copy>
    <bpel:from>
        <![CDATA[count(bpel:getVariableData(‘$Variable','$partName')/ns:return)]]>
    </bpel:from>
    <bpel:to variable="itemCount"></bpel:to>
    </bpel:copy>
    

    Remember to use ‘’ when passing varName and partName. And here “/ns:return” is the xpath expression.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just a simple question, but can't get an answer on my own. In memory
I made a web project in Java, using Java-WS. How can I invoke service
Just a knowledge question which I would like to ask: For example, I have
OK - let's rephrase this whole question shall we? Is there any way to
This is an attempt to rephrase a question I asked earlier. I'd like to
This is an attempt to rephrase my previous question as a result of the
I've got a simple question. If I'm using a Response.Redirect(), will that kill all
I've asked this question yesterday and got lots of good answers, only I just
Sorry for the previous non-descriptive question. Please allow me to rephrase the question again:
Just checking my JS and I have an error, but I cannot see where.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.