cancel
Showing results for 
Search instead for 
Did you mean: 

Use Cases for the 'Initialise' and 'Clean Up' Pages of an Object

stepher
Level 5
The primary question is "When, and for what purposes, do you use the default 'Initialise' and 'Clean Up' pages of an Object?

In our organization, we often use default time values for Wait and Sleep stages (1, 5, 15, 30, 60).  For some of our Objects, these values are loaded into global variables/data elements in the Initialise stage.  But, in all honesty, there is no real benefit to this method, as compared to loading them as needed in the Action pages.  However, this falls firmly into the 'No Harm, No Foul' category.

This weekend, though, I was toying/experimenting with what I thought might be an actual use case.  I have bult a simple Wrapper Object that kills defined active Windows processes, as it finds them.  These are currently held in a static Collection within the WO.  These can range from nusiance processes to those that tend to get orphaned by BP Process terminations.  We are starting to use this WO as a standard action at the start, the end of the 'Happy Path' and the end of the main exception handling.  This helps clear the way for the process, and tries to keep the process from leaving detritus behind that could derail subsequent Processes.  This has been working well, but every so often we identify a new application to add to the list.

This got me thinking that it would be nice to move the list of applications to a reference text file that could be loaded into the Collection.  This would allow for quicker updates, and for an easier Path-to-Prod (due to less intensive Change Management requirements).  Additionally, I thought it would be more efficient to load the reference file once, as a part of the initial load into memory, rather than each and every time the WO action was called.  This last part proved to be true-ish.  But I still ran into an issue where terminations could/would occur if too many processes tried to access the reference file at the same time.  I could build in retry logic, but, again, this WO will generally be used only twice by a process, so there is not a whole lot of 'juice for the squeeze', as it were.

So, that was my entertainment for the weekend.  It just left me wondering if others are able to get significant benefit out of these default pages.

Thanks much,
Red

------------------------------
Robert "Red" Stephens
Application Developer, RPA
Sutter Health
Sacramento, CA USA
------------------------------
Robert "Red" Stephens Application Developer, RPA Sutter Health Sacramento, CA
1 REPLY 1

ewilson
Staff
Staff
Hi @Robert Stephens,

In my experience, the most common use of the Initialise action is for maintaining Global data items, as you've described. Sometimes people will just create an actual Global data action which isn't published. Really, as you mentioned, there's not harm in either approach. Other uses cases that can apply to use of the Initialise action have to do with variable that need to be defined and initialized at startup (ex. a Singleton instance).

It's also important to consider the run-mode of the VBO too. If the VBO's set to Exclusive there's likely less need for code/variables defined on the Initialise tab.

As far as the Clean Up action goes, I've used it in a few cases where there was a need to perform the equivalent of a Dispose. One recent example is the Utility - HTTP Listener VBO. This VBO provides the ability to spin up a local HTTP listener within a VBO for receiving direct HTTP requests. To ensure things are properly cleaned-up, I use the Clean Up action to the check the state of the listener to determine if it's still running when then the VBO is shutting down. If it is, I have a Code stage that shuts it down and releases the resources.

So there are use cases for both actions, Just depends on your situation.

Cheers,


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