This discussion is archived
2 Replies Latest reply: Jan 18, 2013 1:19 AM by prabhudassv RSS

How to handle NULL email address in XML Bursting control

prabhudassv Newbie
Currently Being Moderated
Hi,

I have a bursting control file for writing a file to file system and email the file to two different email address. The file works fine when the email address tag has values. But when the value is null it picks the value from different element

I have 2 email deliveries. one to bill to customer with template A and second one is to ship to customer CC to bill to customer with template B. Also write both the output files to file system using delivery id (333 and 444)

The bursting file is as below

<?xml version="1.0" encoding="UTF-8" ?>
- <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi">
- <xapi:request select="/G_SO_HEADER">
- <xapi:delivery>
- <xapi:email id="BILL_ID" server="localhost" port="25" from="test@XYZ.com" reply-to="noreply@xyz.com">
- <xapi:message id="BILL_ID" to="${CF_BILL_TO_EMAIL}" cc="" bcc="" content-type="text/html" attachment="true" subject="Bill to- ${CF_SUBJECT}">
</xapi:message>
</xapi:email>
- <xapi:email id="SHIP_ID" server="localhost" port="25" from=" test@XYZ.com " reply-to="noreply@xyz.com">
- <xapi:message id="SHIP_ID" to="${CF_SHIP_TO_EMAIL}" cc="${CF_BILL_TO_EMAIL}" bcc="" content-type="text/html" attachment="true" subject="Ship To ${CF_SUBJECT}">
</xapi:message>
</xapi:email>
<xapi:filesystem id="333" output="/eas/app/${CF_REP_INSTANCE}/11i/XX/11.5.0/data/ ${SO_NUMBER}" />
<xapi:filesystem id="444" output="/eas/app/${CF_REP_INSTANCE}/11i/XX/11.5.0/data/ ${SO_NUMBER}" />
</xapi:delivery>
- <xapi:document output-type="pdf" delivery="444">
<xapi:template type="rtf" location="xdo://XYZ.BILL_TO_REPORT.en.US/?getSource=true" />
</xapi:document>
- <xapi:document output-type="pdf" delivery="333">
<xapi:template type="rtf" location="xdo://XYZ.SHIP_TO_REPORT.en.US/?getSource=true" />
</xapi:document>
- <xapi:document output="Ship_to_${SO_NUMBER}" output-type="pdf" delivery="SHIP_ID">
<xapi:template type="rtf" location="xdo://XYZ.SHIP_TO_REPORT.en.US/?getSource=true" filter=".//G_SO_HEADER[CF_SHIP_TO_EMAIL!='']" />
</xapi:document>
- <xapi:document output="Bill_To_${SO_NUMBER}" output-type="pdf" delivery="BILL_ID">
<xapi:template type="rtf" location="xdo://XYZ.BILL_TO_REPORT.en.US/?getSource=true" filter=".//G_SO_HEADER[CF_BILL_TO_EMAIL!='']" />
</xapi:document>
</xapi:request>
</xapi:requestset>

The issue is, if record A has both Ship To and Bill To email it works fine. But if record B has only Ship to and no Bill To (i.e Bill to is null in the XML data), the bursting takes the Bill To address of A and sends the file. Is there a way to reset the variable in bursting control file.

Thanks.
  • 1. Re: How to handle NULL email address in XML Bursting control
    shreevat Pro
    Currently Being Moderated
    bursting won't take a value from a different variable. I think there is some issue with the variable CF_BILL_TO_EMAIL. Check if you are setting a different value if the value is null before invoking the bursting file.

    Thanks
    Shree
  • 2. Re: How to handle NULL email address in XML Bursting control
    prabhudassv Newbie
    Currently Being Moderated
    Hi Shree,

    I checked the XML output and the record looks fine. Say for example if my XML out is having 3 records as below

    Record 1: Bill_To_email : b1@ABC.COM and Ship_to_email : s1@ABC.com
    REcord 2: Bill_to_email : NULL and Ship_to_email: s2@XYZ.com
    Record 3: Bill_to_email: NULL and Ship_to_email: Null

    Bursting has triggered emails like (2 emails with different templates for each records has to be sent one for Bill_to delivery and another one for Ship_to delivery with CC to Bill_to person)

    For record one it is fine as it has both email address:

    1. 1st email with TO address as b1@ABC.COM which is as per the Bill_to_email delivery id
    To: b1@ABC.com
    2. 2nd email with TO Address as s1@ABC.com and CC address as b1@ABC.com as per the ship_to_email delivery id

    To: s1@ABC.com
    CC: b1@ABC.com

    But the issue is for second record which has only Ship_to and no bill_to email address
    The mail is wrongly generated as below

    1. No bill to mail generated as there is a filter condition to check if Bill_to email is not null -- which is fine and as expected
    2. but Ship_to email got generated with CC of first records Bill_to email
    To : S2@XYZ.com
    CC : b1@ABC.com << Email address from first record though it is null in the generated XML for the second record>>

    For 3 red record no emails generated
    1. As for Bill_to delivery id the filter to check bill_to_email_address should not be null
    2. For Ship_to email the filter to check ship_to_email_address should not be null.


    Please suggest.

    thanks

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points