Create a JasperReport from Oracle BPEL

Marcel van de Glind
0 0
Read Time:2 Minute, 17 Second

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:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

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.

 

 

 

 

 

 

 

 

 

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

About Post Author

Marcel van de Glind

As a SOA and BPM professional, Marcel is an experienced consultant in the field of process design and process modeling. Within this field system integration and IT-transcending business processes have Marcel's special interest.
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %
Next Post

Sending an email with attachment from Oracle BPEL

In my previous post I described how to create a PDF file/report in Oracle BPEL (Create a JasperReport from Oracle BPEL). Now I will describe how to sent this PDF file as attachment in an email.                             […]
%d bloggers like this: