[jboss-user] [jBPM] - Re: How to use Email service in JBPM 5.x?

Rajan Vij do-not-reply at jboss.com
Thu Jun 28 12:14:26 EDT 2012


Rajan Vij [https://community.jboss.org/people/rajvij] created the discussion

"Re: How to use Email service in JBPM 5.x?"

To view the discussion, visit: https://community.jboss.org/message/744842#744842

--------------------------------------------------------------
It is simple all you need to have a valid SMTP available.

Rest add following code to your process java file.

startUp();  
KnowledgeBase kbase = readKnowledgeBase(); 
StatefulKnowledgeSession ksession = JBPMHelper.newStatefulKnowledgeSession(kbase);
 EmailWorkItemHandler emailHandler1 = new EmailWorkItemHandler(); 
emailHandler1.setConnection(" http://smtp.gmail.com/ smtp.gmail.com","587", "u mailto:rajandeepvij at gmail.com remailId", "password"); 
emailHandler1.getConnection().setStartTls(true); 
ksession.getWorkItemManager().registerWorkItemHandler("Email",emailHandler1); 
ksession.startProcess("com.sample.bpmn.hello"); 
System.out.println("Process started ...");
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/744842#744842]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120628/f736934b/attachment.html 


More information about the jboss-user mailing list