cancel
Showing results for 
Search instead for 
Did you mean: 

Page Recursion Impossible

__
Level 4
I am developing a process that contains a page that calls itself recursively for a dynamic amount of times. For simplicity's sake, lets say I goto a website and collect some data and a hyperlink. This procedure repeats itself indefinitely. I illustrated this in the attachment. Lets say I am 3 levels deep, and I go back to the second level, it forgets every variable (and collection) that was set. It also forgets the loop position it is in. Blue Prism should remember its exact state so it can return to this state after returning to the page again. Is there a workaround I can apply here?
6 REPLIES 6

shahariar_k_bhu
Level 5
Somehow, I'm not able to see attachments in this forum. However, you should double click on your data items and uncheck ""Reset to Initial Value whenever this page runs"". This will make sure that variables will not get reset to initial value whenever you call on the page. For loop position, you could have a counter on your loop which keeps track of the loop position. Start looping from that position.

I'm sorry, I didn't explain that very well. It does not forget the values as in they are reset, no. It remembers the values of the current instance of the page and not the previous. So when page A which is 3 levels deep ends, it must go back to page A that is 2 levels deep, but it will remember the values of the third level. I believe this is a bug since it should just create an instance of the page and remember all it's values until that page ends. Also, that loop position is definitely a bug and it should be fixed. I do appreciate your idea though and I know you are just trying to help. Thank you for that. EDIT: Unchecking the reset checkbox didn't help. In fact, it didn't change a thing (probably because Blue Prism still thinks its on the same page)

AdamSørensen
Level 3
How is this recursion set up? Is it a page with some code in it, that calls itself from within that same page?

BuzzaT
Level 4
There's two things to consider when you write a recursive formula in BP: Primarily if you call the object as its own process page, or if you call the object as an action page. An action call will create a new instantiated object with a unique data set, attachment, and everything else. Like it's a fresh object being used for the first time. A page reference will reference the same page, and use the same data/attachment and will retain any static variables as they were last set (static = do not reset at start) Knowing this, you can implement your recursive call at the level at which you expect data and function to be maintained. That's kind of the rough outline as I've discovered. [Edit] - We have multiple recursive objects that work based on variation of the DOM structure, or relative to a data set. Recursive calls work just fine, but vary in complexity given the objective.

Thank you for this information. What you're basically saying is that I should move the contents of my page to a Business Object and call it using an Action instead of a Page Reference. This works, but I will have to transform my complete process to a Business Object since pages are referenced all over the place. If there's a way to call a Page using Action I'd like to know, that will save me quite some time.

ErikChristoffer
Level 3
Hi, Today I also tried to make a recursive page in 6.4.2 and it indeed changes the page input parameters to the current instance, which is also wrong in my opinion. Reading the above about creating an Action page is something I not prefer. It makes the page visible to everyone. I want it to be a private page, like a private method in c#. Not all the pages in you object needs to be published. Is there any development in this, making pages recursive? Regards, Erik