Create a JasperReport from Oracle BPEL

In my previous post I described how to create a Report (CDBooklet) with JasperReport in Java.
Follow this link to take a look at the post ‘Using Java to create a report with the JasperReport java API’

For this new post I created a webservice wrapper around this reporting functionality and deployed it to a Weblogic application server.
Here I will describe how to create a CDBooklet report with the Oracle SOA Suite 11g.
First we have to determine the in- and output payload for the service. You can find a detailed description of this service in my previous post.

For here I limitate to displaying the used xsd:

Create a JasperReport from Oracle BPEL booklet

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The magic is in the xmldata field. It’s an ‘anytype‘ field.
In this field the complete xml input data that’s required for the report is loaded.
This xml data should conform to the data schema of the created report. In this case the CDBooklet report.

Create a JasperReport from Oracle BPEL

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

To create a CDBooklet and receive it back I implemented a solution according the following picture.

Create a JasperReport from Oracle BPEL orchestration3

Process description

The input payload for the main BPEL process is the name of an artist together with the name of one of his/her albums. Subsequently the process triggers:

  • A CD service to get the tracklist. This service is implemented in java. It uses a XML file as datastore.
  • A lyrics service to get the lyrics. The BPEL process loops over all tracks and call a java wrapper webservice to get the song lyrics from http://www.songlyrics.com
  • An image service to get a reference to the required CD image. I have used a database table that contains references to images. The required reference is found with the key: ‘artist and album’.

 

All this data is combined in a variable of the CDBook type. The tracklist part is show in the following picture.

Create a JasperReport from Oracle BPEL tracks

 

 

 

 

 

 

 

 

 

 

This data, together with the reportname, reportlocation, outputname and outputlocation represent the payload for the reporting service (PDF creator).

Create a JasperReport from Oracle BPEL payload

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The reporting service returns the outputname, outputlocation, contenttype , contentsize and the created report.

This means the report is available in the BPEL process.

In my next post I show how to to attach this report to a simple emailactivity.
You can download al sources of this solution by clicking on the following link CDbooklet