Q: What are the development best practices you should follow?
A: There could be many development best practices and those can vary from organization to organization. However, here are few which are recommended by Blue Prism and can be applicable to every tool (Screenshots may vary from tool to tool )
- There must be a wait stage at the start of each action to verify if the required screen/element has appeared and if we are on correct page/screen of the application.
It will also absorb the screen latency .
- It’s always better to over estimate the time out value than to underestimate it if using dynamic wait conditions. It won’t add up to execution time as the wait is dynamic and process will move forward as soon as the element is found. Further any such timeout should always throw an exception.
- Never try to handle the exception resulting from timeout by using recovery logic . This exception should be thrown up (by bubbling or by re-throwing) to let the process layer handle it.
- Avoid using Static Waits in the object actions. It should be only used as a last resort when we can’t detect the screen change.
- Dynamic Wait should be used after each navigate stage which causes the screen on the application to change.
- Published actions (User defined except VBOs ) should never be called by an object action. It should be left for the process to coordinate between different actions.
- No business decisions should be made inside an object. All business decisions should be taken by the process.
- The object actions should be designed in such modular way, that it can be used by multiple processes with very less modifications.
- All exceptions should have a proper and meaningful description and type.
- All input and output variables should be properly named as per naming convention decided by your organization. Make sure to provide a meaningful description of the parameter as an when required to remove the ambiguity.
- Group Relevant Data items and use different color codes to showcase different types of data items (variables ) used.
- All Global variables or global data items should be stored in the initialize page with appropriate naming convention and proper color coding.
- The Elements in Application modeler should be logically laid and should follow proper naming conventions.
- All Customer related data should be removed from the Attributes of Spied Elements.
- Make sure to choose the Attributes of spied elements carefully, and try to avoid using environment specific attributes such as “parent URL” .
- The Main page should be easily readable and should depict the logical flow diagram of your process. A person looking at your main page must understand the high level logic of your process by the glance. This can be achieved by breaking up (or grouping) the process into different pages which can be called from the main page itself.
- Make sure to add a “Should Stop?” or “Is Stop Requested” logic in your process to enable the controller easily manage the process execution and provide them an option to have graceful termination.
- Use proper retry loops in sub pages to handle one off exception scenarios like “network issue” or “page not loaded” issue. It will enable the process to be more reliable in handling unknown errors.
- Add a termination logic to your main process to handle consecutive system exceptions. I.E : if your process throws system exception, the process must be able to terminate after 3 retries . it will ensure that not all workqueue items are marked as exception and the controller can investigate the issue.
- Use Environment Variables to store configurable information such as: Network Path, Email, database, or web service configuration or System configuration such as URLs.
- Make sure to mark all the processed work queue items as either completed or exception. You should also consider using work queue tags and status for efficient processing incase of multi step transactions.
- Try to use Standard Blue Prism process templates whenever applicable.
- Objects should be named as APP NAME + SCREEN NAME . Ex: Google Drive – Basic Actions
- The actions within the objects may contain names like, Login, Launch, Download File, UpLoad File etc.
- Process should be named as per below convention : Logical description – No peoples names, version numbers, application names (unless it’s appropriate). Ex: “01.Create Orders – Populate Queue” where the number 01 indicates order of execution, Create orders is the Process Name, and Populate queue is the logical description of the step this process is going to perform.
- Always give a proper description while saving the process or object to help maintain version control.
Remember that all these best practices should serve only as guidelines.