In coded workflows, you are able to interact with Orchestrator easily via the system property/API in the CodedWorkflowBase class. Here is a simple way you can make Orchestrator accessible in your coded workflow services when using dependency injection.
-
First, create the interface IInitializeableService with the following methods
-
Next, make sure the CodedWorkflow partial class implements this interface
-
Now, you are able to easily interact with Orchestrator at runtime, and use all the methods in the CodedWorkflowAPI
I’d love any feedback on improving this. Trying to use more of coded workflows, but it does not quite have all the bells and whistles a regular .NET application has.
As a side note, I’d love for UiPath to provide some material on how we can do testing/mocking with services/dependency injection in coded workflows


