API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#API Connect
#Applicationintegration
#APIConnect
 View Only
  • 1.  using switch policy in v10

    Posted Mon October 24, 2022 09:38 AM
    I add a switch policy to execute different conditions and i use parse policy to manipulate my request body .. but the switch Policy always don't execute

    ------------------------------
    Hamza Bayar
    ------------------------------


  • 2.  RE: using switch policy in v10

    Posted Tue October 25, 2022 09:01 AM

    Hi Hamza,

    If your payload has a isSimulate boolean property with a false value the associated rule should execute.  If the boolean isn't there however, I believe you'll need something like

    $not($exists(message.body.isSimulate)) or message.body.isSimulate = false

    ​Also note that request is immutable and thus cannot be parsed, but your initial parse which places into message.body a parsed object will also create a request.parsed_body in context if you ever need to refer back to a parsed version of the original request.

    Best Regards,

    Steve



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------