The Clean Application Exit is part of our Clean Screen Policy. This policy specifies that all clients leave a clean screen/desktop after finishing the workflow execution. This is independent of whether the execution was finished successfully or ended on failure. A clean process should end with a clean screen after successful completion.
The Clean Application Exit handles all Clean Screen Exits as defined in the corresponding windows. Therefore, it starts with the last window opened and works its way back to the first opened window.
Different steps are required for a complete Clean Screen Exit Strategy.1. Define Exit Strategies for ALL VIEWS inside your workflow
Inside the Developer View of the Composer, all Attach Windows have a Clean Screen Exit section towards the bottom. Inside this section of each window, users must define the strategy on how to leave this view. These strategies can be different.
- For many views, a simple Close Window might be sufficient.
- There may also be cases in which a Logout should be performed before closing the page/application. The user can place all required activities to be executed properly inside. For such cases, you might even place pre-defined Logout Building Blocks inside the Clean Screen Exit.
- Some applications/websites might display a pop-up when the user tries to close the window, namely if there are unsaved changes. Here, you can use Close Window and Attach Window to attach the pop-up. As always, you can simply drag-and-drop the required activities inside the attach window. In this case, you can ignore the Golden Rule and use an Attach Window inside another Attach Window.
2. Verify the Clean Screen Exit is executed
After defining the Clean Screen Exit Strategies for each view individually, we need to make sure that those – especially in case of failure – are executed, and all windows, applications, and browsers are closed. As always, there are several possibilities:
- Enable the Execute Clean Application Exit checkbox inside the Open/Attach Browseror Open/Attach Application This checkbox can be found inside the property pane in the properties on the right-side panel. Note that in this case the Clean Exit Strategies will always be run after the execution of the application scope and all activities inside, whether the execution was ended in failure or with success. This could be a problem if the user works with building blocks and wants to leave the application open after finishing the execution and uses Attach Application inside the following Building Block. The application could not be attached, because it cannot be found as it is already closed.
- Our recommended method for using Clean Application is to predefine it within the Workflow Activity wrapped around all processes by default. The workflow activity comes with integrated error handling by default. If any error arises (on unhandled error and on handled error) or if there is no error (Finally), there is an activity that triggers the execution of all defined clean application strategies. Within the execution of the Clean Application Exit, the system checks whether there is a defined exit strategy for the foreground window. If the answer is yes, it will be executed and the same procedure starts for the nest foreground window until there is none remaining. Therefore, independent of the success of a workflow but especially in case of failure, all possible open windows and applications will be closed as long as the Clean Screen Exit strategy is specified for all windows.
Helpful Note: In order to get more information about what is happening on the screen in case of an error, a screenshot is taken at the beginning of the Clean Application Exit. This screenshot can be accessed in the AM Console.
Only two items are mandatory to pursue the Clean Screen Exit strategy and close all remaining windows in case of an error:
- Leave the workflow activity wrapped around your workflow and make sure that the Clean Application Exit activities are located in each container.
- Define Clean Screen Exit Strategy for ALL Attach Windows.