Layer7 API Management

Expand all | Collapse all

How can we perform an increment operation on a variable in CA API Gateway?

Jump to Best Answer
  • 1.  How can we perform an increment operation on a variable in CA API Gateway?

    Posted 05-08-2018 06:36 AM

    I am getting a JSON from CA LAC. In that JSON I have to increment the value of a variable and then send the update to the backend. SO how can I perform an increment operation on a variable?

     

    I tried the following approach but it's not working,

    * Extract variable from JSON using Evaluate JSON Path Expression Assertion

    * Then setting one context variable having value 1

    * Then setting another context variable with the expression :

             ${variable1.result} + ${variable2}

     

    But it's not working.



  • 2.  Re: How can we perform an increment operation on a variable in CA API Gateway?
    Best Answer

    Broadcom Employee
    Posted 05-08-2018 07:57 PM
      |   view attached

    set context variable assertion will not do calculating.

    you can use xpath assertion to do calculating.

    I will attach an example policy



  • 3.  Re: How can we perform an increment operation on a variable in CA API Gateway?

    Posted 05-09-2018 02:46 AM

    Thanks!!