Thursday, August 12, 2010

EBS Bursting: Filter on XML Elements using XPATH in Bursting Control File

Just a quick post to give an example of a bursting control file that has multiple emails, with a filter based on XML Element in the data to select which email to send.

Oracle EBusiness Suite XML / BI Publisher Bursting Control File Example - Multiple Email Filter

Here it is:

<?xml version="1.0" encoding="UTF-8"?>
<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi">
<xapi:globalData location="stream"/>
<xapi:request select="/ARXSGPO_CPG/LIST_G_SETUP/G_SETUP/LIST_G_STATEMENT/G_STATEMENT">
<xapi:delivery>
<xapi:email server="${XXX_SMTP}" port="25" from="${XXX_SEND_FROM}" reply-to ="${XXX_REPLY_TO}">
<xapi:message id="email1" to="${XXX_CUST_EMAIL}" cc="${XXX_ARCHIVE_EMAIL}" attachment="true" content-type="html/text" subject="Statement from ${ORG_NAME} - ${STATEMENT_DATE}">Hello,
Please find attached the Statement for period to ${STATEMENT_DATE}.
${ORG_NAME}
Internal Ref: Customer Email
</xapi:message>
</xapi:email>
<xapi:email server="${XXX_SMTP}" port="25" from="${XXX_SEND_FROM}" reply-to ="${XXX_REPLY_TO}">
<xapi:message id="email2" to="${XXX_AGENT_EMAIL}" cc="${XXX_ARCHIVE_EMAIL}" attachment="true" content-type="html/text" subject="Statement from ${ORG_NAME} - ${STATEMENT_DATE}">Hello,
Please find attached the Statement for period to ${STATEMENT_DATE}.
Regards,
${ORG_NAME}
Internal Ref: Agent Email
</xapi:message>
</xapi:email>
</xapi:delivery>
<xapi:document key="${CUSTOMER_ID}_1" output="${XXX_SHORTNAME}_Statement_${STATEMENT_DATE}" output-type="pdf" delivery="email1">
<xapi:template type="rtf" location="xdo://AR.XXX_STATEMENT_PRINT.en.00/?getSource=true" filter="/ARXSGPO_CPG/LIST_G_SETUP/G_SETUP/LIST_G_STATEMENT/G_STATEMENT[XXX_CUST_MODE='Email']"/>
</xapi:document>
<xapi:document key="${CUSTOMER_ID}_2" output="${XXX_SHORTNAME}_Statement_${STATEMENT_DATE}_Agent" output-type="pdf" delivery="email2">
<xapi:template type="rtf" location="xdo://AR.XXX_STATEMENT_PRINT.en.00/?getSource=true" filter="/ARXSGPO_CPG/LIST_G_SETUP/G_SETUP/LIST_G_STATEMENT/G_STATEMENT[XXX_AGENT_MODE='Email']"/>
</xapi:document>
</xapi:request>
</xapi:requestset>

Catch ya!
Gareth

This is a post from Gareth's blog at http://garethroberts.blogspot.com

References

Related Posts

8 comments:

Unknown said...

Hi Gareth,

Just curious to know....is it possible we will do it without RTF file?

Regards,
Prakash

Unknown said...

Hi Gareth,

Thanks for the example. I am working on a requirement where the report has data group, and each group has email address. I need to burst the email to all the email with replacing few body content with XML elements.

I have put sample XML file in this link - https://forums.oracle.com/forums/thread.jspa?messageID=10017611&#10017611

Regards
Tauseef

Gareth said...

Hi Tauseef,

Do you have an issue? If so please respond to your Forums post.

Thanks,
Gareth

Unknown said...

Hi Gerath,

Thanks for your reply, I have an issue and I have update BI Publisher forum, yet no update. So thought of asking you, if you could help.

Thread Link - https://forums.oracle.com/forums/thread.jspa?messageID=10017611&#10017611

Appreciate your inputs.

Regards
Tauseef

mahakk01 said...

This gives an example on Bursting Control file. The code is bit difficult to understand but you will get it after practicing two or three times. I just want to thank you for this post. Keep posting such useful information.
sap upgrades

Nalin said...

Hi Gareth,
Is there a way to pass SMTP server and Port details in the Bursting control file using application profile (FND_SMTP_HOST and FND_SMTP_PORT).
I want to remove hard coding in the Bursting file.

Thanks!

Regards
Nalin

Gareth said...

Hi Nalin,

You can put them in your SQL statement that is generating the XML (Data Template or Reports RDF).

Regards,
Gareth

RV said...

Hi Gareth,

I have implemented same like your script. I am facing below error. Please can you help me.


XML/BI Publisher Version : 5.6.3
Updating request description
Retrieving XML request information
Preparing parameters
Set Bursting parameters..
Bursting propertes.....
{user-variable:cp:territory=US, user-variable:cp:ReportRequestID=3421721, user-variable:cp:language=en, user-variable:cp:responsibility=20678, user-variable.OA_MEDIA=http://r12dev.corp.yodlee.com:8000/OA_MEDIA, burstng-source=EBS, user-variable:cp:DebugFlag=Yes, user-variable:cp:parent_request_id=3421721, user-variable:cp:locale=en-US, user-variable:cp:user=RTHATIPALLI, user-variable:cp:application_short_name=XDO, system-temp-dir=/tmp, user-variable:cp:request_id=3421723, user-variable:cp:org_id=101, user-variable:cp:reportdescription=YDL Invoice Print Selected Invoices, user-variable:cp:Dummy for Data Security=N}
Start bursting process..
Bursting process complete..
Generating Bursting Status Report..
--Exception
ZIP file must have at least one entry
java.util.zip.ZipException: ZIP file must have at least one entry
at java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:304)
at oracle.apps.xdo.oa.cp.JCP4XDOBurstingEngine.zipOutputFiles(JCP4XDOBurstingEngine.java:534)
at oracle.apps.xdo.oa.cp.JCP4XDOBurstingEngine.runProgram(JCP4XDOBurstingEngine.java:292)
at oracle.apps.fnd.cp.request.Run.main(Run.java:157)

Thanks,
RV