PrcsApi Class Methods
In this section, we discuss the PrcsApi class methods. The methods are discussed in alphabetical order.
Syntax
getAllFileNames(PrcsInstance)
Description
Use the getAllFileNames method to return a list of all the files names detected by the scheduler to intiate this process. The names are returned in an array of string, as full path names.
Parameters
Field or Control |
Definition |
---|---|
PrcsInstance |
Specify the process instance for which you want to get all the associated file names, as a number. |
Returns
An array of string containing all the files names associated with the specified process.
Example
The following example returns a list of file names.
/* QE_OPT_AET is the state record for the application engine program in this example */
import PT_PRCS:API:*;
Local PrcsApi &api = create PrcsApi();
Local File &FileIO, &FileLog;
Local array of string &strList = &api.getAllFileNames(QE_OPT_AET.PROCESS_INSTANCE);
/* api call needs process instance as parameter */
/* the api returns list of file names matched by the scheduler for this instance */
For &i = 1 To &strList.Len
&IOFilename = &strList [&i];
&FileIO = GetFile(&IOFilename, "r", "a", %FilePath_Absolute);
&FileIO.Delete();
&FileIO.Close();
End-For;
Syntax
notifyToWindow(PrcsInstance, Message)
Description
Use the notifyToWindow method to display additional messages to the window.
If a process is not defined as going to Window, using this method has no effect. The purpose of this method is to display additional messages to the window when an Application Engine process (no other process type) is run to Window.
Parameters
Field or Control |
Definition |
---|---|
PrcsInstance |
Specify the process instance for which you want to display messages, as a number. |
Message |
Specify the message you want displayed, as a string. |
Returns
A number: 0 if method failed.
Example
The following PeopleCode would be in a step in an application engine program.
import PT_PRCS:API:*;
Local PrcsApi &api = create PrcsApi();
/* QE_AESTATUS_AET is the sate record for this Application Engine program */
&nret = &api.notifyToWindow(QE_AESTATUS_AET.PROCESS_INSTANCE, "Hi There! this is First step.");
/* this displays the message on the window */