on 06-22-2006 12:11 PM
Hi All,
Is it possible to send a mail with the content of user defined function.
I have a requiremnt saying, number of records processed related to header records needs to send a mail to third party people.
Following is the information i need to send:
MappingTrace writetrace;
writetrace = container.getTrace();
try
{
result.addValue(a[0]);
writetrace.addWarning("number of D1 records processed for " b[0] "is:"+ a[0]);
}
catch(RuntimeException e)
{
writetrace.addWarning("value is"+a[0] );
throw e;
}
Thanks,
venu.
Hi,
yes this is possible:
1. you can create a java archive which will send the mail
and invoke a method of this java class in your
user defined function with the value of the number
of your records
2. you can do your scenario in a BPM
and do it properly (and clearly) with mail adapter
then you won't need to do any mail sending from UDF
Regards,
michal
-
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michal,
Thank you very much.
I'm trying to use the following java code.
import java.util.Properties;
import javax.mail.*;
import javax.mail.Session.*;
import javax.mail.internet.*;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.InternetAddress;
import javax.mail.Message;
import javax.mail.internet.MimePartDataSource;
public class SendJavaMail
{
public SendJavaMail()
{
}
public static void main(String[] args)
{
Properties props = new Properties();
props.setProperty("abcd","xyz");
Session session = Session.getDefaultInstance(props,null);
try
{
MimeMessage mMeassage = new MimeMessage(session);
mMeassage.setSubject("Subject");
mMeassage.setText("Hello");
InternetAddress fromAddress = new InternetAddress("venugopal.sirangi@southernwater.co.uk");
InternetAddress toAddress = new InternetAddress("sougata.deb@southernwater.co.uk");
mMeassage.setFrom(fromAddress);
mMeassage.setRecipient(Message.RecipientType.TO,toAddress);
Transport transport = session.getTransport("SMTP");
transport.connect("mailhost","","");
transport.send(mMeassage);
transport.close();
}
catch (MessagingException e)
{
System.out.println(e.getMessage());
}
}
}
Getting error in Netweaver dev studio:
Included necssary jars also.
java.lang.NoClassDefFoundError: javax/activation/DataSource
at MvpDevelopment.SendJavaMail.main(SendJavaMail.java:38)
Exception in thread "main" .
can we use this type of code in XI r else any modifications i needed to do?
Thanks,
venu.
Hi,
activation.jar can be downloaded from
http://java.sun.com/products/javabeans/jaf/downloads/index.html
if you want to test in NWDS
Regards,
michal
-
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>
Hello Venu,
Instead of importing the XSD, you could create a Data Type "Mail" with the structure as below: The Data type has to be called "Mail"
-
Subject
-
From
-
To
-
X_Mailer
-
Content
You could then create a Message Type and a Message Interface from this to be used in your BPM. This should work. Hope this helps.
Let me know.
Regards,
Shailesh
>
> Hi Bavesh,
>
> Thank you.
>
> when I'm trying to do this scenario.
>
> Importing the given xsd as target is giving problem saying:
>
> Cause: Unable to recognize the loaded document as valid WSDL Tag schema is not permitted as a root element. definitions is expected
>
> Thanks,
> venu.
You can get this error when creating the External Definition of the wrong category type for the given input file. For example you have the setting "Category" as WSDL (default option) when you are really trying to import an XSD from the source file. Try to select the correct format category from the drop down list and then select the file again to import.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.