In my latest Library, at the start of every Sequence (.XAML files) i’m asking for CurrentJobInfo. This way I can extract the WorkflowName being the active .XAML file running.
The idea being:
Each sequence ask for this information
the whole sequence is inside a Try/Catch
Catch just rethrow the same exception by adding the WorkflowName as a tag before the exception.message
When using the Library, it works as it should.
When using the Process that is calling the library, some activities from the Library are logging fine, but others are instead logging the WorkflowName that is CALLING the said Library.activity.
Therefore instead of having in log :
“Start : ThisLibraryActivity_01”
I get :
“Start : Process”
Do you have any idea what could cause this, and how to fix it ?
From LIBRARY- Log being the name of .XAML : “Start : YZ_0_Invoice_NavigateTo”
Then i use WF_Prefix to use in catch as manual-rethrow like : New System.exception(WF_Prefix + exception.message)
Then in the PROCESS i’m calling the activity
But it then sometimes log : “Start : Process” from the LIBRARY
So from what you said, i would need a CurrentActivityInfo or something close to that
I’m still not sure why some activities LOGS the values I want, and some other don’t. They’re all made from the same template.
Tagging in since you expressed an interest in the code some of us discussed a couple of years ago regarding getting alot of this metadata on a running process.
It looks to me like the Get Current Job Info you have is perhaps an old one (I base this on the lack of a custom icon).
What version of the UiPath.System.Activities are you using? Does it work if you use a higher version?
You mention it ‘sometimes’ works, but is there a pattern, is it in certain libraries it works but not in others, or some workflows in a library but not others?
I’m using UiPath.Systeme.Activities 23.4.5 for all our Processes and Libraries
On Studio 2023.4.2
I did not tried any updates as I wish all the Processes and Libraries to get the same, and not create too much impact. But it might be the answer
Is there one version you’d recommand that is stable and reliable ?
And for the ‘sometimes work’ issue, it’s one Library not working with One Process (i’m just developping this new feature)
So it’s some workflow in this one library not logging correctly, but other would
Ok so i’ve found why some are Logged and some are not.
If I call from Process an activity in the Library, it will log “ProcessName”
If I call from Process an activity in the library, calling another activity from the library, then this second activity will be log “LibraryName”
Nested .xaml in library are considered to be the “active workflow”.
But a direct .xaml is still considered as an activity, and what I’m trying to achieve fails…
Is there a workaround this ?
I want the START/END log of each activity in the libraries to LOG the XAML.FileName directly, so it’s easier for the team.
If you can make a demo library, with some workflows that repeat this behaviour, I can test out my code that reads the workflow name you referenced in the other topic and see if that is able to get the workflow name consistently and therefore if its worth you pursuing.
I have wanted to publish that code to the marketplace, but there is no-one at my company who remembers the login details for us on the Marketplace (last stuff was posted before I joined).
I’ve added some log to ease the task when you’ll call the LIB from any given process.
Activities :
ALPHA : Logs ALPHA
BETA : Logs BETA
NESTED : Logs NESTED, calls both ALPHA and BETA
As you already shared your raw code on the other topic (link for the long term viability of this topic), I guess i could make it a nugget package somehow if it’s working for my problem
I am now curious why it correctly does a workflow name if its a workflow nested in the library compared to directly, unfortunately I cannot dive into that easily cause in newer Studio versions its super hard to debug these custom activities cause you cannot attach your own debugger now, so I don’t have a solution for you.
I feel like it should be possible as I think the errors do correctly identify this, but I’d need to update my activity to perhaps contextually get the workflow name based on if its a first level library activity or not (sorry its not high on my to-do list).
I still thank you so much for all the time and effort you’ve put into my problem !
It’s highly appreciated and I now know for sure it’s kinda of a dead end.
We’ll switch back to manually enter the name to be logged, it’s not that kind of a deal, but it would have been cool to be able to do it automaticly still !
Have a nice day, and I’ll hit you up if I ever found a workaround this.
as we currently stumble upon the same issue with getting the correct names from libs (hardcoded things are nothing we like) I found this discussion here.
The code I had would have used a custom library, but as discussed it also gave the same results as the other solution and would not give fully accurate values in libraries.
I believe @ijanszen1 had a neat solution using reflection that handles this, so check out his example.