Package org.jbpm.process.workitem.email

## Class EmailWorkItemHandler

- java.lang.Object
- - org.jbpm.process.workitem.core.AbstractLogOrThrowWorkItemHandler
  - - org.jbpm.process.workitem.email.EmailWorkItemHandler

- All Implemented Interfaces:
    `org.kie.api.runtime.process.WorkItemHandler`

      @Wid(widfile="EmailDefinitions.wid",name="Email",displayName="Email",defaultHandler="mvel: new org.jbpm.process.workitem.email.EmailWorkItemHandler()",documentation="jbpm-workitems-email/index.html",category="jbpm-workitems-email",icon="defaultemailicon.png",parameters={@WidParameter(name="From"),@WidParameter(name="To"),@WidParameter(name="Reply-To"),@WidParameter(name="Cc"),@WidParameter(name="Bcc"),@WidParameter(name="Body"),@WidParameter(name="Template"),@WidParameter(name="Subject"),@WidParameter(name="Attachments"),@WidParameter(name="Debug")},mavenDepends=@WidMavenDepends(group="org.jbpm",artifact="jbpm-workitems-email",version="7.59.1-SNAPSHOT"),serviceInfo=@WidService(category="Email",description="Send an email",keywords="send,email",action=@WidAction(title="Send email"),authinfo=@WidAuth(required=true,params={"host","port","username","password"},paramsdescription={"Host","Port","User Name","Password"})))
      public class EmailWorkItemHandler
      extends AbstractLogOrThrowWorkItemHandler

  WorkItemHandler for sending email. Expects the following parameters: - "From" (String): sends an email from the given the email address - "To" (String): sends the email to the given email address(es), multiple addresses must be separated using a semi-colon (';') - "Subject" (String): the subject of the email - "Body" (String): the body of the email (using HTML) - "Template" (String): optional template to generate body of the email, template when given will override Body parameter Is completed immediately and does not return any result parameters. Sending an email cannot be aborted.

- - ### Field Summary

    - ### Fields inherited from class org.jbpm.process.workitem.core.AbstractLogOrThrowWorkItemHandler

      `handlingProcessId, handlingStrategy, logThrownException, retries`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `EmailWorkItemHandler()` |
    `EmailWorkItemHandler​(String handlingProcessId, String handlingStrategy)` |
    `EmailWorkItemHandler​(String host, String port, String userName, String password)` |
    `EmailWorkItemHandler​(String host, String port, String userName, String password, String startTls)` |
    `EmailWorkItemHandler​(String host, String port, String userName, String password, String handlingProcessId, String handlingStrategy)` |
    `EmailWorkItemHandler​(String host, String port, String userName, String password, String startTls, String handlingProcessId, String handlingStrategy)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `abortWorkItem​(org.kie.api.runtime.process.WorkItem arg0, org.kie.api.runtime.process.WorkItemManager arg1)` |
    `protected Email` | `createEmail​(org.kie.api.runtime.process.WorkItem workItem, Connection connection)` |
    `void` | `executeWorkItem​(org.kie.api.runtime.process.WorkItem workItem, org.kie.api.runtime.process.WorkItemManager manager)` |
    `Connection` | `getConnection()` |
    `protected boolean` | `getDebugFlag​(org.kie.api.runtime.process.WorkItem workItem)` |
    `void` | `setConnection​(String host, String port, String userName, String password)` |
    `void` | `setConnection​(String host, String port, String userName, String password, String startTls)` |

    - ### Methods inherited from class org.jbpm.process.workitem.core.AbstractLogOrThrowWorkItemHandler

      `findNodeInstance, handleException, handleException, setLogThrownException`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EmailWorkItemHandler

          public EmailWorkItemHandler()

    - #### EmailWorkItemHandler

          public EmailWorkItemHandler​(String host,
                                      String port,
                                      String userName,
                                      String password)

    - #### EmailWorkItemHandler

          public EmailWorkItemHandler​(String host,
                                      String port,
                                      String userName,
                                      String password,
                                      String startTls)

    - #### EmailWorkItemHandler

          public EmailWorkItemHandler​(String handlingProcessId,
                                      String handlingStrategy)

    - #### EmailWorkItemHandler

          public EmailWorkItemHandler​(String host,
                                      String port,
                                      String userName,
                                      String password,
                                      String handlingProcessId,
                                      String handlingStrategy)

    - #### EmailWorkItemHandler

          public EmailWorkItemHandler​(String host,
                                      String port,
                                      String userName,
                                      String password,
                                      String startTls,
                                      String handlingProcessId,
                                      String handlingStrategy)

  - ### Method Detail

    - #### setConnection

          public void setConnection​(String host,
                                    String port,
                                    String userName,
                                    String password)

    - #### setConnection

          public void setConnection​(String host,
                                    String port,
                                    String userName,
                                    String password,
                                    String startTls)

    - #### getConnection

          public Connection getConnection()

    - #### executeWorkItem

          public void executeWorkItem​(org.kie.api.runtime.process.WorkItem workItem,
                                      org.kie.api.runtime.process.WorkItemManager manager)

    - #### createEmail

          protected Email createEmail​(org.kie.api.runtime.process.WorkItem workItem,
                                      Connection connection)

    - #### abortWorkItem

          public void abortWorkItem​(org.kie.api.runtime.process.WorkItem arg0,
                                    org.kie.api.runtime.process.WorkItemManager arg1)

    - #### getDebugFlag

          protected boolean getDebugFlag​(org.kie.api.runtime.process.WorkItem workItem)