The following pertains to UiPath version 2023.10.4.
I’m trying to invoke Get Queue Items activity by dynamically setting the QueueItemStates property in code in order to avoid having to insert multiple instances of the activity along with conditional statements to cover all checkbox combinations. I’m programmatically preparing the activity instance using following assignments and finally executing the activity using WorkflowInvoker.Invoke().
GetQueueItems activity = New GetQueueItems With {
.QueueName = "myQueueName",
.Top = 100
}
activity.QueueItemStates = QueueItemStates.New
IEnumerable(Of QueueItem) ienumQueueItems = WorkflowInvoker.Invoke(Of IEnumerable(Of QueueItem))(activity)
Trying to invoke the activity this way will always fail with the exception specified in the message title. Note that if I run the same activity as a classic activity block, everything works just fine…no exceptions are thrown and queue items get retrieved. So it seems there’s something about the code-based approach that works differently behind the scenes.
I’m really curious as to why preparing and running the activity with assignments doesn’t work while executing the activity block does. I’ve checked the Get Queue Items activity’s code in a decompiler and I haven’t been able to find an obvious reason. The only hint I’ve found is that the exception is caused by context.GetExtension<IWorkflowRuntime>().OrchestratorSettings.ConfigurationUrl
string property not being available or having been set.