I'm using OpenSpan Agile Desktop (v18.104.22.168) for one of the process. As part of Agile Desktop framework I've an Interaction.xml where there is a button(Activity Shortcut) which triggers automation when user clicks.
Usually when user clicks multiple times on button, multiple interaction/activities are requested simultaneously. I want to disable the button when user clicks first time to avoid multiple interactions.
I've attached the screenshot of the Agile Desktop toolbar (360 view) for your reference.
Instead of disabling and re-enabling the button with each click, you can use boolean variables within the automations that can be used to confirm if an activity is already in progress.
For instance, you can create an isActivityRunning boolean variable that is automatically set to false by default. When the automation is triggered, the automation checks to see if isActivityRunning set to false. If it is set to false it changes the boolean value to true and proceeds with the automation logic. Setting the boolean variable to true, will block the activity from being executed twice with multiple clicks.
If the automation is triggered by the click again and the variable is set to true, it goes out the true path of the variable and does nothing.
Using the Activity Completed event, you can then automatically set the boolean variable back to false, once the activity is completed.
The behavior you are seeing is by design. The activity will complete prematurely if your automation steps encounter unhandled exceptions. You will need to figure out a way to resolve the exceptions or catch them to prevent early termination of your activity.