You are on page 1of 9

Documentation on Bursting Engine

Bursting Engine X ML P u b l i s h e r sb u r s t i n ge n g i n ea c c e p t sad a t as t r e a ma n ds p l i t si tb a s e do n multiple criteria, generates output based on a template, then delivers the individual documents through the delivery channel of choice. The engine provides a flexible range of possibilities for document generation and delivery. Example implementations include: I n v o i c e g e n e r a t i o na n dd e l i v e r yb a s e do nc u s t o me r -specific layouts and delivery preference F i n a n c i a l r e p o r t i n gt o generate a master report of all cost centers, bursting out individual cost center reports to the appropriate manager G e n e r a t i o no f p a ys l i p s t oa l l e mp l o y e e s b a s e do no n e e x t r a c t a n dd e l i v e r e dv i a e-mail Document Processor Engine The Document Processor Engine provides batch processing functionality to access a single API or multiple APIs by passing a single XML instance document to specify template names, data sources, languages, output type, output names, and destinations. This solution enables batch printing with XML Publisher, in which a single XML document can be used to define a set of invoices for customers, including the preferred output format and delivery channel for those customers. The XML format is very flexible allowing multiple documents to be created or a single master document. The bursting engine is an extension of the Document Processor Engine, and has its own method be called to invoke it. It accepts the XML data to be burst and a control file that takes the Document Processor XML format.

Page 1 of 9

The Document Processor XML file has the following element hierarchy:

