2 Replies Latest reply on Aug 15, 2012 8:33 AM by user10683443

    Null Value handling using IF activity

      Dear All,

      I am calling a ERP webservice using my BPEL Process..When i am getting the response from ERP i am hndling that properly what if i get a response as Null.

      I am planning to use IF activity so that if i got some response i will continue with BPEL process if i got a Null response from ERP i will send a mail using else condition from if activity.

      please help me how to configure the if activity.

        • 1. Re: Null Value handling using IF activity
          After calling the ERP Service using the Invoke Activity, drop an If Activity under the invoke activity (you will find the if activity only if you are using the BPEL 2.0 specification, if you are using the BPEL 1.1 specification, you can use the switch activity)

          In that if activity, in the IF case write a condition which checks the invoke activity output variable, select the exact response element of the ERP service in the InvokeOutputVariable in the expression builder, it would be be something similar to this...

          $Invoke_ERP_OutputVariable.payload/ns2:ResponseHeader/ns2:code != 'Null'

          edit the switch case as required, check for whatever value you are interested, in the above case, i am checking whether it is not equal to Null

          then in that case sequence, do the business logic as required....

          in the ELSE sequence drop an email activity and notify the required people....

          I am pasting you the similar XML source code of the above logic....

          <if name="If1">
          <documentation>Not Null Case</documentation>
          <condition>$Invoke_ERP_OutputVariable.payload/ns2:ResponseHeader/ns2:code != 'Null'</condition>
          <scope name="email1">
          <bpelx:pattern patternName="bpelx:email"/>

          Hope this helps,
          1 person found this helpful
          • 2. Re: Null Value handling using IF activity
            Thanks a lot for your response i am proceeding now as below

            if not null
            $invokeBatchservice_OutputVariable.body/ns4:P_STS_OUT != 'Null'


            send an email

            hopefully it works.