Friday, November 6, 2015

Data Mover Import Export

A common development task is to move data between two different PeopleSoft environments.  You can use App Designer to move code, table structures, and pages, but data is a different story.  Data Mover is your tool for moving your data.
My biggest challenge is that I don’t use it enough to have the syntax memorized.  This post is a list of common tasks with the syntax to make it easier to remember…

Copying Data Out

The export command copies data out of the database into a DAT file.  You should set the Log parameter to save the log to a particular place.
SET LOG C:\Temp\export.log;
SET OUTPUT C:\Temp\data.dat;

EXPORT PS_BAS_EVT_CLASS;

You can use the record name or the table name.  So, here’s the same thing with the record name instead of the table name.
EXPORT BAS_EVT_CLASS;
If you want to restrict which rows from the table get written into the data file, you can add a where clause:
EXPORT BAS_EVT_CLASS
WHERE EVENT_CLASS = 'CVG';

Copying Data In

The import command is the way to copy the data back into the system.  You will want to set the Log parameter and you have to set the Input parameter.
SET LOG C:\Temp\import.log;
SET INPUT C:\Temp\data.dat;

IMPORT BAS_EVT_CLASS;

If you want to limit which rows you want to import, you can use a Where clause.  For me, it wouldn’t work unless I used the parameter (:1).
IMPORT BAS_EVT_CLASS WHERE EVENT_CLASS = :1;CHAR,CVG;

Now, if the row already exists, it will ignore it.  There is a “Set Ignore_Dups” option, but I didn’t have to use it.  It just ignored the row that already existed.  To get it to update the row, I used the “Set Update_Update” option:
SET UPDATE_DUPS;
IMPORT BAS_EVT_CLASS WHERE EVENT_CLASS = :1;CHAR,CVG;

These commands so far work with only the rows that are in the data file.  If the database has extra rows that you don’t want, you need to use Replace_Data.  You could truncate the table first, but the Replace_Data command is designed for just this:
REPLACE_DATA BAS_EVT_CLASS;

Tuesday, October 13, 2015

Consume Third Party Web Service in PeopleSoft


In this example we will consume a 3rd party web service in our peoplesoft system. The web service we have used is a simple calculator program having four operations – Add, Subtract, Multiply & Divide.

This configuration is for  PeopleTools 8.51.15
Before performing the steps please make sure that Integration Broker is configured

Step 1 – Setup Node


We have to setup a node in PeopleSoft System which will communicate with the external system.
Open the existing node WSDL_NODE.






Copy the node to be used for integration.




Step 2 – Get a Public Web Service

There are many available on the net. We will use this as an example.

http://www.dneonline.com/calculator.asmx?WSDL




It is having four operations – Add, Multiply, Subtract and Divide. We will use these four operations.

Step 2 – Consume the Web Service



Navigate to PeopleTools  Integration Broker  Web Services  Consume Web Service



Check the WSDL URL radio button and enter the WSDL.





Select the Operations that you want to use.





Give some friendly message names.






Enter the new node that we have created in the first step.








Step 4 – Enter Connection Information



Again, open the node DR_WEB_SERVICE and enter the connector id and Primary URL.




The Primary URL will be - http://www.dneonline.com/calculator.asmx


Now, ping the node to confirm that the setup is correct.






Step 5 – Provide Security

Now, search for the service operations that we have created above.





Give a permission list which is assigned to your user profile.




Similarly, provide the security for other service operations.

Step 5 – PeopleCode to Use Web Service


Review the request and response message and accordingly we will create in peoplecode.
Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Add xmlns="http://tempuri.org/">
<intA>int</intA>
<intB>int</intB>
</Add>
</soap:Body>
</soap:Envelope>

Response

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AddResponse xmlns="http://tempuri.org/">
<AddResult>int</AddResult>
</AddResponse>
</soap:Body>
</soap:Envelope>



Create a simple page –






On the FieldChange event of Calculate button write the following peoplecode. In this example we are using ADD service operation.








Click on the Calculate button.

Request




Response


Friday, August 7, 2015

Peoplesoft Webserver Cache Location

C:\bea\webserv\peoplesoft\applications\peoples oft\PORTAL\ps\cache

<PS_HOME>\webserv\<Domain>\applications\ peoplesoft\PORTAL\<PIASite>\cache

PeopleSoft and Load Balancers on WebLogic


ISSUE:
End users are intermittently seeing "This page is no longer available" message or intermittently kicked out to the search page. These problems occur since the end user's sessions are not sticky and end user's session are bouncing between multiple webservers. Incorrect load balancer setup may cause other intermittent problems.

SOLUTION:
Verify PIA and load balancer are setup correctly with the following checklist:

