What is the relation between Activities and their Classes in ExpressionEditors? e.g. GetCurrentJobInfo

It would be great if I understand how the Activities work with their classes. Here as example: GetCurrentJobInfo

With the Activity GetCurrentJobInfo → output var_crtJobInfo, it works fine and I can use var_JobInfo.ProcessName

Because i have more code in ExpressionEditor, it would be great if we can use the Class GetCurrentJobInfo.
I tried e.g.:
( New GetCurrentJobInfo() ).Result
But it’s type OutArgument(Of CurrentJobInfo) instead type CurrentJobInfo
How can I get please just in ExprEditor, without the Activity, a similar variable var_JobInfo ?

It would be great, if you can share more details on your over-all goal and motivations.

the coding of activities can define Classes. These classes will not mandatory define a public constructor. We can touch some hints e.g. by:

So the Activity code internally will instantiate the object and is returning it via the out_argument.

Thanks @ppr.
The generally goal is to understand how the activities and their classes work and if i can use the classes in the Expression Editors. Here, I see the Class UiPath.Core.Activities.GetCurrentJobInfo

Special here, the goal is as I wrote: How can I generate in Expression Editor a variable CurrentJobInfo, similar the Output of the activity.

In your example, i cannot understand why can we not use:
New CurrentJobInfo()

as mentioned:

and this we can interpret in a first touch from shown error message

correct. the constructor is not public. i.m.o it could be public…
this means, we cannot generate just from ExpressionEditor a variable var_jobInfo similar the output of the activity? :frowning:

when the implementation of the class is coded as interpret, then the constructor is not public usable and using new …() is blocked.

sorry if I’m stubborn, CurrentJobInfo is not public, but GetCurrentJobInfo is public (as the activity) and we can use New GetCurrentJobInfo(). I dont understand why cannot we use it in ExprEditors to get the currentJobInfo

Maybe reflection analysis will help you for a more deep dive:
grafik

GetType(UiPath.Core.Activities.CurrentJobInfo).GetConstructors(BindingFlags.Instance Or BindingFlags.Public Or BindingFlags.NonPublic)(0).IsAssembly