Layer 7 API Management

Expand all | Collapse all

How to do debugging with Policy Template Fragment

Jump to Best Answer
  • 1.  How to do debugging with Policy Template Fragment

    Posted 11-22-2019 10:40 AM
    When setting breakpoint in Service Debugger, it seems it cannot go inside any Policy Fragment inside a Policy Template ? Any tip how to step inside a policy template.

    Thanks in advance.

    ------------------------------
    .
    ------------------------------


  • 2.  RE: How to do debugging with Policy Template Fragment

    Posted 11-22-2019 11:27 AM
    Hi Louie,

    The policy fragments can be debugged via the service debugger. Are you perhaps referring to encapsulated assertions?

    We have a great doc here on enabling policy tracing that should be of some value to you. It is not quite as elegant as the service debugger but logs some great detail that can get inside of encapsulated assertions and listed out the exact line at which a failure occurs. Hope this helps.

    https://ca-broadcom.wolkenservicedesk.com/external/article?articleId=136303

    Regards,
    Joe





  • 3.  RE: How to do debugging with Policy Template Fragment

    Posted 11-22-2019 11:44 AM
    Try to debug a fragment policy provided by the Layer 7 Portal Developer and it is encapsulated assertions.

    Only Debug log for encapsulated assertions then?


    ------------------------------
    Enterprise Architect
    TwoCoins.ca Inc.
    ------------------------------



  • 4.  RE: How to do debugging with Policy Template Fragment
    Best Answer

    Posted 11-22-2019 12:01 PM
    That is correct. The service debugger will not work with encapsulated assertions.

    Regards,
    Joe


  • 5.  RE: How to do debugging with Policy Template Fragment

    Posted 11-22-2019 02:32 PM
    Need to use audit log then. Thanks.

    ------------------------------
    Enterprise Architect
    TwoCoins.ca Inc.
    ------------------------------



  • 6.  RE: How to do debugging with Policy Template Fragment

    Posted 11-27-2019 06:34 AM
    What you also can try:
    1. open the policy/fragment of your encAssertion
    2. copy everything
    3. open the original policy
    4. replace the encAssertion with the content from step 2
    5. keep in mind: if the encAssertion uses input values, you need to specify them manually at the beginning of the copied content
    With this in place you have full visibility again in the Service Debugger. Once troubleshooting is finished, you can revert your changes. Or if possible, you can do all these modifications on a copy of the original policy.
    Hope that helps.

    Ciao Stefan :)


  • 7.  RE: How to do debugging with Policy Template Fragment

    Posted 11-28-2019 09:01 AM
    Thanks Stefan, it is an interesting and good workaround as we have more control with the suggested way.

    One minor follow up question how to define Boolean value using "Set Context Variable" for step 5 listed above.

    Thanks in advance.



  • 8.  RE: How to do debugging with Policy Template Fragment

    Posted 11-29-2019 05:12 AM

    Hi Louie,
    that's indeed a good question, as this type is not available in the "Set Context Variable"-Assertion.

    But maybe it will work, if you are using a String with the value "true/false" or just 1 or 0 (maybe also as Integer).
    Create a small test-policy and check how it behaves.

    Ciao Stefan :)​




  • 9.  RE: How to do debugging with Policy Template Fragment

    Posted 12-02-2019 09:04 AM
    Hello there.

    In step 4 you do not need to copy everthing from the encass policy, just use the Include Policy Fragment Assertion pointing to the policy of your encass.

    Step 5 is very important to check.


    ------------------------------
    Sr. Consultant Services
    HCL Enterprise Studio
    ------------------------------