2 topics: Custom activities: C# source code for existing UiPath activities / Built-in Logging

For some activities, I think it would be amazing if they had optional Log parameter, basically multiple activities in 1. An optional LogBefore and LogAfter parameter to log before / after the activity is executed. This to reduce visual clutter in the code from a bunch of Log activities and make the code more readable. This could somewhat be achieved with Library items but would be a huge hassle due to the large amount of activities, also, adding Log parameters to containers such as sequences can not be done with a Library item.

I would love to see this for the Sequence. 2 optional parameters: 1 that logs at the start of the sequence, and 1 that logs when the sequence ends. Or, for example, the Assign activity with 2 built-in log parameters could be used to log the value of a variable before and/or after the Assign activity has executed.

Things like this would massively help debugging, while also cleaning up your code from a bunch of Log activities! Good code requires a lot of logging so this would make a huge difference in readability.

Since it does not exist, I would like to attempt to create a Custom Activity for the Sequence / Assign activities. They would work exactly the same as the normal ones, but include logging as I described. I am wondering, is it possible to get the C# source code of Uipath activities somewhere / decompile it? Or would I have to build it from scratch?

Hi, we can logging inside our custom activities. I think the best way is to use uipath robot API with IExecutorRuntime reference:

var apiRuntime = context.GetExtension<IExecutorRuntime>();
apiRuntime.LogMessage(new LogMessage
{
   EventType = traceEventType,
   Message = "your message"
});

Here we have documentation Building Activities Project Settings.

For decompilation of dll I use DotPeek.
It is possible to read dlls from unpacked nugets, but be careful not to violate any license

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.