Skip to main content

Process.GetProcessByIdAsync

Description

Gets the ProcessInfo from the connected Control Room.

Signature [C#]

Task<ProcessInfo> GetProcessByIdAsync(int processId)

Properties

Input

PropertyDescription
processIdSpecify the process ID to retrieve the process information.

Output

PropertyDescription
Task<ProcessInfo>Returns the information of a process using its Id.

Remarks

Use GetProcessByIdAsync API to get the ProcessInfo from the connected Control Room.

Example

C#
public void GetProcessById()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");

int processId = 1;

ProcessInfo process = Task.Run(() => context.Processes.GetProcessByIdAsync(processId)).Result;
Console.WriteLine("Process Name: " + process.Name);
}
C#
public IControlRoomContext LoginControlRoom()
{
IControlRoomContext context;
string connectionString;

connectionString = "ServerUrl=https://demo.onnitellibuddies.com;UserName=demoadmin;Password=password";
context = new ControlRoomContext(connectionString);

context.Open();
return context;
}