Monday, September 10, 2012

XMLPublisher Bursting in Oracle Applications

Ø  BI Publisher's bursting engine accepts a data stream and splits it based on multiple criteria, generates output based on a template, then delivers the individual documents through the delivery channel of choice

Usages in XML Bursting
1)   Invoice generation and delivery based on customer-specific layouts and delivery
Preference
2) Generation of payslips to all employees based on one extract and delivered via email
3) Purchase order generation and delivery based on supplier.

Control File  Creation.
<?xml version="1.0" encoding="UTF-8"?>
<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">
  <xapi:request select="/INVOICE_DATA/LIST_G_ORGANIZATION_NAME/G_ORGANIZATION_NAME">
       <xapi:delivery>
            <xapi:email id="email1" server="smtp.gmail.com" port="587" from="testemail@gmail.com">
                 <xapi:message id="email1"  to="ashok.gade_ora_consultant@panoramicworld.biz" attachment="true" subject="Invoice Number ${Invoice_num}
                 dated ${Invoice_Date}">
                 This is an auto generated email. Please do not reply to this email.
                 </xapi:message>
            </xapi:email>
       </xapi:delivery>
       <xapi:document output="XXC_Invoice_${Invoice_num}.pdf" output-type="pdf" delivery="email1">
            <xapi:template type="rtf" location="/app/pcldev/apps/apps_st/appl/xxpan/12.0.0/reports/US/XXPAN_Invoice.rtf" filter="">
            </xapi:template>
       </xapi:document>
  </xapi:request>
</xapi:requestset>

Explanation of elements in control file
Explanation
xapi:request select=
This tag in the control file indicates from which tag/node in the concurrent program output XML should separated for bursting
xapi:delivery
This node contains all email related attributes
xapi:email
This tag contains the email attributes like,
·         server or the email server IP or name
·         port or the email server port
·         from or the email address from which the server should send the email
·         reply-to or the email address to which the replies should be sent
xapi:message
This tag contains the attributes about the email like,
·         To or the email address where the email should be sent
·         Subject or the email subject
·         attachment , i.e. if the email should contain an attachment
·         content-type or type of email
·         The mail body will be enclosed within the tags
xapi:document
This node contains the attachment document and XML template related tags and attributesThe attributes in this tag are related to the email attachment
·         Key or unique identifier of each attachment
·         Output or attachment file name
·         Output-type or attachment file type
xapi:template
This node contains the template information like,
·         Type or the file type of the template
·         Location or the directory of the template file along with the file name

Usage
Ø  Use the attribute select under the request element to specify the element in the
XML data that you wish to burst on.
Eg:-
<xapi:request select="/INVOICE_DATA/LIST_G_ORGANIZATION_NAME/G_ORGANIZATION_NAME">


Ø  Use the attribute id under the lowest level of the delivery structure (for example,
for 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.
Eg-:
<xapi:delivery>
<xapi:email id="email1" server="smtp.gmail.com" port="587" from="testemail@gmail.com">
<xapi:message id="email1" to="ashok.gade_ora_consultant@panoramicworld.biz" attachment="true" subject="Invoice Number ${Invoice_num} dated ${Invoice_Date}">This is an auto generated email. Please do not reply to this email.</xapi:message>
</xapi:delivery>

We can send and fax and print the output by using following tags.
<xapi:delivery>
<xapi:fax server="ipp://mycupsserver:631/printers/fax2">
  <xapi:number id="FAX1">916505069560</xapi:number>
  </xapi:fax>
  <xapi:print id="printer1"
   printer="ipp://mycupsserver:631/printers/printer1"
   copies="2" />
  </xapi:delivery>

Ø  Use the delivery attribute under the document element. This assigns the
Delivery method for the generated document as defined in the id attribute for the
Delivery element.
Eg:-
<xapi:document output="XXC_Invoice_${Invoice_num}.pdf" output-type="pdf" delivery="email1">
<xapi:template type="rtf" location="/app/pcldev/apps/apps_st/appl/xxpan/12.0.0/reports/US/XXPAN_Invoice.rtf" filter="" />
</xapi:document>

Go to xml publisher àAdministration
In general tab à Temporary directory mention the rtf located path.






We need to write the code in After Report Trigger
FUNCTION AfterReport
   RETURN BOOLEAN
IS
   req_id   NUMBER;
BEGIN
   req_id :=
      FND_REQUEST.SUBMIT_REQUEST ('XDO',
                                  'XDOBURSTREP',
                                  NULL,
                                  NULL,
                                  FALSE,
                                  'N',
                                  TO_CHAR(:P_CONC_REQUEST_ID),
                                  'Yes'
   );

   IF req_id = 0
   THEN
      srw.MESSAGE (100, 'Failed to submit the bursting program');
   END IF;

   srw.USER_EXIT ('FND SRWEXIT');
   RETURN (TRUE);
END;

After the report is generated, it executes the program named, XML Publisher Report Bursting Program. This program is responsible for bursting the XML with the help of the bursting control file attached to the concurrent program whose output will be burst. Ensure that this program is attached to the request group of this responsibility.

 

1 comment:

Adnan said...

Hi,
Can some body please let me know how to over come this issue.

I need to authenticate mail server, which I heard it from our DBA saying in needs to be embed in XML Bursting control file. How is that possible?
Rgds, Adnan

Post a Comment

Best Blogger TipsGet Flower Effect