Thursday, June 30, 2011

XML Bursting

Background / Business Requirement for Bursting
In Oracle Purchasing we have PO Print Report which can be used to print new or selected Purchase order. Organizations usually schedule this program on a daily basis to print new purchase orders. If we want to integrate this Oracle Report to XML/BI Publisher to create eye candy layouts and email the PO automatically to the suppliers, the common issue we face is:-
How to split the XML file created by report ? This is because report will create a single XML file consisting of the all the PO selected and if we apply the template on this XML file , it will create a single PDF file consisting of all the PO’s , and we definitely don’t want purchase orders sent to a supplier which is not related to him .If we have to send PO to individual supplier there has to be a way to parse the XML file generated from the PO Print Report.After parsing the XML file we can break the XML into smaller chunks based on the PO Number and then email the PO to respective Suppliers.


Advantages of XMLP bursting

a. No Additional Coding, just need to create XML bursting File. ( Isn't it exciting , otherwise we would have to write java program to split the XML File and then use XMLP delivery manager API to send emails .
b. Process of Creating XML data Definition and Template remains AS – IS .

Prerequisitesa. Apply patch 5968876 if not already applied
b. Verify XMLP version is 5.6.3

Steps to Verify if XMLP is indeed 5.6.3
1. adident Header $OA_JAVA/oracle/apps/xdo/common/MetaInfo.class

Below matrix shows the the version you are and the patch to be applied to come to 5.6.3

Metainfo.class


Metainfo.class
XML Publisher
PatchReference
120.6XDO 5.6.3Patch 4440000
... for the Oracle E-Business Suite 11i
115.28XDO 5.6.3 Patch 5472959 Note 422508.1
115.27XDO 5.6.2 (core) Patch 5097966 Note 367394.1
115.26XDO 5.6.1Patch 4905678 Note 357308.1
115.24XDO 5.6.0 Patch 4561451Note 337999.1
115.22XDO 5.5.0 Patch 4206181 Note 316447.1
115.21XDO 5.0.1 (core) Patch 4236958
115.19XDO 5.0.0 Patch 3822219 Note 295036.1



c. Set Temporary Directory in the XML Publisher Administrator- > Administration- > General to a directory to which you have write permission .

d. After the Patch is applied we will see a new Bursting control file button in the XML Publisher Data Definition Page
To check this, please go to Responsibility "XML Publisher Administrator", and search for any existing report, and click on Update. While updating an existing data-definition, you should see the button Bursting Control File.
Now since we have finished setting up , now we will see how to implement Bursting . The major component in this is bursting control file


What is a bursting file ?

Its an XML file which tells bursting engine


a) How to split the XML File created ?

b) How to deliver the Documents ?


Lets see a sample bursting file and its components


a) <xapi:request select> tag tells busting engine , bursting should be done at the occurrence of which tag ?
b) <xapi:delivery > tag tells bursting engine , which delivery mechanism to be used and on what condition ?

Sample bursting file


<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">
<xapi:request select="/xxx_HQ_XML_POXPRPOL/LIST_G_INIT_INFO/G_INIT_INFO/LIST_G_HEADERS/G_HEADERS">
<xapi:delivery>
<xapi:email id="123" server="xxxort" port="25" from=" xxp@xx.org.uk This e-mail address is being protected from spambots. You need JavaScript enabled to view it " reply-to=" xx@xx.org.uk This e-mail address is being protected from spambots. You need JavaScript enabled to view it ">
<xapi:message id="123" to="${CF_VENDOR_EMAIL}" attachment="true" subject=" Purchase Order No: ${POH_PO_NUM}">
Please review the attached PO ${POH_PO_NUM}
</xapi:message>
</xapi:email>
</xapi:delivery>
<xapi:document output-type="pdf" delivery="123">
<xapi:template type="rtf" location="/u0350/app/apps/UAT/xx/1.0/data/XXHPAPOPRINT.rtf">
</xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset>

Please Note : While doing testing please change the "to address" to your email address , else it will send the documents out to that email address .

Data Definition
Create the Data Definition and Template the normal way, where the Short name of the data definition is same as the short name of concurrent program to which you are integrating XMLP.While creating Data Definition Upload you bursting XML File . If there are any parsing issues in the XML file it will give error , please correct the format of the file and try to upload again .


Template File
Create the Template and Upload your Template file



Concurrent Program Registeration
In the Concurrent Program give the Output fomat as XML and the Concurrent Program Short name should be same as the data definition name .


After Report Trigger Changes
Now the Final Step , in the After report Trigger of your .RDf add the following code to call bursting program . This will lanuch the bursting program from your report , otherwise you will have to run the Bursting program ( which is a Java Concurrent Program ) manually .


Now you are all set to do the testing , run the report , please keep in mind to change "to email address" in the bursting control file to your email id while doing the testing . you will see the PO pdf coming to the email address given in the bursting control file.

No comments:

Post a Comment