Home > Class Reference > ENSLIB namespace > %SYSTEM.Process

%SYSTEM.Process

class %SYSTEM.Process extends %SYSTEM.Help

The %SYSTEM.Process class allows manipulation and display of the current process. Some of the class methods defined here have restrictions on where they may be called. Read the descriptions carefully.

There are two different syntaxes that can be used to call the class methods in this package: one uses the usual ##class syntax and the other uses $system. Here are two examples of calling ThrowError to signal the <UNIMPLEMENTED> error.

  do $system.Process.ThrowError(22)
  do ##class(%SYSTEM.Process).ThrowError(22)
  

Method Inventory (Including Private)

Methods (Including Private)

classmethod AsyncDisconnectErr(switch As %Boolean) as %Boolean
The AsyncDisconnectErr(switch) class method specifies the asynchronous disconnect error handling for the current process. AsyncDisconnectErr is only applicable to Telnet connections on Windows. It has no effect on any other device type or operating system.

For the asynchronous disconnect error switch to be operational, the DisconnectErr() class method must set disconnect error switch to 1 for the current process.

Parameters

switch -- a boolean value that specifies the default mode for asynchronous disconnect errors:
0 -- the process receives a <DSCON> error at the next READ or WRITE command.
1 -- The process receives an asynchronous <DSCON> error immediately when a disconnect occurs on the device. This error occurs at the next command executed. HANG commands will be interrupted.

Invoking AsyncDisconnectErr() without specifying the switch parameter returns the current switch setting.

Return value -- the switch state prior to calling the AsyncDisconnectErr method.

classmethod AsynchError(switch As %Boolean) as %Boolean
The AsynchError(switch) class method specifies whether asynchronous errors can interrupt the current process.

Parameters

switch -- a boolean value that specifies the process behavior in response to asynchronous errors:
0 -- disables the reception of asynchronous errors.
1 -- enables the reception of asynchronous errors. (1 is the usual default)

Invoking AsynchError() without specifying the switch parameter returns the current switch setting.

Return value -- the switch state prior to calling the AsynchError method.

classmethod BatchFlag(switch As %Boolean) as %Boolean
The BatchFlag(switch) class function specifies either batch or interactive status for the current process. This allows you to balance resources more effectively.

Parameters

switch -- a boolean value that controls the status of the issuing process:
0 -- Clears batch status and gives the process interactive status. (0 is the usual default)
1 -- Gives the process batch status.

Invoking BatchFlag() without specifying the switch parameter returns the current switch setting.

Return value -- the switch state prior to calling the BatchFlag method.

classmethod BreakMode(switch As %Boolean) as %Boolean
The BreakMode(switch) class method enables or disables the processing of argumentless BREAK commands by the current process.

Parameters

switch -- a boolean value that specifies the default behavior of argumentless BREAK:
0 -- Treats an argumentless BREAK as a no-op.
1 -- Executes BREAK on an argumentless BREAK. (1 is the usual default)

Invoking BreakMode() without specifying the switch parameter returns the current switch setting.

Return value -- the switch state prior to calling the BreakMode method.

classmethod Broadcast(pid As %Integer, message As %String, timeout As %Integer, noxy As %Boolean) as %Boolean
The Broadcast(pid,message,timeout,noxy) class method sends a message to the principal device of the process you indicate.

Broadcast passes the message to the target process. The target process then writes the message to its principal output device. The target process must be running the Cache kernel. If you send a message to your own process, you do not see the message on the screen of your principal device.

Broadcast does not add any carriage controls to the message it sends. To include any carriage control (carriage returns or line feeds), you must include them in the message, using $CHAR(13) and $CHAR(10).

%SYSTEM.Process.Broadcast complements %Library.Device.Broadcast. %Library.Device.Broadcast sends a message to a specified device while %SYSTEM.Process.Broadcast sends a message to the principal device of a specified process. Be sure that you use the right function for the right purpose.

Parameters

pid -- The Process ID of the target process. The System Management Portal provides a Processes option, which list the pids of all running processes. Select [Home] > [Processes].
message -- The message to send, specified as a string.
timeout -- Optional -- An integer specifying the number of seconds to wait before timeout. If omitted, no timeout occurs.
noxy -- Optional -- If 0, $X and $Y are updated in the receiving process to indicate the location of the end of the broadcast message. If 1, $X and $Y are not updated. The default is 0. This parameter does not apply to OpenVMS systems, which do not update $X and $Y following a broadcast message.

Return value -- 1 if pid belongs to a Cache process and the message was sent to that process; 0 otherwise.

classmethod CSPSessionID(pid As %Integer = "") as %String
The CSPSessionID(pid) class method returns the CSP session ID of the client that initiated the connection to a process.

Parameter

pid -- Process id of the process being queried
Current process, $JOB, if parameter is missing

Return value -- the CSP session ID of the client that initiated the connection to the specified process.

classmethod CallingDatabase() as %String
The CallingDatabase() class method returns the directory name of the database that contains the routine that made the last DO or user-defined call to the current routine invoking this function. If no calling routine exists, CallingDatabase() returns the null string.
classmethod CallingRoutine() as %String
The CallingRoutine() class method returns the name of the routine that made the last DO or user-defined call to the current routine invoking this function. If no calling routine exists, CallingRoutine() returns the null string.
classmethod ClientExecutableName(pid As %Integer = "") as %String
The ClientExecutableName(pid) class method returns the name of the executable that called a process.

Parameter

pid -- Process id of the process being queried
Current process, $JOB, if parameter is missing

Return value -- the executable name of the client that initiated the connection to the specified process

classmethod ClientIPAddress(pid As %Integer = "") as %String
The ClientIPAddress(pid) class method returns the IP address of the system that initiated the connection a specified process.

Parameter

pid -- Process id of the process being queried
Current process, $JOB, if parameter is missing

Return value -- the IP Address of the system that initiated the connection to the specified process.

classmethod ClientNodeName(pid As %Integer = "") as %String
The ClientNodeName(pid) class method returns the name of the client system that connected to, or initiated the connection to, a process.

Parameter

pid -- Process id of the process being queried
Current process, $JOB, if parameter is missing

Return value -- the system name for the client that connected to, or initiated the connection to, the specified process