1. For customers that use a load balancer, Oracle recommends using a cookie (session) based load balancer and sticky bits enabled.  IP based load balancing is not recommended and IP based load balancing is known to cause session stickiness problems.  
For more information on cookie based load balancing and sticky bits, please follow up with your load balancer vendor.
F5: http://www.f5.com/pdf/deployment-guides/f5-peoplesoft-dg.pdf

2. Ensure all your webservers have the same cookie name in each weblogic.xml file.  This file can be found in the following directory: 
/webserv//applications/peoplesoft/PORTAL/WEB-INF/weblogic.xml
In this example, there's two webservers behind the load balancer. Therefore, verify that your cookie names are the same:

weblogic.xml (webserver 1):


CookieNamepststweb-7011-PORTAL-PSJSESSIONID 

weblogic.xml (webserver 2):


CookieNamepststweb-7011-PORTAL-PSJSESSIONID 

Save both weblogic.xml files.

** If you're running Enterprise Portal and have content providers, please ensure that all Enterprise Portal webserver cookie name are all exactly the same. The content provider's webserver cookie names should have their own set of cookie names. Therefore, both Portal and content should not have the exact same cookie name. Suppose Enterprise Portal had 4 webservers and HR had 4 webservers. All 4 Enterprise Portal cookie names could be eportal-7011-PORTAL-PSJSESSIONID, but all 4 HR cookie names could be hrms-7011-PORTAL-PSJSESSIONID.

3. In weblogic.xml, ensure CookieDomain is set in all weblogic.xml. This value is automatically set when entering the authentication domain during the PIA install. If the authentication domain isn't set during PIA install, please reinstall PIA and set authentication domain.


CookieDomain .company.com
4. In PIA, navigate to "PeopleTools -> Web Profile -> Web Profile Configurations". Search for your Web Profile. Click on

Virtual Address and populate your default addressing. For example, suppose your end users access your load balancer with the following URL:@ http://mycompany.com/ps/signon.html You would need to set the following:

Default addressing Protocol: HTTP
Default addressing Name: mycompany.com
Default addressing Port: 80

* The above is an example. You'll need to populate with your load balancer info.
5. Please ensure PIA "Inactivity Logout" in seconds matches HTTP timeout in minutes.

a) In PIA, navigate to "PeopleTools -> Web Profile -> Web Profile Configurations". Search for webprofile. Click on "Security" tab. PIA timeout is "Inactivity Logout" in seconds. Suppose "Inactivity Logout" = 1200 seconds.

b) In WebLogic, open web.xml file.  This file can be found in the following directory:
/webserv//applications/peoplesoft/PORTAL/WEB-INF/web.xml 
WebLogic HTTP timeout appears in minutes:

20

In this example, ensure WebLogic HTTP timeout is 20 minutes to match "Inactivity Logout" (1200 seconds).

The Load Balancer's timeout should be higher than the PIA "Inactivity Logout" timeout and webserver HTTP timeout. Please consult with load balancer vendor to find out where to set load balancer timeout.

6. After updating weblogic.xml, web.xml and webprofile, you must bounce your webservers.

KEYWORDS: SPOTLIGHT, "page is no longer available", Load Balancer

Monday, February 16, 2015

Pagelet Wizard Custom Tags

Pagelet Wizard custom transformations can use special tags documented here to insert images, message catalog entries, or to format numbers and dates. This is great when trying to format currencies or ensure multilingual compliance. The problem with "Post-Transformation Processing," as it is called in PeopleBooks, is that it requires the transformation results to be valid XML. Question: How do you get Pagelet Wizard to generate valid XML when the Xalan processor used by PeopleTools sees HTML tags and automatically generates HTML? Answer: use the <xsl:output> XSL tag. Here is a sample template that produces valid XML:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    exclude-result-prefixes="xhtml xsl">

    <xsl:output method="xml" version="1.0" encoding="UTF-8"
        doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
        indent="yes" />

    <xsl:template match="/">
        <!-- your XSL goes here -->
    </xsl:template>
    
  <!-- identity transform templates -->
  <xsl:template match="*">
    <xsl:apply-templates/>
  </xsl:template>

  <!-- delete unmatched text -->
  <xsl:template match="@*|text()|comment()|processing-instruction()">
  </xsl:template>
  
</xsl:stylesheet>

Iscripts Example



Iscripts by Example:
Create a derived work record which starts with WEBLIB_XXXXXXXX
Include a field ISCRIPT1 which holds the peoplecode function for Iscript as show below.
Record Definition: WEBLIB_HELOWRLD

The below script , echoes the value entered in the text box.
Function IScript_HelloWorld()
Below is the code placed in fieldformula



