Tuesday, January 28, 2014

XML Publisher simplified

There was an apprehension to adopt the XML publisher with earlier template builder for a peoplesoft developer. This got better with the new template builder version 5.6.2+


This version will make lives easy for those who want to sort/group by data in your templates.


Also for those people who are asking for help with Rowset based datasource.


1) You need to import the application class PSXP_XMLGEN:*


2) You all know peoplecode and how to use rowsets.


3) Create XSD and Sample xml file using Application Engine.


4) extend the above imported application class to create schema and File.


5) Now create you application engine to publish full data, create report definition and the run the AE.


6) The code also extends PSXP_RPTDEFNMANAGER and generate report.


This might not look simple unless you try it. Good Luck!

Thursday, April 24, 2008

Is XML Publisher complicated?

Is XML Publisher complicated?

May be not if you have given it a try. The previous versions of Template builder supplied to PeopleSoft developers do make it look complicated. Try the latest version of template builder 5.6.2+ and you might fall in love with this again.

Get the new template builder from Oracle OTN site as the offering by PeopleSoft application is old.

PeopleSoft and other blogs explain a lot about Query based data source but as we PeopleSoft developers use PeopleCode day in and day out how do we use rowset based data source?

Many question asked about how we create the code to generate data file using rowset based XML Publisher.

1) Create an Application Engine to create sample XSD and XML file
2) I assume you have already installed the plug in for the XML Publisher and worked with query data source.
3) Here we are talking about using PeopleCode to create XML Publisher reports.
4) Create an Application Engine with the below pasted code
5) Use appropriate table and you will have the files (Schema and Sample Data) ready.
6) Use these data sources to create your template. The Business analysts can change these templates as and when client wishes.
7) The templates are effective dated so you can change the template and add it to the report definition without a need of a developer. Run the report and get result in the format you/Client need.
8) Use the above created template in you XML Publisher process definition.
9) The Application Engine so far is only built to provide sample files to create the template.
10) Once the template is built, the developer will update the Application Engine to publish entire data.
11) Good luck!

Sample Code

import PSXP_XMLGEN:*;

/* Import the Application Package and define the rowset*/

Local Rowset &rs;

/* CREATE ROWSETS*/

&rs = CreateRowset(Record.PERS*****TBL);

rem &full = createrowset(record.parent, &rs);

&rs.Fill("where emplid like '***%'");



/* Create schema files and Sample data files */


&RowsetDataSource = create PSXP_XMLGEN:RowSetDS();
&rds = create PSXP_XMLGEN:RowSetDS();
&myschema = &rds.GetXSDSchema(&rs);
&f1 = GetFile("C:\temp\schema.xsd", "W", %FilePath_Absolute);
&f1.WriteLine(&myschema);
&f1.close();



&myxmlfile = &rds.GetXMLData(&rs, "C:\temp\schema.xsd");
&f2 = GetFile("C:\temp\xmlfile.xml", "w", %FilePath_Absolute);
&f2.WriteLine(&myxmlfile);
&f2.close();

XML Publisher

I have friends and colleagues ask help with the XML publisher reports. The tool is self explanatory and you will get all the documentation about it on Oracle OTN. The cool stuff is about grouping, sorting, order by.

This is made easy with the template builder version 5.6.2 and later. This is not the available plugin provided in your application. Please refer OTN.







Wednesday, March 21, 2007

Web services in peoplesoft // contact me for Images

Creating Web Services in PeopleSoft

1. Introduction. 2

2. Creating Messages and Services. 4

3. Service Configuration. 8

4. Exposing as Web services. 9

5. Information gathered. 19

1. Introduction

What are the Peopletools 8.48 functionalities for integrating with BPEL? Peopletools 8.48 provides capabilities to consume or provide webservices. The PeopleSoft Applications and BPEL share services and these services are invoked synchronously or asynchronously. We will see in brief how to expose as web services within peoplesoft.

How is a PeopleSoft service consumed by BPEL? PeopleSoft with latest tools release enables developers to expose CI and Application packages as Web Services. The feature in BPEL process which consumes the service is Partner Link.

Consuming a BPEL process was made very easy in Peopletools. The ability to create and consume the webservices is providing in releases 8.46, 8.47 & 8.48. People Tools service designer is used to create and publish webservices. The messaging operations are diverted to Service operations. We are aware of creating messages, message channels and creating nodes and transactions. The service operations is about creating service operations, assigning messages to operations, adding handlers and creating routings.

Let us also take a brief pause and be aware of the new nomenclature.

Prior to 8.46

Latest

Channels

Queues

Transaction

Routings

Subscription/Publishing PeopleCode

Application Class

Messages

Message now is only a shape or definition only

Application message system the message node is associated with specific message channels. Each message channel includes the routing. The subscribing system processes the received message by the subscription process. The message delivery is handled through the HTTP/XML protocol. To revise the picture below depicts the components.

Messaging Flow in the service oriented architecture integration.

