Hi
@SamLima,
As per the LMS course what they have suggested makes sense since we always follow a multiple object layer while iterating with any application. So let say when we have an object called as 'Basic Actions' we only go for actions like 'Launch', 'Terminate' and 'Detach'. Here, 'Attach' may not be required as when you will be launching the application, automatically the application will be attached. Usually, when we use other objects for interacting with different screens of the application we go ahead and use attach action of that specific object so that we stay connected all the time.
But this approach we usually don't follow in certain cases, the benefit you get with keeping the 'Attach' stage at 'Basic Actions' object level is that you can implement a logic to check the connection status and if not connected you can simply call the attach action. But if there is any error that happens while attaching to the application then you can use the launch action via exception handling. This used to be al older approach that all Blue Prism processes used to follow.
The downside of this approach is, you wont be sure that going ahead always your application will be attached in all other objects specific to individual screens. Many times we have seen that application some times get detached halfway the automation and in such cases we cant really use the launch action in the object itself as launch action is only a part of 'Basic Actions' object. But the plus point is that you can easily call the launch action within your object and you dont need to worry about handling exception at the sub process level.
So the new approach which even the LMS suggests is use the 'Attach' actions only for objects meant for interacting with individual screens. In case any error pops up you throw an exception:
And you handle this error at the process level where you can call the 'Launch' action of your 'Basic Actions' object:
So here the benefit you get is that you do your overall exception handling at the process level which is actually one of the most important best practices where it is said
use objects for throwing exceptions and sub processes for handling the exceptions and just use the basic actions to either launch or terminate the application as and when required. Secondly, in all our actions related to individual screens we ensure that we attach to application as we always call the attach page for such actions at the beginning:
So, ideally both approaches are right it just have different uses and depends on which one you want to use. The BP Travel template has been created probably using the old approach most likely while the LMS tells us about the new approach but technically both are correct. The new approach according to me has better benefits which the LMS describes
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website:
https://devneet.github.io/Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.