This discussion is archived
2 Replies Latest reply: Aug 15, 2012 1:33 AM by user10683443 RSS

Null Value handling using IF activity

user10683443 Newbie
Currently Being Moderated
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.


Thanks
  • 1. Re: Null Value handling using IF activity
    NarsingPumandla Pro
    Currently Being Moderated
    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>
    <!--"BusinessLogic"/-->
    <else>
    <scope name="email1">
    <bpelx:annotation>
    <bpelx:pattern patternName="bpelx:email"/>
    </bpelx:annotation>
    </scope>
    </else>
    </if>
    -------------------

    Hope this helps,
    N
  • 2. Re: Null Value handling using IF activity
    user10683443 Newbie
    Currently Being Moderated
    Thanks a lot for your response i am proceeding now as below

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

    else

    send an email

    hopefully it works.


    Thanks,

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points