cancel
Showing results for 
Search instead for 
Did you mean: 

(HELP) initialise and clean up

VARUNPARATWAR
Level 3
1. if i have 10 actions in a object, and i run whole object at once, how many time initialise and cleanup page will get executed?

2. if i call object's different action pages from process studio, for each action page called initialise and cleanup page will get executed seperately or it will get executed just one time?

3. if i have 10 action page each will consume 1mb memory, if i call only one action page from process studio, then will it consumes 10mb memory or 1mb?

4. if i run 10 action pages if i run all action seperately, will initialise  cleanup page will get run 10 times or just one time?

this questions were asked to me and i was clueless, if you can tell more info about it that will be very helpful.
thanks for the answer and help.  


------------------------------
VARUN PARATWAR
------------------------------
2 REPLIES 2

PvD_SE
Level 12
Hi V,

Interesting questions! I hope someone at BP will write an extensive answer that covers all this and perhaps more.

------------------------------
Happy coding!
---------------
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

ewilson
Staff
Staff
Hello @VARUNPARATWAR,

I'll take a stab at some of this.

1. Initialise and Cleanup are only called once for each VBO within a process. Initialise is called the very first time the VBO is referenced (regardless of which published action you call on the VBO) and Clean Up is called when the process terminates. You can see this is you add a reference to System.Windows.Forms.dll to the ​External References and System.Windows.Forms to the Namespace Imports under the Code Options. Then you can add a Code stage to the Initialise and Clean Up actions and within that Code stage enter the following code:

MessageBox.Show("Initialize")​
or 
MessageBox.Show("Clean Up")​


Then when you run the process (ex. assign it to two different runtime resources on your machine), you'll see a message box pop-up for each action within each process.

2. Same idea as above even if you're running in debug. The first time you call any action on the specific VBO, its Initialise action will be executed. When the process completes and you click the Reset button, the Clean Up action will be called for each VBO in the process.


3. This is much more nuanced. If you're referring to memory consumed by data items specific actions use (ex. creating and populating a new Collection), that memory will only be consumed if the action is called. You also need to consider whether your VBOs have the Shareable property set. The Shareable property essentially makes your VBO a Singleton within any process that consumes it. That applies primarily in situations where the VBO is actually consumed by other VBOs that are then used in a process. Hopefully that makes sense. There's more information that may be helpful to you available here and here

4. Refer back to 1 & 2 above.

Hope that helps.

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------