The following is intended to outline my experience and exposure to PeopleSoft’s Technologies. This is not a training document. References in this blog have been compiled from various sources like Oracle webcasts, blogs, and prototypes that I have developed over time.
Monday, March 6, 2023
Mass upload/download files
Monday, February 20, 2023
Peoplecode to zip/archive files
Following is a way to archive, compress or zip up files via peoplecode. Alternative would be to use command line calls to products like winzip, 7-zip etc. For this test I am running PT 8.59.x. The same should also be possible in slightly older Peopletools releases too, like PT 8.56.x
Oracle provides java classes that can be used for this task. This method will create a new archive file and add files to the root location of the archive or zip file.
The solution uses the following three java classes that are delivered with PeopleTools
1. java.io.FileOutputStream
2. java.util.zip.ZipOutputStream
3. java.util.zip.ZipEntry
Local JavaObject &myArchive = CreateJavaObject("java.util.zip.ZipOutputStream", CreateJavaObject("java.io.FileOutputStream", &zipFileName, True));
In the above line of code &zipFileName is the complete path of the archive file that we will create.
&fileNametoAdd - will have the complete path to the file that we will be adding to the archive.
In order to get the filename value from the file path do the following.
&fname = &FilePath [&FilePath.Len];
Friday, February 3, 2023
PS Query - Employee Photo
There are couple of options to include images in query output. In this example I am displaying employee pictures which are stored in the database (under the identification data component). I am running PT 8.59.x on HCM 9.2.
The simplest method is to include the table EMPL_PHOTO in the query and join the EMPLID field and display the EMPLOYEE_PHOTO field. On the query properties select "Image Data" that way the image is displayed in the output.
The EMPL_PHOTO table has a field called as PHOTO_SIZENAME and stores each image in 4 different sizes, CARD, LIST, ORCH and PAGE. Hence it is advisble to add a condition/filter to select the appropriate size. In my case I am filtering based on LIST.
The other option is to use drilling URL expression type.
In this scenario we have to build two queries. The first query will query data from EMPL_PHOTO table and the query properties have to set to "Image Huperlink".
The second query will include EMPL_PHOTO and other tables. Add an expression of type "Drilling URL" and select "Image URL"
In the next dialog box, provide the details of the first query and verify the two key fields EMPLID and PHOTO_SIZENAME are peopulated correctly. The field PHOTO_SIZENAME has to be in the "field list" so will be displayed in the result. So while defining the Image URL you can map the result to this field. This way the crypting URL (expression) need not be displayed as a field in the result but the values in the PHOTO_SIZENAME column will appear hyperlinked. Clicking on this field will display the image.
Saturday, April 3, 2021
Application Engine Plug-ins
PeopleTools provides a feature where in we can alter the SQL or PeopleCode actions of any Application Engine program, without customizing the delivered AE program. The configured plug-in action is executed at runtime. This effectively allows us to modify the code without actually customizing or re-designing the Application Engine program.
Configure the selected SQL or PeopleCode action of the Application Engine program by adding new SQL, PeopleCode, or both and/or by replacing the existing SQL or PeopleCode action through PIA in the AE Action Plugin page (PeopleTools, Application Engine).
Note: You can add or replace only SQL and PeopleCode actions in the Application Engine program. Only sections with steps having SQL or PeopleCode actions of the Application Engine program, which you plan to configure, will be displayed in PIA. This feature is not designed to add new sections or steps to an existing Application Engine program.
Actions belonging to the same step of the same section of the Application Engine program can have multiple plug-in actions defined. The plug-in action type does not have to match the action type that is selected for configuration. You can re-use the same SQL or PeopleCode plug-in action multiple times for different Application Engine programs.
The Application Engine action that is being configured cannot be used as a plug-in to configure another Application Engine program. Also, you cannot define a plug-in for the Application Engine action that is already been used as a plug-in.
For example, if Application Engine program A
action Y
is configured to use Application Engine program B
action X
as a plug-in, then Application Engine program A
action Y
cannot be used as a plug-in for any other Application Engine program. Also, you cannot configure a plug-in for Application Engine program B
action X
.
For the following test I am running PT 8.58.05, HCM 9.2 on PUM 35.
So AEMINITEST is my delivered program and then I created another standard AE program called as N_PLUGIN. My custom AE just has one step with action as peoplecode under MAIN. I have enbled disable restart under object properties of my custom AE.
In my custom peoplecode action I have the following code.
The delivered AE AEMINITEST has 2 steps under MAIN, first one is a SQL and then second one is peoplecode. I added a line of text to the peoplecode to understand the flow (obvisously this is not necessary).
I tried the following 4 tests.
1. Run my peoplecode action after AEMINITEST's peoplecode
Value of variable TEST in AEMINITEST is 2 (0,0) Value of variable TEST in N_PLUGIN is 20 (0,0) Application Engine program AEMINITEST ended normally
Here I tried if I can display the value of the variable in my N_PLUGIN prgram which is set in the parent AEMINITEST program. This would work only if the variable is declared as global or component, not as local or if its auto declared. Similarly values from AET records could possibly be shared.
2. Run my peoplecode action before AEMINITEST's peoplecode
Value of variable TEST in N_PLUGIN is 20 (0,0) Value of variable TEST in AEMINITEST is 2 (0,0) Application Engine program AEMINITEST ended normally
3. Run my peoplecode action replacing AEMINITEST's peoplecode
Value of variable TEST in N_PLUGIN is 20 (0,0) Application Engine program AEMINITEST ended normally
4. Replace AEMINITEST's SQL with my peoplecode action
Value of variable TEST in N_PLUGIN is 20 (0,0) Value of variable TEST in AEMINITEST is 2 (0,0) Application Engine program AEMINITEST ended normally
So this is a great feature and will definitely assist when customizing Application Engine programs.
Saturday, January 16, 2021
XMLP BI Publisher sub-templates
Recently was presented with this challenge which turned out to be good enough exercise and hence warranted this post. Request was to display appropriate logo in the report header based on data available in the source XML file.
For this exercise I am running PT 8.58.05 and BI Publisher 12.2.1.4.0 and rtf templates. My main report is called parent.rtf, sub-template is called headers.rtf and data source xml file is data.xml. The goal is to print or display the appropriate logo in the final report based on the data value provided in the XML file.
In the main report, under MS Word's heading section added the following code. This is in regular text and not in any form field. Instead of choose (which works like peoplecode evaluate) I could have also used "If - Then - Else", but I wanted to try how "choose" works in XMLP.
<?choose:?>
<?when:logo='Oracle'?>
<?call:Oracle?>
<?end when?>
<?when:logo='Microsoft'?>
<?call:Microsoft?>
<?end when?>
<?when:logo='Apple'?>
<?call:Apple?>
<?end when?>
<?otherwise:?>
<?call:Default?>
<?end otherwise?>
<?end choose:?>
Sunday, August 2, 2020
PeopleSoft Reporting Web Services
{OwnerType}/{QueryName}/{OutResultType}/{OutResultFormat}?isconnectedquery=
{isConnectedQuery}&maxrows={MaxRow}&prompt_psqueryname={Prompt_PSQueryName*}
&prompt_uniquepromptname={Prompt_UniquePromptName*}&prompt_fieldvalue=
{Prompt_FieldValue*}&filterfields={FilterFields*}&json_resp={json_response}
Sunday, March 8, 2020
Event Mapping (managing customizations)
Following is what I have tried in PeopleTools 8.56.07 and 8.57.08 on HCM 9.2 (PUM 31 and beyond). For this POC I am going to call my custom application package peoplecode on SavePostChange event on the DEPARTMENT_TBL component to perform something like sending out a notification. In the absence of the event mapping functionality I would have written this code in SavePostChange event of the DEPARTMENT_TBL component thus customizing the delivered object.
So, step one is to build the application package peoplecode. Import of PT_RCF:ServiceInterface is the key. The class name can be anything but the method name has to be "Execute".
import PT_RCF:ServiceInterface;
class FoundationDataNotify extends PT_RCF:ServiceInterface
method Execute();
end-class;
method Execute
/+ Extends/implements PT_RCF:ServiceInterface.execute +/
/* custom logic to send out notification goes here */
end-method;
Once the package is developed navigate to PeopleTools > Portal > Related Content Service > Define Related Content Service. Create a new definition and select "URL Type" as application class and then provide the package details. For this POC I selected "Public Access" under security options. Save the service definition.
Then navigate to PeopleTools > Portal > Related Content Service > Manage Related Content Service, Event Mapping tab. Click on the "Map Application Classes to Component Events" link and then navigate the portal tree to find the component on which this event would be based on or associated with. In my case it would be the department table component located under Set Up HCM > Foundation Tables > Organization > Departments.
Under "Component Level Event Mapping" section, select "enable" check-box, event name would be SavePostChange and select the Service ID created in the earlier step. Set sequence number to 1 and processing sequence as "Post Process". Save the page and that is it.
Navigate to the department component make a change and save the page and verify that the custom application package peoplecode fires.
The PeopleCode Editor provides an Event Mapping button in the dynamic Application Designer toolbar. For an application developer, the Event Mapping button is a visual indicator of custom PeopleCode programs mapped to events of a component, component page, component record, or component record field. This button is not available for page level event mapping.
So opened component peoplecode of component DEPARTMENT_TBL and clicked on the button to produce the following output.
Right-clicking on the application package code and selecting "Event Mapping References" in the pop-up menu as shown below should display the component but that did not work.
"Event Mapping References" tab is empty as shown below.
So I guess this might work in future releases or maybe I don't have something configured correctly for this to work.
Thursday, March 5, 2020
Drop Zones
Following is what I tried in PeopleTools 8.56.07, HCM database on PUM 31.
The goal was to display Job Family information on the ESS additional info page.
1. Created a new fluid page based on the PSL_APPS_CONTENT template
2. The fluid page type is set as sub-page
3. Inserted a group-box, and on the group box properties, fluid tab, set group box type as "Container" and added style class psc_padding-0em. Took default values for rest of the properties of the group box.
4. In this group box added two fields, first one is job family which is display control field and invisible and the second one is a related display field as shown below
That is it as far as development in application designer is concerned.
5. Via PIA navigate to PeopleTools > Portal > Configure Drop Zones
6. Pull up delivered ESS Additional Information page and select which drop zone to be used. So in my example the job family information will be displayed after highest education level info.
7. Save the configuration and verify the results by navigating to the Fluid ESS page.
Sunday, December 23, 2018
JSON Parser
/* for Response 1, following will get status tag and its value */
/* for Response 2, following will get import_set, staging_table and its values */
/* this will return status and error_message which are in Response 2 */
/* this will return message and detail which are in Response 1 */
Friday, November 30, 2018
Query Transformations
So decided to do a quick test to see what this does and how it works. So the benefit here is that the output can be transformed to create reports right out off the output delivered by PS Query.
So as part of this POC used any existing query. Transforming the output to HTML and using a XSL transformation to highlight the row when a certain condition is matched.
On the Transformation tab within Query Manager, click on Add XSLT which opens a window to key in free-form XSLT text. It would have been nice if there is a wizard of some sort to build the XSLT.
Gave it a Name and in the "Output File Type" lookup selected HTML. Following are the available choices - 001, A01, ABA, AET, APC, CSS, CSV, D01, DAT, DTD, DTL, ERR, GIF, GIR, HTM, HTML, IDX, JCD, JS, LIS, LOG, MDL, MT9, N01, NVT, NXT, OUT, PS, SQL, STDOUT, SYS, TMP, TRC, TRN, TXT, XLSM, XLSX, XML, XSD, ZIP
Not sure what is the difference between HTM and HTML, but I selected HTML. My sample XSLT is designed as follows.
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <html>
<!-- defined a style for the row that is going to be highlighted -->
<style type="text/css">
tr.redRow td {
font-size: 100%;
font-family: calibri;
font-weight:bold;
background-color: #FF2626;
padding-right: 10px;
color:#000;
}
</style>
<body>
<!-- in the html body defined a html table --> <table border="1">
<!-- Added a heading --> <font color="blue"> <h2>Sample Transformation test</h2> </font>
<!-- defined column headers --> <tr> <th>Employee ID</th> <th>Last Name</th> <th>First Name</th>
<th>Location</th> </tr>
<!-- Here I am selecting the data from PS Query --> <xsl:for-each select="query/row"> <tr>
<!-- defined a if condition to check if -->
<!-- value is McLean then highlight the row --> <xsl:if test="L.DESCR='McLean'"> <xsl:attribute name="class">redRow</xsl:attribute> </xsl:if>
<!-- Output the PS Query results --> <td> <xsl:value-of select="A.EMPLID" /> </td> <td> <xsl:value-of select="C.LAST_NAME" /> </td> <td> <xsl:value-of select="C.FIRST_NAME" /> </td> <td> <xsl:value-of select="L.DESCR" /> </td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>
So saved this and hit the preview button to preview the results. My query uses runtime prompts so those pop'ed up first, provided values for them and results are displayed in a new window (disable pop-up blocker or allow pop-up for this site).
Sample Transformation test
Employee ID | Last Name | First Name | Location |
---|---|---|---|
12345 | Doe | John | Madrid |
13244 | Doe | Jane | Egypt |
43423 | Hufton | Abcde | London |
42343 | Fleming | Jill | McLean |
34423 | Tibold | Jozsef | London |
67554 | Farrell | William | Johannesburg |
43556 | Myers | Tony | Ireland |
75757 | Kramer | Nicole | McLean |
27341 | Wada | Mark | New York |
27045 | Roger | Wai | McLean |
27098 | Wayne | Jessica | New York |
27125 | Garcia | Guillermo | New York |
75688 | Deepak | Shirguppi | Maryland |