If you can call the PeopleCode outside of the loop, use that approach to increase overall performance. The AESection PeopleCode class enables you to change the properties of an Application Engine program section dynamically, without having to modify any of the Application Engine tables directly.
This capability enables you to develop rule-based applications that conform dynamically to variables that a user submits through a page, such as the Application Engine Request page.
The AESection class provides the following flexibility:. Portions of SQL are determined by checks before a run. The logic flow conforms as rules change, and the program adjusts to the rules.
Ensure that you require primarily dynamic capabilities with the SQL your program generates. Ensure that the rules to which your program conforms are relatively static or at least defined well enough that a standard template could easily accommodate them. You can add a PeopleCode action to your generated section, but you cannot alter the PeopleCode. The AESection class is designed to use for online processing.
Typically, dynamic sections should be constructed in response to a user action. Note: If you make a synchronous call, users cannot perform another PeopleSoft task until the Application Engine program completes.
You should ensure that the program will run to successful completion consistently within an acceptable amount of time. If an Application Engine program called by CallAppEngine terminates abnormally, the user receives an error, similar to other save time errors, that forces the user to cancel the operation. If the program was successful, it returns a zero; if the program was unsuccessful, it returns a value other than zero. The file layout class enables you to perform file input and output operations with Application Engine using PeopleCode.
A file object enables you to open a file for reading or writing , read data from a file, or write data to it. Using the combination of the file class and Application Engine provides an effective method to integrate or exchange the data stored in a legacy system with your PeopleSoft system. The file class facilitates the creation of a flat file that both your legacy system and Application Engine programs support. An Application Engine program running on the application server uses a file object to read the file sent from the legacy system and to translate it so that the file can update affected PeopleSoft application tables.
For the PeopleSoft system and the legacy system to communicate, you first must construct a file object that both systems can use to insert and read data. Attain rowset and record access for a file using a file layout definition. You create the file layout definition in Application Designer, and it acts as a template for the file that both systems read from and write to. This file layout definition simplifies reading, writing, and manipulating complex transaction data with PeopleCode.
Generally, use the file class and Application Engine combination when you cannot implement the PeopleSoft Integration Broker solution. You also can use it to upgrade Application Engine programs from previous releases. GNT file. Initializes the specified state record in memory. Updates the state record as necessary, issues a commit, and then disconnects from the database after your program completes. If you add field names, Application Engine enables you to pass state record values to the called COBOL program and to get changes passed back to the calling PeopleCode program.
If you do not pass initial values using state record fields, you need to insert the appropriate SQL in your called COBOL module to retrieve the appropriate values.
Then, to return any updated values to the calling Application Engine program, you must insert the appropriate SQL into a PeopleCode program. If you include extra SQL processing and use non-state record values, for consistency purposes, creating a custom executable file might be a better approach. This table describes each parameter in the RemoteCall function:. This parameter makes the remote call from Application Engine distinct from a normal remote call.
When you enter this parameter, in effect you enable the following parameters, some of which are required. PTPECOBL then reserves space in memory for all of the fields in the state record, regardless of whether they will ultimately store values for processing.
The quoted field names you specify must exist in the specified state record. The corresponding value can be a PeopleCode variable, a record. When using RemoteCall and an Application Engine program:.
Run a commit in the step immediately preceding the step containing the RemoteCall PeopleCode action and also in the step containing the Remote Call PeopleCode action.
These two actions enable the COBOL process to recognize the data changes made up to the point that it was called, and minimizes the time when the process might be in a non-restartable state. If the intent of your COBOL process is to update the value of a passed state record field, then the calling Application Engine PeopleCode is responsible for ensuring that the state record field is modified, and the Application Engine program is responsible for committing the state record updates.
Because the work in COBOL will have already completed and been committed, will your module ignore a duplicate call or be able to undo or redo the work multiple times?
You face similar issues when you run a remote call from PeopleCode. Typically, when a COBOL program updates the database and then disconnects or terminates without having issued an explicit commit or rollback, an implicit rollback occurs. Without an explicit commit, the database does not retain any updates. Note: By default, RemoteCall does not generate any log files after the program completes.
To generate and retain the. See RemoteCall. When using APIs, remember that:. If you called a component interface from an Application Engine program, all the errors related to the API are logged in the PSMessage collection associated with the current session object. If you sent a message, errors are written to the message log and the Application Engine message log.
If an Application Engine program called from a message subscription PeopleCode encounters errors and the program exits with Exit 1 , the error is written to the message log and is marked as an error. This function commits pending changes inserts, updates, and deletes to the database. When using CommitWork, remember that:. This function can be used only in an Application Engine program that has restart disabled. The CommitWork function is useful only when you are processing SQL one row at a time in a single PeopleCode program, and you need to commit without exiting the program.
In a typical Application Engine program, SQL commands are split between multiple Application Engine actions that fetch, insert, update, or delete application data. You use the section or step level commit settings to manage the commits. If the Process Scheduler is booted using a shared drive on another machine and you intend to call a WINWORD mail merge process from Application Engine, then you must do one of the following to ensure successful completion:.
Configure the Process Scheduler to run Application Engine programs using psae instead of psaesrv. Ensure the generated document is saved locally, not on a shared network drive. The following topics provide examples of common ways that you can use PeopleCode within Application Engine programs. For example, suppose the following SQL exists in your program:. Using PeopleCode, you could insert this code:. The advantage of using PeopleCode is that no trip to the database occurs.
Why is the record description is important when creating a new record? They want you to determine if the PeopleSoft architecture will be affected. Referring to the above, how do you ensure the Web client will perform correctly once these directory structures have changed?
How would you run SQL Alter to alert you to discrepancies between your record definitions and underlying SQL tables, without actually performing changes to the object in the database? How many security layers are involved in the PeopleSoft environment? How are PeopleCode programs saved within the database?
What is PeopleSoft's recommended way to access panel groups and the business logic associated with them outside of PeopleSoft online panels? Your application users are experiencing problems with one of the customizations your development team has recently worked on. The customization involved changes to a PeopleCode object within the database.
You decide to use Application Reviewer to debug the PeopleCode. When you try to start the Application Reviewer you receive an error that the Reviewer cannot be started. Any PeopleCode event that fires as a result of a ScrollSelect or one of its relatives function calls, or a Select or one of its relatives Rowset class method. Think-Time Functions. Tokens are separated by unquoted space characters.
Single or double quote characters can be used for quoting. Both types of quotes are treated equivalently, but the starting and ending quotes for a quoted portion of a token must match. A quoted string may not contain quotes of the same type but a single quoted string can contain double quote characters and vice versa.
A single token may consist of multiple adjacent quoted characters There must be no spaces between the quoted fragments. Unterminated quoted fragments will result in an error. Note: PeopleCode strings will require two double quote characters within a string to embed a double quote character.
If you specify a Boolean value, it indicates whether to execute the external program synchronously or asynchronously. Values are:. If you do not specify a value, the program executes asynchronously.
The value specified is made up of the addition of these predefined constants. Program executes asynchronously the default. What is returned depends on what you specified for the second parameter. If you specified a Boolean, a Number value equal to the process ID of the called process is returned. If you specify constant values, the returned value contains the value of the exit code of the program executed using this function, unless you have executed the program asynchronously.
The following example demonstrates executing a program where the path to the executable contains spaces and a single parameter containing space characters is passed. This is an example of executing a program with a parameter that contains space and single quote characters. The second parameter is enclosed in double quotes so that the single quote and space characters are passed correctly.
Suppose your executable is program. The first parameter is -p and the second parameter is customer's update. This is an example of executing a program with a parameter that contains space, single quote, and double quote characters. The second parameter consists of several adjacent quoted fragments. The first fragment is enclosed in double quotes so that the single quote and space characters are passed correctly and the second fragment is enclosed in single quotes so that the double quote and space characters are passed correctly.
Note that there are no spaces between the quoted fragments. This function returns an array of string containing dynamic members UserIds. Typically, this function is used by an Application Engine process that runs periodically and executes the role rules for different roles. It could then write the results of the rules a list of users into the security tables, effectively placing users in certain roles based on the rule.
An array of string containing the appropriate UserIds. The following saves valid users to a temporary table:. Use the ExecuteRoleQuery function to execute the Query rule for the role rolename , passing in BindVars as the bind variables.
This function returns an array object containing the appropriate user members UserIds. A list of bind variables to be substituted in the query. These bind variables must be strings. You can't use numbers, dates, and so on. An array object containing the appropriate UserIds. Use this function within fluid applications only. Use the Exit statement to immediately terminate a PeopleCode program. If the Exit statement is executed within a PeopleCode function, the main program terminates.
Note: Exit 1 does not rollback iScript transactions. Use this parameter to rollback database changes. Generally, this parameter is used in PeopleCode programs that affect messages.
When used with a message, all database changes are rolled back, errors for the subscription contract are written to the subscription contract error table, and the status of the message is marked to Error. All errors that have occurred for this message are viewable in the message monitor: even those errors detected by the ExecuteEdits method.
Note: This function takes only numeric values. It fails if you use a Boolean value, True or False. The following example terminates the main program from a For loop:. Exp returns the constant e raised to the power of n where n is a number. The constant e equals 2. The number n is the exponent applied to the base e. Exp is the inverse of the Ln function, which is the natural logarithm of x. Returns a Number value equal to the constant e raised to the power of n.
Inline bind variables can be included in any PeopleCode string. An inline bind variable is a field reference in the form recordname. The inline bind variable references the value in the field. Use the ExpandBindVar function to expand any inline bind variables that it finds in str into strings converting the data type of non-character fields and returns the resulting string.
This works with inline bind variables representing fields containing any data type except Object. It also expands bind variables specified using additional parameters. See SQLExec. A string containing one or more inline bind variables. Returns a String value equal to the input string with all bind variables expanded.
Use the ExpandEnvVar function to convert any environment variables that it finds within string into String values and returns the entire resulting string.
A string containing an environment variable. Returns a string equal to string with any enclosed environment variables expanded to their values. Prior to PeopleTools 8. For databases that offer SQL statement caching, a match was never found in the cache so the SQL had to be re-parsed and re-assigned a query path. To process skipped parameter markers, each parameter marker is assigned a unique number.
To process these exceptions, use the ExpandSqlBinds function. This function does the bind variable reference expansion, and can be used within a SQLExec statement or on its own.
You should use ExpandSQLBinds only for those parts of the string that you want to put literal values into. Specify the string you want to do the bind variable reference expansion on. The following example shows both the original string and what it expands to. For example, if your SQLExec is this:.
Skip to Main Content. Related Links Typographical Conventions. Else Description Use the Else keyword to create an else clause in an if block. Related Links DisableMenuItem. PrePopup Event. Understanding Internet Script Classes. RequestURI "? URI "? Example The following encrypts a field if it contains a value. Related Links Decrypt. PeopleSoft Online Security.
Related Links Adding Node Definitions. Related Links MessageBox. Related Links DoModal. Related Links DoModalComponent. Related Links DeQueue. Errors in RowDelete When the user attempts to delete a row of data, the system first prompts for confirmation.
Error in RowSelect The behavior of Error in RowSelect is totally anomalous, and is supported only for backward compatibility. Related Links MsgGet. Related Links EscapeJavascriptString. Returns A string containing the original plus text plus WML escape sequences. Considerations Using When Clause Generally, you use the When clause without a semicolon at the end of the statement.
Exact Syntax Exact string1 , string2 Description Use the Exact function to compare two text strings and returns True if they are the same, False otherwise. Returns Returns a Boolean value: True if the two strings match in a case-sensitive comparison. Related Links Len. Related Links Think-Time Functions.
Exec "program. Related Links Declare Function. Understanding Exception Class. Returns An array of string containing the appropriate UserIds. Related Links ExecuteRoleQuery.
Description Use the ExecuteRoleQuery function to execute the Query rule for the role rolename , passing in BindVars as the bind variables. BindVars A list of bind variables to be substituted in the query.
Returns An array object containing the appropriate UserIds. Related Links SearchSave Event. Related Links Break. Exp Syntax Exp n Description Exp returns the constant e raised to the power of n where n is a number. Returns Returns a Number value equal to the constant e raised to the power of n.
Related Links Ln. Parameters Field or Control Definition str A string containing one or more inline bind variables. Returns Returns a String value equal to the input string with all bind variables expanded. Parameters Field or Control Definition string A string containing an environment variable. Returns Returns a string equal to string with any enclosed environment variables expanded to their values.
0コメント