Working with Bursting Listener


While working with bursting functionality, we have complete control over the document generation and delivery process. Bursting controfile provides a high level of flexibility on selecting template, locale, delivery type, delivery destination and output type.

As an intelligent developer, I need further control once the document generation complete. I might want to post process the generated document or supplement some of the missing functionality, which are not available through bursting document generation process. How about to add my customize delivery channel or deliver the document directly to content management system or may be I want to hook my third party application. Before delivery, I might want to validate the document or add some static content to generated PDF document.

So how can we achieve it? Yes, that's correct, we can use BurstingListener interface. Most of us who familiar with bursting functionality, also familiar with BurstingListener interface. But there is limitation with BurstingListener. It does not provide many details like sliced xml data file or document status, which are required to implement my wish list.

There is another listener, oracle.apps.xdo.batch.bursting.BurstingStatusListener. This is available with latest release 10.1.3.4.1 release or EBS 12.03 patch set. It has following method to implement and using these one can code the custom logic as per requirement.


  • beforeProcessDocument(DocumentStatus)

  • afterProcessDocument(DocumentStatus)

  • beforeDocumentDelivery(DocumentStatus status)

  • afterDocumentDelivery(DocumentStatus status)

  • afterEnterpriseDocumentDelivery(DocumentStatus status)

DocumentStatus class provides most of the details required to implement my wish list.
Lets have a look on following sample code, which provides some insight about the BurstingStatusListener usage.

import java.util.Properties;
import java.util.Vector;
import oracle.apps.xdo.batch.BurstingProcessorEngine;
import oracle.apps.xdo.batch.bursting.BurstingStatusListener;
import oracle.apps.xdo.batch.bursting.DocumentStatus;
import oracle.apps.xdo.common.log.Logger;

public class SampleBursting implements BurstingStatusListener
{
public SampleBursting()
{
try {

BurstingProcessorEngine dp = new BurstingProcessorEngine();

dp.deleteTempOutputFile(false);
dp.setTempDirectory("c:\\burst\\sample");//Set the temp file
dp.setXMLAPI("C:\\burst\\sample\\SampleControlFile2.xml"); //Set Bursting Control file.
dp.setData("c:\\burst\\sample\\employee.xml"); //Data File
dp.registerListener(this); //Set the listener

Properties prop = new Properties(); //Add properties and variables//
//Please update these property as per your environment//
prop.put("user-variable:EMAIL_SERVER", "myemailserver.com");
prop.put("user-variable:EMAIL_PORT", "25");
prop.put("user-variable:FROM_EMAIL_ADDRESS", "admin@xyz.com");
prop.put("user-variable:CC_EMAIL_ADDRESS", "cc@xyz.com");
prop.put("user-variable:PRINTER_URL", "ipp://myprintserver:631/printers/printer1");
prop.put("user-variable:EMP_TEMPLATE", "c:\\burst\\sample\\employee.rtf");
dp.setConfig(prop);
dp.process();
//dp.deletTemporaryOutputFiles();
} catch (Exception e) {
Logger.log(e);
}
}

public static void main(String[] args)
{
SampleBursting sampleBursting = new SampleBursting();
}

//Listener Implementation//

public void beforeProcessDocument(DocumentStatus status){}

public void afterProcessDocument(DocumentStatus status){
System.out.println("====afterProcessDocument====");
System.out.println("Document Key:"+status.getKey());
System.out.println("Status:"+status.getStatus());
System.out.println("XML Data File:"+status.getXMLdataFile());
System.out.println("Document:"+status.getOutput());
System.out.println("Delivery Type:"+status.getDeliveryType());
System.out.println("Log:"+status.getLog());

}
public void beforeDocumentDelivery(DocumentStatus status){
System.out.println("====beforeDocumentDelivery====");
System.out.println("Document Key:"+status.getKey());
System.out.println("Status:"+status.getStatus());
System.out.println("XML Data File:"+status.getXMLdataFile());
System.out.println("Document:"+status.getOutput());
System.out.println("Delivery Type:"+status.getDeliveryType());
System.out.println("Log:"+status.getLog());
}
public void afterDocumentDelivery(DocumentStatus status){
System.out.println("====afterDocumentDelivery====");
System.out.println("Document Key:"+status.getKey());
System.out.println("Status:"+status.getStatus());
System.out.println("XML Data File:"+status.getXMLdataFile());
System.out.println("Document:"+status.getOutput());
System.out.println("Delivery Type:"+status.getDeliveryType());
System.out.println("Log:"+status.getLog());
}

public void afterEnterpriseDocumentDelivery(DocumentStatus status){}

}

System log......

====afterProcessDocument====
Document Key:7369
Status:success
XML Data File:c:\burst\sample\120509_114142598\xdo0.tmp
Document:c:\burst\sample\7369_SMITH.pdf
Delivery Type:null
Log:null
====afterDocumentDelivery====
Document Key:7369
Status:success
XML Data File:c:\burst\sample\120509_114142598\xdo0.tmp
Document:c:\burst\sample\7369_SMITH.pdf
Delivery Type:email
Log:null
====afterProcessDocument====
Document Key:7566
Status:success
XML Data File:c:\burst\sample\120509_114142598\xdo4.tmp
Document:c:\burst\sample\7566_JONES.pdf
Delivery Type:null
Log:null
====afterDocumentDelivery====
Document Key:7566
Status:success
XML Data File:c:\burst\sample\120509_114142598\xdo4.tmp
Document:c:\burst\sample\7566_JONES.pdf
Delivery Type:email
Log:null


