Expand all | Collapse all

Recursion and Velocity

  • 1.  Recursion and Velocity

    Posted 06-10-2019 05:37

    Can someone provide a example of how you can achieve recursion within a velocity report please?

    Basically given a document I would like to go back the relationship (upstream) tree until the top if reached, i.e. the document has no further upstream relationships?



  • 2.  RE: Recursion and Velocity

    Posted 06-11-2019 11:03

    Hello, nice to hear from you today!

    Have you tried using a macro to do it. You can pass your item and whether you are going upstream or downstream.


    Chloe Elliott
    Jama Software
    Portland OR

  • 3.  RE: Recursion and Velocity

    Posted 06-12-2019 00:04
      |   view attached
    Hello Chloe,

    Thanks for your reply.  Well, I did look at Macros, unfortunately I think I have exceeded my programming skill level as I could not get them to work.

    Basically I can have a hierarchy of requirements (I've attached a sample)

    So I would be starting with a leaf requirement (R6) and I would need the macro to return R1, R2 as these are essentially the top level parents of R6

    If you could provide an example of how this could be achieved I would be very grateful.


  • 4.  RE: Recursion and Velocity

    Posted 06-12-2019 08:50
    Hi Andy,

    you could do that also in a loop. Limits the the "recursion depth", but I would see that as a benefit.


    Harald Hotz-Behofsits
    Frequentis AG

  • 5.  RE: Recursion and Velocity

    Posted 06-13-2019 08:40
    Hi Andy -
    You could use a macro if you are going to be doing this quite a bit, but often, I just do a loop and pick a high number (like 10) and have it stop at 10 levels, unless there is no relationship before then. I know it's not elegant, but it works.

    Shawnna Williams
    Jama Software