cancel
Showing results for 
Search instead for 
Did you mean: 

Collect mailmessages with attachments (xml)

Former Member
0 Kudos

I am getting some problems to collect a mail message with a XML attachment.

For this scenario I use the Sender Mail adapter and I would like to collect several mail messages with attachments for 10 minutes and put them together in one file with the File Adapter (NFS).

To make it not to complicated I started to read one mail message with attachment.

From the mail message I would like to use the message text in the mail. The attachment is an XML file with 3 fields (Name, Adress, ID).

The output file is based on :

- Message (input is the text in the mail message)

- Name

- Adress

- ID

My CC Mail Sender settings are:

Transport protocol: Pop3

Message protocol: XIPayload

Mailattributes : Use Mail Package = yes

Keep Attachments = yes

Based on several how to’s from this website, how to import mails with attachments.

When this message is send to XI the substance tells me in the monitor that I use 2 Payloads:

- Mail Message (text/xml;charset=utf-8)

- MailAttachment-1 (text/xml;name=”testattachment.xml”)

Because I would like to combine those 2 messages into 1 file. I use a fork in BPM.

To create relation for BPM I added after the inbound receiving for each input message a field “relation”, which is needed for correlation in BPM.

But my problem is, because the payload exist of 2 messages and it is only possible to reach only on at the same time..

In my message mapping I have two inputs: Mail and Attachment and my output is one message.

Is their a solution how I can combine those 2 payloads into one, before it’s getting into the BPM scenario or where I can use more payloads at the same time?

I already tried looking for this at post on SDN, but I could not find anything similar.

null

Accepted Solutions (0)

Answers (3)

Answers (3)

STALANKI
Active Contributor
0 Kudos

I would suggest to do it using SAPConnect instead of ccBPM.Check this blog.

It splits the payload and sends it as multiple attachment.https://weblogs.sdn.sap.com/pub/wlg/3007.Source [original link is broken] [original link is broken] [original link is broken] [original link is broken] code sends multple attachments as an email.

You have to use the viceversa.Read the thomas jung blogs for further info /people/thomas.jung3/blog/2004/09/09/receiving-e-mail-and-processing-it-with-abap--version-610-and-higher .

stefan_grube
Active Contributor
0 Kudos

Hi Roy,

you can only combine the attchments with help of an adapter module.

A more complex solution would be using an ABAP or Java proxy implementation.

In XI there is no standard functionality for merging attachments.

Regards

Stefan

Former Member
0 Kudos

Hello Stefan,

For the correct completion of the attachment I used the module " AF_Module PayloadSwapBean" from the Step by step Blog from Michal Krawczyk. But the problem is when both (mail and attachment) are involved, there is no entry in cBPM. Only with separate handling it gets into cBPM.

Regards Roy

Former Member
0 Kudos

Hi,

Use the BPM below steps.

Receive->Receive -> Transformation(n:1) ->( Loop -> Receive -> Container ->Container )->Send

Loop (Condition integer i not equal 10)

Loop -> Receive -> Container ->Container (These steps you need to use Inside the loop only) Select loop use inside option.

For container declare one integer variable ' i'.

one container for initialization and another one for increment.

Regards,

Venu.

Former Member
0 Kudos

Hi Venu,

When I try to use your suggestion, I get a problem with my message interface.

In my communication channel (CC) for the Mail Adapter (Sender) you need to set the Default XI parameters with a default interface name.

In my case I have the input of one interface of the mail message

and one interface of the attachment. But in CC you can only work only with one message interface.

When I try to work with only one, only one message will be processed. So just the mail message not the attachment, or the other way around.

Is their another solution, to prevend this?

Grtz Roy