A service can consume the service by discovering from BPEL’s WSIL, UDDI, or directly importing using wsdl URL, or from a WSDL file. A copy of the WSDL is stored in WSDL repository table. Using the service designer, the developer can select port type, operations and messages. The developer can also add some handlers and routings.

2. Creating Messages and Services.

  • Create/Identify message and message channel
  • Create/Identify service
  • Create/Identify service operation
  • Create/Identify Routings

The following diagrams explain the navigation to search and create the above mentioned components.

Navigation

Action

Peopletools > Integration broker – Integration Setup > Message

Search/Add

Fig: New message which is shape only.

Navigation

Action

Peopletools > Integration broker – Integration Setup > services

Search/Add

Fig: Create new service for the message created earlier.

Navigation

Action

Peopletools > Integration broker – Integration Setup > service operation

Search/Add

Fig: Create new service operation, message, queue, service and service operations are all related.

Fig: Routings are created for service operations.

Fig: The routings on service operation explains the node information.

Fig: example to find connectors tab on routing definitions.

3. Service Configuration

Navigation

Action

Peopletools > Integration broker – Configuration > Service Configuration

Configuration

The settings on the page are used for WSDL and SOAP endpoints, also the schema and service namespace.

4. Exposing as Web services

Component interfaces are web-services ready in version 8.48. The web service in peoplesoft should be exposed to be utilized by BPEL or ESB. These services exposed enables third party tools and integration utilities to consume.

Providing Services:

The services what can be one or more CI’s or Application classes or peoplecode and rowset and non-rowset based messages can be published as a WSDL or UDDI repository. The WSDL is also saved in an internal WSDL repository and available for query or export. This task is accomplished for a developer through web service wizard.

Navigation

Action

Peopletools > Integration broker – Web Services > Provide web services

search

Fig: Step 2

Fig: Step3

Fig: Step4

Fig: Created is the WSDL URL, you can also create a SOAP template.

Providing CI based Web Services

Navigation

Action

Peopletools > Integration broker > Web Services > CI based services

Search

Fig: CI based services

Fig: select the CI and click on review CI status

Fig: Select all or any methods and click on display selected actions.

Fig: Click on Perform selected actions

Fig: Click on view service definition. The page displays service information and operations.

Fig: Provide web service gives the user a service wizard to create web service.

Fig: Check if WSDL already exists.

Fig: Click on provide web service. Do select all or any.

Fig: Step 3, you can view the WSDL.

Fig: Finish in the step 4

Fig: Results and you can also create a SOAP Template.

Navigation

Action

Peopletools > Portal > Structure and content

edit

Fig: make sure the WSRP Producible is checked before exposing as a web service


5. Information gathered

Easy Coding: The consumed BPEL process can be launched (invoked) using a very few Peoplecode statements.

Creating a Message

&payload = CreateXmlDoc(&customer);

&msg = CreateMessage(Operation.PROCESS, %IntBroker_Request);

&msg.SetXmlDoc(&payload);

Invoking a BPEL process

&response = &bpelProcess.LaunchSyncBPELProcess(&OPERATION, &msg, "", "");

Processing a response

If All(&response) Then

&responseString = &response.GenXMLString();

WinMessage(&responseString);

Else

WinMessage("Error: No reply ");

Monday, March 12, 2007

Peoplecode events


peoplecode trace

Numeric Value
Constant Value
Description
0
%TracePC_None
Set trace off.
1
%TracePC_Functions
Provide a trace of the program as it is executed. This implies options 64+128+256 described in the following rows.
2
%TracePC_List
Provide a listing of the entire program.
4
%TracePC_Assigns
Show the results of all assignments made to variables.
8
%TracePC_Fetches
Show the values fetched for all variables.
16
%TracePC_Stack
Show the contents of the internal machine stack. This option is normally used for debugging the PeopleCode language and not PeopleCode programs.
64
%TracePC_Starts
Provide a trace showing when each program starts.
128
%TracePC_ExtFuncs
Provide a trace showing the calls made to each external PeopleCode routine.
256
%TracePC_IntFuncs
Provide a trace showing the calls made to each internal PeopleCode routine.
512
%TracePC_ParamsIn
Show the values of the parameters to a function.
1024
%TracePC_ParamsOut
Show the values of the parameters as they exist at the return from a function.
2048
%TracePC_EachStmt
Show each statement as it's executed (and don't show statements on branches not taken.)
32768
%TracePC_Evaluations
Start the timing tracing of the start and end of top-level program evaluations. This is similar to the Trace Start of Programs, but only traced when the call isn't directly from PeopleCode. It traces recursive evaluations, like what happens when a ScrollSelect in a RowInit event causes another recursive RowInit to fire during the outer RowInit. If both Trace Evaluations (32768) and Trace Start of Programs (64) are on (32768+64 = 32832) then all routine calls (functions, methods, get, set for both internal and external PeopleCode to PeopleCode calls) are traced. The resulting trace file can be processed by a program to add up the timings for each routine and separate the in-routine timings from those for called routines.