Srinu
(srinu.619)
September 7, 2017, 10:38am
1
Hi All ,
i have invoked two files . I applied try catch to my main file .
in log file i want to show the process name and main file and where the error occurs that activity name and it’s flow name(means it’s sub flow).
Please help me o this.
Thanks
Srinivas
I may have found a partial solution for you here:
I’ve found a roundabout solution to this question because it was also plaguing me. The thing is that it only works if you are running the project from Orchestrator
If you assign your variable to environment.currentdirectory when running off of the Orchestrator, the directory it creates "looks like this:
C: \ Users \ username \ .nuget \ packages \ projectname \ projectversion \ lib \ net45
If you want the process name just use split(environment.CurrentDirectory,"\ ")(5)
If you want the packag…
Not sure how to get the XAML file though
Best way of retrieving the process name for me is to Deserialize the project.json with the UiPath.Web.Activites Library.
jsonString = System.IO.File.ReadAllText(Directory.GetCurrentDirectory() + “\project.json”)
and then assign from the jObject you get from the Deserialize-Activity
NameOfProcess = jsonObject(“name”).ToString
I’m still not sure how to retrieve the Environment though. Any ideas? I ran into the same problem
c.ciprian
(Ciprian Constantinescu)
January 31, 2020, 2:29pm
5
The problem is when you have a library… I have my project called test, but uses a library and calling GetCurrentDirectory, I get the library’s folder
c.ciprian
(Ciprian Constantinescu)
February 7, 2020, 2:56pm
6
Solved it with
Process.GetCurrentProcess.MainWindowTitle
3 Likes
For the record, this line right there worked for me.
Situation: not on orchestrator but needed a workaround for a logging.