Hi Jakob,
I feel like you or someone else brought this up a year ago or so, and I found it an interesting idea then as well. Doing things this way does kind of make intuitive sense, but I think in practice, it would end up with unexpected results. This next sentence or two may not be true for all Blue Prism versions, but I believe it is still true. Blue Prism object instances that are called directly by the running process are instantiated at the moment the session starts, not when one of its actions are run, so I believe that would mean the app you want to attach to has to already be open before the Blue Prism session begins. It works like a Constructor, meaning that it will only ever run once for that Object instance which also means that failures cannot be retried for this, and you would still need an Attach page to handle attempting to attach to the app again upon a retry. Have you tested this? I feel like it might not work, but I mean if it's working for you then I would be interested in looking into it more.
One standard practice for when to attach is to have an unpublished Attach page and then subpage references to that Attach page at the beginning of every single published Action. Most of the time this means the Attach page is run and nothing happens because it's already attached, but this also helps with debugging when you want to open an Object and run a quick test. This would cause it to attach to the running instance of your app for the debug test.
So, just thinking through this, wouldn't your Initialise page throw an error when your session starts and the app hasn't been opened yet? Another thought here is that you possibly could see different results depending on how nested your action calls are. I'm not sure 100%, but I think Blue Prism may not instantiate all object instances that are nested until they are called initially. I need to test this stuff again because things may have changed.
------------------------------
Dave Morris
3Ci at Southern Company
Atlanta, GA
------------------------------
Dave Morris, 3Ci at Southern Company