Get Process Info

Bronze Certified

Custom Activity

0 reviews

11

Get Process Info

Bronze Certified

Custom Activity

0 reviews

11


Summary

This custom activity exposes information about the internals of running job to the workflow (JobID, ProcessName, etc).

carouselImage0

Overview

This custom activity exposes information about the running job to the workflow.

You can get JobId, ProcessName, WorkflowFile and ProcessVersion at runtime.

This internal information is very useful for instance if you need your process to know its name at runtime, but you don't want to hardcode the process name in your workflow. This activity will gather that information dynamically.

Another interesting use of this activity is in determining how the automation is being triggered from within a library.
  • A process triggered from Assistant or from the Orchestrator (Unattended) will have a Environment. CurrentDirectory in %userprofile%\.nuget\packages. A process triggered from Studio/StudioX will have a CurrentDirectory somewhere else.
  • Whenever you are within in a library, the Environment.CurrentDirectory is the folder of the library. There is no way to know the location from which the process is running.
  • This custom activity's WorkflowFile will always point to the calling Process's workflow (not the Library's), hence giving away the source of the calling process .

Benefits

You will not need to hardcode any values. All of this information is extracted at runtime.

This can be used, for instance, to store the process name in a QueueItem that is shared across multiple processes.

See more examples above.

Published: 02 Nov 2021 | Updated: 21 Sep 2021

Trusted Source


License

By clicking download you agree to the following license.


Code Language

Visual Basic


Runtime

Windows Legacy (.Net Framework 4.6.1)


Tags

JobId

Compatibility

Studio: 19.10+


Dependencies

UiPath.Activities.Api >= 20.4.0


Similar Listings