Runtime properties, methods, and events
Use Pega Robot Runtime properties, methods, and events to interact with Robot Runtime in your automations. Use the Current user properties and methods to send and
receive data about the logged-in user. The following tables describe the properties and methods available for Current
user: Determines whether the user belongs to the group with the
specified name. Returns True if the current principal is a
member of the specified Windows user group; otherwise, returns
False. Note the role input parameter is case insensitive and
should indicate whether the role is built-in, machine-specific,
or domain-specific using this format: If the role parameter is supplied without the BUILTIN,
MachineName, or DomainName specifier, the method defaults to
BUILTIN. The spelling for the BUILTIN roles in string format differs from
the spelling used in the WindowsBuiltInRole enumeration. For
example, the spelling for an administrator in the enumeration is
"Administrator", not "Administrators". Use the Environment methods to exchange data with the Robot Runtime
environmnet in your automation. The following table describes the available Environment methods: Overloads can be a string or a string plus target
variable. Overloads can be the environment and
special folder, or environment plus special folder or folder
option. Overloads can be either string, string; or string, string,
variable target. Use Robot Runtime methods and events to exchange data with
projects. The following tables describe the available methods and events: Note
that the Pega RPA Service heartbeat does not rely on events to
trigger a heartbeat. Instead, the heartbeat occurs after the
AllProjectsStarted event fires -- after all the handlers in
automation are called. For best results, only do minimal
processing in an automation that is fired by this event if you
are doing it synchronously, because it delays other activities
from happening. Current user properties and methods
Properties
Property Description Authentication type Gets the type of authentication used to identify the user.
(String) IsAnonymous Gets a value that indicates whether the user account is
identified as an anonymous account by the system. (Boolean) IsAuthenticated Gets a value that indicates whether the user has been
authenticated by the system. (Boolean) IsGuest Gets a value that indicates whether the user account is
identified as a Guest account by the system. (Boolean) IsSystem Gets a value that indicates whether the user account is
identified as a System account by the system. (Boolean) Name Gets the name of the current user. UserDomain Gets the domain of the current user. Methods
Method Description Parameters Return Type BUILTIN\RoleNameHere
MachineName\RoleNameHere
DomainName\RoleNameHere
IsInRole Determines whether the user belongs to the group with the
specified WindowsBuiltInRole. See the MSDN WindowsBuiltInRole
Enumeration topic for more information. WindowsBuiltInRole role Boolean Environment methods
Method Description Parameters Return type ExpandEnvironmentVariables Replaces the name of each environment variable embedded in the
specified string with the string equivalent of the value of the
variable, then returns the resulting string. A string containing the names of zero or more environment
variables. A string with each environment variable replaced by its value.
GetComputerName Retrieves the designated name of the computer. String String GetEnvironmentFolder Retrieves the path of the environment variable. String String GetEnvironmentVariable Retrieves the value of an environment variable from the current
process. The name of the environment variable. The value of the environment variable specified. GetFolderPath Gets the path to the system special folder that is identified by
the specified enumeration. One of enumeration values that identifies a system special
folder. The path to the specified system special folder, if
available. SetEnvironmentVariable Creates, modifies, or deletes an environment variable.
The name of an environment variable. Runtime methods and events
Methods
Method Description GetDeploymentVersion Retrieves the value of the
DeploymentVersion property for the
project. GetProjectPath Retrieves the full path of the package loaded at runtime. GetRuntimeVersion Retrieves the value of the Version property for the project. This is the version
that was used when the project was last edited and saved. ReadPackageFile Retrieves the name of the file used for deployment. TerminateRuntime Use this method to unload the project and close Robot Runtime. Events
Event Description ProjectStarted This event occurs once, after a project is loaded. It should be
the default way of being notified that projects have
started. ProjectStopping This event occurs once, after the project has started. RobotNotReadyForWork Occurs when the ReadyForRobotWork property
is set to False to indicate that the robot is not ready to perform
work. RobotReadyForWork Occurs when the ReadyForRobotWork property
is set to True to indicate that the robot is available to perform
work.
Previous topic Pega components Next topic Utilities