Below given are the steps to follow: Control File The control file takes the same format as the Document Processor XML with a few extensions: U s e t h e a t t r i b u t e select under the request element to specify the element in the XML data that you wish to burst on. Example <xapi:request select="/EMPLOYEES/EMPLOYEE"> U s et h ea t t r i b u t e id under the lowest level of the delivery structure (for example,the delivery element email, the id attribute belongs to the message element. This assigns an ID to the delivery method to be referenced later in the XML file. Example <xapi:message id="123" to="jo.smith@company.com"

Page 2 of 9

U s e t h e delivery attribute under the document element. This assigns the delivery method for the generated document as defined in the id attribute for the deliveryelement. You can specify multiple delivery channels separated by a comma. Example <xapi:document output-type="pdf" delivery="123"> U s e t h e template element to locate the rtf template Example <xapi:template type="rtf" location="/usr/tmp/empGeneric.rtf"> All the employees will have the empGeneric template applied. S a v e t h e C o n t r o l F i l e a s . x ml f i l e . Here is the Sample Control file. <?xml version="1.0" encoding="UTF-8" ?> <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi"> <xapi:request select="/RAXINV/LIST_G_CUSTOMER_NUMBER/G_CUSTOMER_NUMBER"> <! - Burst on Customer element - > <xapi:delivery> <xapi:email server="127.0.0.1" port="25" from="haritha_apps@yahoo.com" reply-to= "santhosh.chetla@appsassociates.com "> <xapi:message id="123" to="prasad.pbn@appsassociates.com " cc="venkat.vakity@appsassociates.com" attachment="true" subject="CustomerDetails">Please find the customer invoice as a attachment (Through Application). <! - Set the id for the delivery method - > <! - Use the Customer EMAIL element to email the document to the Customer - > </xapi:message> </xapi:email> </xapi:delivery> <xapi:document output-type="pdf" delivery="123"> <!Specify the delivery method id to be used - > <xapi:template type="rtf" location="/disk3/oracle/viscomn/java/oracle/apps/fnd/cp/sample/customer_report .rtf" /> </xapi:document>

Page 3 of 9

</xapi:request> </xapi:requestset> Calling the Bursting API: To call the bursting API, instantiate an instance of DocumentProcessor class using on of the following formats: DocumentProcessor (xmlCtrlInput, xmlDataInput, tmpDir) Where xmlCtrlInput - is the control file for the bursting process. This can be a string reference to a file, an InputStream object, or a Reader object. xmlDataInput - is the XML data to be burst. This can be a string reference to a file, an InputStream object, or a Reader object. tmpDir - is a temporary working directory. This takes the format of a String object. This is optional as long as the main XML Publisher temporary directory has been set. Here is the sample java file: package oracle.apps.fnd.cp.sample; import oracle.apps.xdo.batch.DocumentProcessor; import oracle.apps.xdo.batch.*; import oracle.apps.xdo.batch.object.*; import oracle.apps.xdo.delivery.*; import oracle.apps.xdo.delivery.smtp.*; import oracle.apps.xdo.*; import oracle.apps.xdo.oa.util.*; import java.util.*; import java.io.*; import java.io.InputStream; import oracle.apps.fnd.cp.request.*; public class BurstingTest { public BurstingTest(){ try { //Create an instance of DocumentProcessor Page 4 of 9

DocumentProcessor dp=new DocumentProcessor("/disk3/oracle/viscomn/java/oracle/apps/fnd/cp/sample /CustomerCtl.xml","/disk3/oracle/viscomn/java/oracle/apps/fnd/cp/sample/ customer_report.xml","/disk3/oracle/viscomn/java/temp"); dp.process(); } catch (Exception exc) { exc.printStackTrace(); } } public static void main(String[] args) throws Exception { //Declaring a Constructor BurstingTest burst1 = new BurstingTest (); } } Steps for the Execution process: Place the java class file under $JAVA_TOP (/oracle/apps/fnd/cp/) Place ctl file under $JAVA_TOP(/oracle/apps/fnd/cp/) When the Java file is registered as Concurrent Program: Follow these Change to the class file described above: I mp l e me n t a nI n t e r f a c e JavaConcurrentProgram a s b e l o w Public class BurstingTest implements JavaConcurrentProgram I n c l u d et h er u nme t h o di n s t e a do f public static void main(String[] args) throws Exception . The syntax as below: public void runProgram(CpContext ctx) Finally include this command at the end of the file. ctx.getReqCompletion().setCompletion(ReqCompletion.NORMAL, "");

Page 5 of 9

Passing Request Id as Parameter: The Bursting Engine Program takes the request id of the concurrent program as parameter and gets the source XML file and bursts it accordingly. Here is the sample java file using Parameter: package oracle.apps.fnd.cp.sample; import oracle.apps.xdo.batch.DocumentProcessor; import oracle.apps.xdo.batch.*; import oracle.apps.xdo.batch.object.*; import oracle.apps.xdo.delivery.*; import oracle.apps.xdo.delivery.smtp.*; import oracle.apps.xdo.*; import oracle.apps.xdo.oa.util.*; import java.util.*; import java.io.*; import javax.mail.*; import java.sql.*; import java.io.InputStream; import oracle.apps.fnd.util.*; import oracle.apps.fnd.cp.request.*; public class BurstingTest implements JavaConcurrentProgram{ public String arg; public void runProgram(CpContext ctx) { ParameterList lPara = ctx.getParameterList(); while (lPara.hasMoreElements()) { NameValueType aNVT = lPara.nextParameter(); arg = aNVT.getValue(); } // Takes the request id as parameter from console String path= "/disk3/oracle/viscomn/admin/out/VIS_andy/" + "o" + arg + ".out"; try { DocumentProcessor dp=new DocumentProcessor ( "/disk3/oracle/viscomn/java/oracle/apps/fnd/cp/haritha/CustomerCtl.xml",p ath,"/disk3/oracle/viscomn/java/temp"); dp.process(); ctx.getReqCompletion().setCompletion(ReqCompletion.NORMAL, ""); } catch (Exception exc) { exc.printStackTrace(); Page 6 of 9

} } } Registering the concurrent program Creating Executable

NOTE: Execution File Path: oracle.apps.fnd.cp.sampleis the path where the java class file is placed.

Page 7 of 9

Defining Program

Page 8 of 9

Defining Parameter for the Concurrent Program

Assign the Concurrent program to particular responsibility to run.

Page 9 of 9

You might also like