on 10-16-2006 9:02 PM
Hello all,
I want to use a Java Mapping with the functionality to create a second /attachment which I can send over email out?
I dont want to pick this file somewhere from the server, instead I want to fill the content of the additional attachment directly in the java mapping.
I hope somebody knows the answer of my question.
If its possible is there any kind of example??
Many thanks for your help
ilka
Hi,
Like pointed out either use adapter modules or, use mail API's inside the Java Mapping to send the mail.
One more option (though am not sure if it makes sense) , is to trigger XI alerts from your Java Mapping and then pass the the alert content to the Mail.
Something of this sort, I have explored in my blog,
/people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ilka,
Unfortunately, XI mapping programs (Message, XSLT, or java) do not have access to the attachment(s).
The only way that I know to accomplish this is by using an adapter user-module, which does have access to attachment contents and able to create/change attachment(s).
Regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Stefan,
http://scn.sap.com/thread/1874962
Regarding the comment in this thread, can you please tell me if you have faced any issue with creating output attachments. Right now, i have a message mapping in which i have written a udf to create attachments
this message mapping is a multi mapping and the source is 0-unb. I have used a return as xml on the root message and pointed it to the udf after split by value.
There are three root nodes in one of my cases, and when this goes through this mapping, there is 1 attachemnt each created with three main documents and submain documents. However, all the attachments contain details of the first root node itself where in actually it should be each main and submain document having a different attachment. Please find my udf below. Please let me know if you think it is wrong somewhere.
udf :-
GlobalContainer globalContainer = container.getGlobalContainer();
OutputAttachments outputAttachments = globalContainer.getOutputAttachments() ;
int flag =0;
AbstractTrace trace = container.getTrace();
String attachmentName = "";
//for(int i=0;i<var1.length;i++){
try
{
var1=var1.replaceAll("><",">\n<");
attachmentName = "attachment"+cnt;
Attachment newopAttachment = outputAttachments.create((attachmentName), var1.getBytes("UTF-8"));
outputAttachments.setAttachment(newopAttachment);
trace.addInfo("newopAttachment"+newopAttachment);
cnt=cnt+1;
attachmentName ="";
newopAttachment = null;
var1="";
}
catch (Exception e)
{
trace.addInfo("ever reaching trace");
e.printStackTrace();
}
//result.addValue("1");
//}
//result.addValue("1");
return "1";
----
Input :-
Messages
Message1
SBDH
SBDH
SBDH
Each of the above SBDH, i have returned as xml and pointed to the udf after split by value
Your help is highly appreciated.
Regards,
Ninu
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.