I would like to have a different logic for the process when it’s started from Studio from Debug and Run mode. There was already a similar question but solution was to use a Studio UI which I would like to avoid.
pseudo code
If Job.Mode = "Debug"
Do this
Else
Do something else
Very strange requirement in my opinion, but either way, details of that are held on the RobotRunner in the executor. You cannot expose any values from them without using a custom activity. I’d suggest rethinking your approach, perhaps you can explain why you think you need to do this / your use case?
Hello @Jon_Smith. Thanks for pointing to RobotRunner. I will explore that.
Use case:
I am working on an attended process. On one of the steps it should prompt user a Form to enter some information.
I don’t need to display a Form to the developer while Debugging and default values can be used. But I would like to have a Form in Run mode.
I wouldn’t bother exploring it, like I said, its running on the executor and cannot be exposed natively in UiPath. You need a custom activity in .Net to get close to it.
I think your use case indicates you do not need to detect the ‘mode’.
I would suggest, instead, use a mock, you can easily then mock the activity which will prompt the user and bypass it with default values.
@Jon_Smith Could you please elaborate more on the ‘mocking’. I can’t fully understand how it may help here. I need one or another set of data (or set of actions) to be used based on the Mode
You want to skip the display form action and instead populate the values with defaults.
So, you mock the workflow and surround the ‘Display Form to User’ activity with a mock, on the right hand side you can add the activities to provide any default values.
Your original workflow stays intact and clean and the mock will be automatically kept in sync when any changes are made.
When the dev wants to test they can run the mock and it will avoid displaying the form as per the mock activity displayed.