Security:
After you create a WEBLIB record, and your functions, you must add them just as you would add a page to an application.

Adding the WEBLIB record to permission list PTPT1000. Below is the snapshot.



Click on Edit to control the type of access to the functions.
Testing: Login to PIA and copy the below URL.

http://localhost:8000/psp/hr9stg/EMPLOYEE/HRMS/s/WEBLIB_HELOWRLD.ISCRIPT1.FieldFormula.IScript_HelloWorld

Note: You need to replace 8000 with webserver port and hr9stg with the domain name.
The below script , echoes the value entered in the text box.
 
This completes the creation and testing of iscript.
Note:  You might have observed that just like the content reference which has a URL , the iscript is also a URL.
So, just like the way we register component through App designer to make the link available to the user in PIA, similar way we can register for iscript as well.
Will discuss in detail on the registring iscript in another post. Below arrow shows the registration wizard for Iscript in App Designer.

Using PeopleCode Modals: openPageletActionPageInModal (PeopleTools 8.53)

This is some useful information from Jim Marion. While typing something in the Chrome JavaScript console, I managed to bring up the function openPageletActionPageInModal. Hmmm, sounds interesting. I drilled to the implementation and saw that you call it like this:
openPageletActionPageInModal("http://your.server.name/psp/ps/EMPLOYEE/HRMS
/c/ROLE_EMPLOYEE.HR_EE_PERS_INFO.GBL?")
What does it do? It converts the /psp/ part of the URL to /psc/ and opens the URL in a modal dialog. For me it worked great as long as I followed two simple rules:
  • Included a question mark in the URL. If the URL has no query string parameters, just include a trailing "?".
  • Used this function in the same datababase/application as the content. In other words, I didn't try to use this technique in Interaction Hub for HRMS content. For that to work, I would need to translate more than just /psp/. I would also have to translate the server name and site name.
Note: It works just fine in a portal/content provider situation if the URL is already a /psc/ URL.
Anyway, interesting, undocumented piece of JavaScript that you may or may not find useful. As always, your mileage may vary.
Note: I was using PeopleTools 8.53 when I found this function.

Sunday, January 11, 2015

Installing PeopleSoft 9.2 pre-build virtual machine

The past years I have seen a lot of people on OTN forum struggling with PeopleSoft installations. Installing PeopleSoft on uncertified OS, mismatch between versions and releases, 32 vs 64 bit, etc, etc.

Well those days are over. As of April 14, Oracle made pre-build virtual machines of PeopleSoft HCM 9.2, ELM 9.2 and FSCM 9.2 for VirtualBox available. These virtual machines enable you to get a PeopleSoft Demo up and running within an hour, without installation! No, I am not lying nor am I fooling you, I timed it! Customers do not have to invest time and effort in installing a Demo environment and developers can have a properly installed local environment for R&D.

In this post I will describe the steps you need to take to get started with the PeopleSoft HCM 9.2 virtual machine. I will be deploying the virtual machine on my laptop with following hardware:

  • Windows 7 Professional 64 bit
  • 8 GB RAM
Get ready to be amazed ...

In order to run the virtual machine, you need to have VirtualBox running. If you do not have it installed yet, download and install it.

The virtual machines can be downloaded from My Oracle Support,  PeopleSoft Update Manager Home Page [ID 1464619.1].




Click on the link PeopleSoft HCM Demo Image link and you will be redirected to the Patches site.




These are the split file of the virtual machine. Download them all.

On the PeopleSoft Update Manager Home Page scroll down to the attachments sections and also download following highlighted document. It contains detailed information on the virtual machine deployment and maintenance.




After you have downloaded the files, extract the virtual machine split files. You end up with the following files.




These files have to merged first to one file. Open a command prompt and run following command:

copy /b HCMDB-SES-85302d.ova_1of7+HCMDB-SES-85302d.ova_2of7+HCMDB-SES-85302d.ova_3of7+HCMDB-SES-85302d.ova_4of7+HCMDB-SES-85302d.ova_5of7+HCMDB-SES-85302d.ova_6of7+HCMDB-SES-85302d.ova_7of7 HCMDB-SES-85302d.ova

After this you will have the ova file, which you can import in VirtualBox.




To clear some space on your hard disk, you can delete all above files, except the ova file off course.

Start VirtualBox and from the menu select Import Appliance




On the next screen select the ova file.




On the Appliance screen make sure to check Reinitialize the MAC address




Click on Import. This import took about half an hour on my laptop.




When the virtual machine is imported, you can see that the virtual hard disks have been created with a total size of 55 GB. So, prior to staring this step, make sure you have enough hard disk space available. At this time you can also delete the ova file if you wish to, to clear some hard disk space.




The virtual machine is pre-configured with the following settings.




It is configured to run with 4 GB RAM. Besides PeopleSoft, the virtual machine also contains Secure Enterprise Search. If you plan to use SES, it is recommended to increase this to at least 6 GB. Also note that the virtual machine is configured with a Host-Only network adapter. This will allow the virtual machine to communicate with the host, which is good enough for a local sandbox. If you plan to make it accessible from a corporate or home network, you need to use the Bridged network adapter. I will use it as a local sandbox, so I will keep the Host-only network adapter and increase the RAM allocation to 6 GB. After this click on the Start icon and the virtual machine will start. Not so long after this you will be prompted some configuration questions.




I think the answer to the first question is obvious.




Next you are prompted to set the password for the root account.




Next select to use a static or dynamic IP address. I first tried setting a static IP address, but the script prompted me for the ip address, subnet and gateway. With a Host-only adapter you do not need to provide a gateway, but the script would not accept this??? So I switched back to have a dynamic ip address.

If you want to proceed configuring a Host-only adapter, you can provide the same ip address for the gateway and DNS server as your guest ip address.




Next set your hostname. I chose to set it to hcm92.ps.com



Next you can change you PeopleSoft database name. I kept it default.




Finally you are prompted if you want to setup SES. I was very impressed by SES and the integration with PeopleSoft in PeopleTools 8.52, so I definitely want SES to be configured on this VM.

After this all the PeopleSoft and SES components are configured and are being started.

This process took another half hours. Why did it took half an hour? I will explain this later on.

On my laptop I modified by hosts file and added the following line

192.168.56.101   hcm92.ps.com

Now you can start your favorite browser and go to the PeopleSoft signon page

http://hcm92.ps.com:8000/ps/signon.html



In fact your are now done and have a PeopleSoft HCM 9.2 Demo environment running!

Usually after installation you have to preform some manual configuration steps. Now this amazed me the most of the this virtual machine. Everything is configured.

Report node




Integration Broker




Default Local Node








My own WOW moment

SES configuration in PeopleSoft and SES







And this why the configuration took half an hour. The search indexes are all deployed, build and crawled. SES immediate works after starting your virtual machine.




What was not configured what I added manually:

Web Profile




On the used web profile, I have added the authentication domain and the PeopleSoft Help url to the Hosted PeopleBooks. The documentation states the authentication domain would have been set automatically if you configured the virtual machine with a static ip address.

ANONYMOUS NODE




The ANONYMOUS node was set to user @userpass@. I have changed this to PS.

Using Application Designer

If you are a developer or if you want to have a look at the source objects of PeopleSoft you can install PeopleTools Client on your host or on another Windows virtual machine. The installation files for PeopleTools Client and Oracle Client are also available on the virtual machine. I will install these on host (my laptop).

Start windows explorer and type \192.168.56.101




On the provided shares copy the folder oracle-client to you host. Do not copy client! This contains PeopleTools Client, where the installer requires to run from the virtual machine.

In the copied oracle-client folder, extract oracle-client-mswin-x86-32.zip. In the extracted folder start the installer.




Choose Runtime as installation type.




Provide the installation directory. We will be needing this for the Configuration Manager later on.

Finish the installer and from the copied oracle-client folder locate the tnsnames.ora and copy it to$ORACLE_HOMEnetworkadmin on the host. In my case this is D:appsoracleproduct11.2.0client_1networkadmin.

Verify connectivity

Open a command prompt and type sqlplus SYSADM/SYSADM@HR92DM00




SQL Developer

For those who want to use SQL Developer, it is also part of the Oracle Client installation. In the Windows Start menu, you will also find SQL Developer. When you start it for the first time, it will prompt you for the java path.




Use the jdk folder that is part of the Oracle Client installation.



After this create a new connection to the PeopleSoft database, using the settings as shown above. You can now start the PeopleTools Client installer.

Install PeopleTools Client

In the shares folder start the setup.bat installer in the clientDisk1 folder.




On the license code screen enter the PeopleTools license code, available from http://licensecodes.oracle.com/




Finish the installer and start Configuration Manager from the Windows start menu.




On the Startup tab set Database name, userid, connectID to people and password to peop1e.

Go to tab Profile and provide the Oracle Client path



Now you are all ready to start using Application Designer and use PeopleSoft.




I want to thank everyone from Oracle that had any role in making this virtual machine available. It is really amazing with which ease you can have a Demo environment running.

If you are not that comfortable with Linux and would rather have a GUI, have a look at the following post Extending the PeopleSoft 9.2 virtual machine with GUI and Guest Additions