So I’m not sure if I’m doing this incorrectly, or this just isn’t something supported with UiPath.
What I’m trying to do: Create a wrapper for all UiPath.System.Activities that accept a Dictionary<String, InArgument> so that we do not have to manually create those dictionaries in Studio, but can dynamically update them as the process develops. Currently, I’m only targetting Set Transaction Status and Add Log Fields.
I had difficulty in doing this and the steps below are for a Log Message activity.
Steps:
lmActivity = new UiPath.Core.Activities.AddLogFields()
activityArguments = new Dictionary(Of String, Object)
lmActivity.Message = new InArgument((object)(“Testing…”))
activityArguments(“Message”) = new InArgument((object)(“Testing…”))
lmActivity.Level = new InArgument(LogLevel.Info)
activitiyArguments(“Level”) = LogLevel.Info
result = WorkflowInvoker.Invoke(lmActivity, activityArguments) → Error Here
The error I keep getting is “Assign: Object reference not set to an instance of an object.”
UiPath.Core.Activities.SetTransactionStatus - Analytics and Output fields; P.S on this activity’s note, is there a reason why you can’t set these on exceptions? Feels annoying to JsonConvert from Exception Details if we want to preserve state-dependent data for transactions between retries. Am I just dumb? Is there another way to achieve this functionality?
UiPath.Core.Activities.AddLogFields - Fields should be able to be dynamic?
Thank you for clarifying. We should indeed have a look, given that we try to allow users to parametrize as much as possible in their workflows. I saved it for our team to consider.
As to the:
Could you maybe explain your issue here with a screenshot? I will admit that I didn’t play around with this particular activity much to immediately get the issue here.
Okay so this activity is the one that is used to update the status of a queue item to orchestrator from a robot.
There are 2 different meaningful statuses that the queue items can be: Successful and Failed.
From my experience, I’ve been able to set the Analytics and Output fields when an item is successful, allowing us to update that queue item with information at the end of the transaction (ie. saving the order # after creating an order)
Thing is, when implementing retries, if you have other steps past saving the order # and it failed at one of those steps, you don’t want to keep making new orders, you’d want to retain that order number and maybe other information to start off where you left off.
Based on the current activity, we only have reason, and details that we can customize to be able to retain that state-dependent information.
It would be nice to be able to have a dictionary that we can set for failed transactions as well so that we can retain data in a convenient manner.
I already have workarounds for this one, so it’s not too big a deal.