6 Replies Latest reply on Feb 3, 2011 8:51 AM by Gary Brown

    BPEL condition -  input parameter exists ?

    Igor JStarter Novice

      Hey!

       

      One more question not related to .NET service...

       

      I've got 10 input parameters in my BPEL process and I'm testing it with SoapUI. If I don't set a string parameter value, SoapUI(and probably others) don't sent the parameter in the xml at all.

       

      My question is:  How can I check that parameter in BPEL ???

      if the IP was empty -> log error

      if IP is filled              -> call WS

       

      In my BPEL i have the next condition:

      [CDATA[$input.payload/tns:arrSubscriber/tns:User[round($iterator)]/tns:sMultimediaIP=""

      Which doesn't work because it wasn't sent at all ... And it goes to bpel:else where i'm trying to copy the MultimediaIP -> ERROR...

       

      Gary suggested trying: <![CDATA[exists($input.payload/tns:arrSubscriber/tns:User[round($iterator)]/tns:sMultimediaIP)]]>

      but when calling the service, it returns [SWITCH]  NO SUCH FUNCTION EXISTS.

      In the BPEL editor there was already an error( but compiled): not a boolean expression...

       

      When adding (just a try): exists($input.payload/tns:arrSubscriber/tns:User[round($iterator)]/tns:sMultimediaIP)="false"

      it's throwing the same error: NO SUCH FUNCTION EXISTS

       

       

       

      Any other idea?

        • 1. BPEL condition -  input parameter exists ?
          Gary Brown Master

          Are you using xpath2? i.e. the query/expression language set to version 2, as in http://ode.apache.org/xpath-extensions.html

          • 2. BPEL condition -  input parameter exists ?
            Igor JStarter Novice

            Nice

             

            <bpel:condition expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[exists($input.payload/tns:arrSubscriber/tns:User[round($iterator)]/tns:sMultimediaIP)]]></bpel:condition>

             

            WORKS!!!

             

            I don't know how far I would be with my project without you... For sure I wouldn't be using BPEL.)

            But now it looks like I'm going to finish the project till monday which was my deadline... and I really hope I'll get a new project in the near future... 

             

            Thank you Gary!

            • 3. BPEL condition -  input parameter exists ?
              Igor JStarter Novice

              Damn... still have problems...

               

              Like I wrote I'm using the condition

              <bpel:condition expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[exists($input.payload/tns:arrSubscriber/tns:User[round($iterator)]/tns:sMultimediaIP)]]></bpel:condition>

               

              Like you see I have an array or Subscribers and (in my while loop) I'm checking the MultimediaIP for every user...

              MY EXISTS CONDITION WORKS ONLY FOR THE FIRST TIME !!!

               

              So, just for the first user in my array the condition works correct !!!

              The next ones are always - NOT EXIST (alhough... they exist)

               

              Any idea?

              • 4. BPEL condition -  input parameter exists ?
                Gary Brown Master

                This sounds strange behaviour.

                 

                Wondering why you have the 'round' function in the square brackets? What type is $iterator?

                • 5. BPEL condition -  input parameter exists ?
                  Igor JStarter Novice

                  ROUND()
                  The $iterator is int. So like you said: why round() an integer...

                  I copied that from another example and didn't change it because it worked well.

                   

                  BUT... now I erased it and have : $input.payload/tns:arrSubscriber/tns:User[$iterator]/tns:sMultimediaIP)

                   

                  Nothing changes for the EXISTS function... But one example is very STRANGE.. (first I looked like xpath2 is the problem, but it isn't)

                  if I have condition: exists($input.payload/tns:arrSubscriber/tns:User[$iterator]/tns:sMultimediaIP)

                  and inside the condition the bpel:copy: <![CDATA[$input.payload/tns:arrSubscriber/tns:User[$iterator]/tns:sMultimediaIP]]>

                  it returns selectionFailure- expression returned multiple nodes.

                  What I added round() to the bpel:copy -> WORKS...

                   

                  PROBLEM - EXISTS WORKS ONLY FOR FIRST ARRAY ELEMENT, then no matter what - it doesn't exist ...

                  I hope It's not like the writing to an array ISSUE, which works fine for array[0], but you can't fill in array[1], [2], ..  ..

                  • 6. BPEL condition -  input parameter exists ?
                    Gary Brown Master

                    Sorry Igor, I think your best option is to post this information on the ODE forum to see if anyone there has had a similar problem.

                     

                    Especially mentioning the round() issue.

                     

                    Regards

                    Gary