Class 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
    • Constructor Detail

      • SendMailWorkitemHandler

        public SendMailWorkitemHandler​(String appName,
                                       String clentSecret)
    • 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.MessagingException
        IOException
      • createMessageWithEmail

        public static com.google.api.services.gmail.model.Message createMessageWithEmail​(javax.mail.internet.MimeMessage emailContent)
                                                                                  throws javax.mail.MessagingException,
                                                                                         IOException
        Throws:
        javax.mail.MessagingException
        IOException
      • 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.MessagingException
        IOException