简体   繁体   中英

expression builder in BPEL

hello i am a newbie in oracle BPEL and also newbie in xpath, constantly i stuck at this if condition

if (strNOREF == null || (strNOREF != null && strNOREF.trim().length() == 0))
return Response.status(HttpStatus.FORBIDDEN.value()).entity("No. Ref is empty").build();

i wonder how do i translate into BPEL expression?

i tried this with this expression

$inputVariable.payload/ns2:strNOREF = "" or ($inputVariable.payload/ns2:strNOREF != "" and string-length($inputVariable.payload/ns2:strNOREF) = 0)

but it end up at else. i want to end up at my error message

Assuming this is Oracle BPEL.

You can easily do conditional logic like below.

  <if name="NameYourCondition">
     <condition>$inputVariable.payload/ns2:strNOREF = ""</condition>
           <assign name="Assignment">  
              <copy>              
                 <from>$someVar</from>
                 <to>$someOtherVar</to>
              </copy>
           </assign>
  <else>
           <assign name="DoDifferentAssignment"> 
               <copy>
                 <from>$someOtherVar</from>
                 <to>$someVar</to>
              </copy>
           </assign>
  </else> </if>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM