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:

image1

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.

image2

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

image3

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.

image4

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

image5

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

This means the report is available in the BPEL process.

You can download all sources of this solution by clicking on the following link CDbooklet

In my next post I show how to attach this report to a simple email activity.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s