afterProcessDocument and afterDeliveryDocument triggers provide the xml data file and generated document. These two files are enough to implement any custom logic for post processing. All the information required for post processing could be part of XML data file. We can parse the XML and get the required info for post processing.

Files used in this example are available for download from following location.

SampleBursting.java
SampleControlFile2.xml
employee.xml
employee.rtf


Please try and post your experience. Please feel free to ask your further queries on this topic.


Comments:

Hi Ashish, How do we get this for EBS Release 11i? Thanks, Gareth

Posted by Gareth Roberts on December 05, 2009 at 04:00 AM PST #

It is there in EBS 11i as well. As per my understanding, all BIP code is same for both the releases (R12 and 11i.)

Posted by ashish.shrivastava on December 05, 2009 at 04:13 AM PST #

Cool, found it in 7352374 (BURSTING DOES NOT DELIVER MULTIPLE FILES BY FTP) which is also included in ATG RUP 7 6241631 (11i.ATG_PF.H.RUP7) Regards, Gareth

Posted by Gareth Roberts on December 06, 2009 at 02:43 AM PST #

Hi, First of all I would like to thank you to share such useful knowledge with us. I have a small doubt regarding the delivery interface. Let us assume that if the user want to change the attachment that will be sent to the user after the document is processed, then how this can be achived. Is it possible to change the attachment that is sent to user using the Bursting listners implementation? Please clarify. Thanks, Baksh

Posted by AllahBaksh on December 16, 2009 at 04:13 AM PST #

Hi Baksh, By default the generated document delivered as attachment. "afterProcessDocument" trigger provides the Output file location. You can override the content of this file but you can't change the file name or content type.

Posted by Ashish Shrivastava on December 17, 2009 at 01:32 AM PST #

Hi, I am unable to get the: beforeDocumentDelivery(DocumentStatus status) notifier procedure invoked. Anyone know how to enable this? Kind Regards, Richard

Posted by Richard Velden on February 02, 2010 at 06:20 PM PST #

Hi Richard, Make sure... You have latest BIP version (10.1.3.4.1). You have implemented " BurstingStatusListener". public class SampleBursting implements BurstingStatusListener You have registered the listener . dp.registerListener(this); //Set the listener Regards Ashish

Posted by guest on February 02, 2010 at 06:55 PM PST #

Ashish, The version checks out. I've installed bipublisher_desktop_windows_x86_101341.zip and the java library path is pointing to the lib folder. I have registered the oracle.apps.xdo.batch.DocumentProcessor with my own class implementing the: oracle.apps.xdo.batch.bursting.BurstingStatusListener Among other methods I've implemented the procedure: public void beforeDocumentDelivery(DocumentStatus status){} system.out.printline shows me that it is not called; but documents are bursted to FTP and file. Example output: ===beforeProcessDocument=== ====afterProcessDocument==== ====afterDocumentDelivery==== ===beforeProcessDocument=== ====afterProcessDocument==== ====afterDocumentDelivery==== I am missing the ====beforeDocumentDelivery====

Posted by Richard Velden on February 02, 2010 at 07:41 PM PST #

Richard, Please try with email delivery. I had this issue earlier with file system delivery.. Regards Ashish

Posted by guest on February 02, 2010 at 07:48 PM PST #

Ashish, Mailing (sucessfully) does not help. Have you ever got this working? I see in the example from your article that the same listener is not invoked as well. Regards, Richard

Posted by Richard Velden on February 02, 2010 at 08:31 PM PST #

Please try the latest Patch 8594771, It resolved the listener issue.

Posted by Ashish on July 01, 2010 at 04:38 PM PDT #

Hi Ashish
I am bursting reports in pdf attachment to user email ids.

We are facing issue with users having apostrophe in their email ids eg. vikas'osharma@abc.com

We are getting following errors for such email ids:

Delivery Type email
Status Failed
System Message

Posted by guest on December 13, 2011 at 08:21 PM PST #

Hi Ashish,

I am wondering if this method will work with the embedded version on JDE 8.98.4 running on an AS400?

Thank you.

Posted by Jennifer on May 24, 2012 at 03:16 PM PDT #

where to get the bursting interface. It is a part of bursting control file. I am on 11.5.10.2

Posted by Ashish Harbhajanka on July 11, 2012 at 07:18 PM PDT #

Hi Ashish,

Do you know if this method works on embedded BIP in JDE 8.98.3 on an iseries?

I have the JAVA code written and having difficulties deploying on the iSeries, currently due to different JDKs for the existing jars and the new custom jars.

Thank you.

Posted by ABanning on November 06, 2012 at 11:45 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

bocadmin_ww

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today