Package org.jbpm.workitem.google.mail
Class SendMailWorkitemHandler
- java.lang.Object
-
- org.jbpm.process.workitem.core.AbstractLogOrThrowWorkItemHandler
-
- org.jbpm.workitem.google.mail.SendMailWorkitemHandler
-
- All Implemented Interfaces:
org.kie.api.runtime.process.WorkItemHandler
@Wid(widfile="GoogleSendMailDefinitions.wid",name="GoogleSendMail",displayName="GoogleSendMail",defaultHandler="mvel: new org.jbpm.process.workitem.google.mail.SendMailWorkitemHandler(\"appName\", \"clentSecret\")",documentation="google-mail-workitem/index.html",category="google-mail-workitem",icon="GoogleSendMail.png",parameters={@WidParameter(name="To"),@WidParameter(name="From"),@WidParameter(name="Subject"),@WidParameter(name="BodyText"),@WidParameter(name="Attachment",runtimeType="org.jbpm.document.Document")},results=@WidResult(name="Message",runtimeType="com.google.api.services.gmail.model.Message"),mavenDepends=@WidMavenDepends(group="org.jbpm.contrib",artifact="google-mail-workitem",version="7.65.0.Final"),serviceInfo=@WidService(category="Google Mail",description="Send mail via Google",keywords="google,mail,email,send",action=@WidAction(title="Send email using Google Mail"),authinfo=@WidAuth(required=true,params={"appName","clentSecret"},paramsdescription={"Google app name","Google client secret"},referencesite="https://developers.google.com/gmail/api/auth/about-auth"))) public class SendMailWorkitemHandler extends org.jbpm.process.workitem.core.AbstractLogOrThrowWorkItemHandler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSendMailWorkitemHandler.InputStreamDataSource
-
Constructor Summary
Constructors Constructor Description SendMailWorkitemHandler(String appName, String clentSecret)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabortWorkItem(org.kie.api.runtime.process.WorkItem wi, org.kie.api.runtime.process.WorkItemManager wim)javax.mail.internet.MimeMessagecreateEmailWithAttachment(String to, String from, String subject, String bodyText, org.jbpm.document.Document attachment)static com.google.api.services.gmail.model.MessagecreateMessageWithEmail(javax.mail.internet.MimeMessage emailContent)voidexecuteWorkItem(org.kie.api.runtime.process.WorkItem workItem, org.kie.api.runtime.process.WorkItemManager workItemManager)com.google.api.services.gmail.model.MessagesendMessage(com.google.api.services.gmail.Gmail service, String to, String from, String subject, String bodyText, org.jbpm.document.Document attachment)voidsetAuth(GoogleMailAuth auth)
-
-
-
Method Detail
-
executeWorkItem
public void executeWorkItem(org.kie.api.runtime.process.WorkItem workItem, org.kie.api.runtime.process.WorkItemManager workItemManager)
-
abortWorkItem
public void abortWorkItem(org.kie.api.runtime.process.WorkItem wi, org.kie.api.runtime.process.WorkItemManager wim)
-
sendMessage
public com.google.api.services.gmail.model.Message sendMessage(com.google.api.services.gmail.Gmail service, String to, String from, String subject, String bodyText, org.jbpm.document.Document attachment) throws javax.mail.MessagingException, IOException- Throws:
javax.mail.MessagingExceptionIOException
-
createMessageWithEmail
public static com.google.api.services.gmail.model.Message createMessageWithEmail(javax.mail.internet.MimeMessage emailContent) throws javax.mail.MessagingException, IOException- Throws:
javax.mail.MessagingExceptionIOException
-
createEmailWithAttachment
public javax.mail.internet.MimeMessage createEmailWithAttachment(String to, String from, String subject, String bodyText, org.jbpm.document.Document attachment) throws javax.mail.MessagingException, IOException
- Throws:
javax.mail.MessagingExceptionIOException
-
setAuth
public void setAuth(GoogleMailAuth auth)
-
-