How to burst e-mail messages via Oracle BI Publisher API

Oracle BI Publisher is a reporting solution to author, manage and deliver all your reports and documents easier and faster than traditional reporting tools.

Using BI Publisher’s bursting feature you can split data into blocks, generate document for each block and deliver the document to one or more destination. The method by which report bursting is carried out is based on a user defined rules that takes account of security or data distribution.

 

In this article we will try to present how to burst e-mail messages with the help Oracle BI Publisher programming interface – Java API.

Scenario

 

We would like to send an email to all our customers with a custom text message.

Before we start, we need to get WSDL file. You will find it entering the following URL from your browser:

http://hostname:port/xmlpserver/services/PublicReportService?WSDL

 

Please save the WSDL file in your local system.

 

Next step is to create Web Service Proxi with the help of a wizard in JDeveloper. Right click on Project, select “New” and pick Web Services Proxy from Web Services Tab.

 

 

Follow the wizard steps using WSDL file and choosing JAX-WS Style as a Client Style.

Once you have done it, JDeveloper automatically generates all the required Java classes. One of them is Proxy class called “PublicReportServicePortClient”.

 

Having this class you can start implementing our bursting solution.

 

To be able to process bursting we are calling Bursting Processor Engine:

 

                                                        BurstingProcessorEngine dp=new BurstingProcessorEngine();

 

In our Java class we are implementing BurstingStatusListener coming from BIP Bursting Library:

 

 

Bursting Processor Engine accepts three parameters:

1.  Temporary Directory location

              In our case it is: “C:\\JDeveloper\\mywork\\sample\\”

 

         2. Bursting Control File

            A bursting control file is an XML based file that defines the answers to 4 main questions.

            How do I burst the document?

            How do I deliver the burst file?

            Where do I deliver the burst file?

            What should the delivered file look like?

 

We will use following Bursting Control File:

 

 

Let’s take a close look at Bursting Control File.

 

It has a following structure:

 

 

With a single burst you can define from one to many channels.  Beside EMAIL deliver you can also use File, Fax, FTP and SFTP. Each delivery definition has its own ID. Based on this ID it can be associated with Document Delivery. In our case message ID is generated based on variable taken from XML Data File filed called EMPNO.

3. XML Data File

            We will use following XML data for the bursting report:

 

Summary

 

Standard BI Publisher functionality allows for the bursting and delivery of your reports to various output mediums.  Sometimes you can find a user request that is difficult to implement using standard BI publisher options. In this case it is worthy to use API.

 

The format of the Bursting Control files can be difficult to create as they are not very user friendly.  I hope that our Bursting Control file example will help you implement your custom bursting solution.

Michal L
michal.lesiak@clearpeaks.com