In our logic we are checking if there is any new items present in the queue to be processed. If not present then we don’t execute the InitAllApplications workflow.
And then it goes to the End state where we have all close applications logic. But as there is no applications opened it doesn’t find anything to close and throws exception.
Best practice is : whenever you modify the REFramework, you keep track of those changes and have appropriate logic to handle your changes in the following stages.
A simple solution:
Since you have modified the REFramework files when starting the process, you could just make an additional variable FoundQueueItems (Boolean) at the end of your logic check, which you could use in the CloseAllApplications.
In CloseAllApplications, If FoundQueueItems (True) → Then Invoke CloseAllApplications, Else Do Nothing. That way you know your process would perform the required stages and in the end close all applications.