이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 32. Email Task


The Email task sends an email based on the task properties.

Registering Email Task in Business Central

Email task is not registered by default in Business Central, and therefore must be registered by the user.

Follow the procedure below to configure Business Central to use Email service task.

  1. Design a BPMN2 process definition in the Process Designer of Business Central. Add the Email task to the workflow.
  2. Select the Email task and click 3140 to open the Properties panel.
  3. Open Assignments and fill in the To, From, Subject, and Body properties, and any other relevant input attributes.

    user guide Emailtask2

    Alternatively, values can be mapped to properties using Process Variable to Task Variable mapping assignments.

    From the Process Designer, open the Properties panel and select the Variable Definitions property to map variables.

Registering EmailWorkItemHandler

EmailWorkItemHandler is the work item handler implementation of the Email Service task. The Email work item is included in the work item definition file by default, however EmailWorkItemHandler is not a part of the default kie-deployment-descriptor.xml file, and therefore must be explicitly registered by the user.

To register EmailWorkItemHandler:

  1. Open the Project Editor and click Project Settings: Project General Settings Deployment descriptor from the menu.
  2. Scroll down to the Work Item handlers list and click Add to add the EmailWorkItemHandler to the list. For example:

    new org.jbpm.process.workitem.email.EmailWorkItemHandler("localhost","25","me@localhost","password");

    Alternatively, email server parameters can be supplied using a constructor in the ProcessMain.java file:

    EmailWorkItemHandler emailWorkItemHandler = new EmailWorkItemHandler("localhost", "1125", "", "",true); ksession.getWorkItemManager().registerWorkItemHandler("Email", emailWorkItemHandler );

Configuring Deadline

You can configure the Deadline email feature in two ways:

  1. Mail Session on Container Level

    With this method, the Deadline email feature uses EmailSessionProducer to look up the mail/jbpmMailSession using JNDI. The following example is for Red Hat JBoss EAP standalone.xml:

    <system-properties>
    ...
      <property name="org.kie.mail.session" value="java:jboss/mail/mail/jbpmMailSession"/>
    ...
    </system-properties>
    ...
    <subsystem xmlns="urn:jboss:domain:mail:1.2">
      <mail-session name="default" jndi-name="mail/jbpmMailSession" >
        <smtp-server outbound-socket-binding-ref="mail-smtp" tls="true">
          <login name="email@gmail.com" password="___"/>
        </smtp-server>
      </mail-session>
    </subsystem>
    ...
    <outbound-socket-binding name="mail-smtp">
      <remote-destination host="smtp.gmail.com" port="587"/>
    </outbound-socket-binding>
  2. Using email.properties

    If the mail/jbpmMailSession is not found, Red Hat JBoss BPM Suite searches for /email.properties on the class path with content similar to the following:

    mail.smtp.host=localhost
    mail.smtp.port=25
    mail.from=xxx@xxx.com
    mail.replyto=xxx@xxx.com

Input Attributes

The following parameters are required by default:

To
The email address of the email recipient. Separate multiple addresses by a semicolon (;).
From
The email address of the sender of the email.
Subject
The subject of the email.
Body
The HTML body of the email.

The following parameters are optional, and can be configured by mapping values assigned to these properties using Process Variable to Task Variable mapping in Assignments:

Reply-To
Sets the reply recipient address to the From address of the received message. Separate multiple addresses by a semicolon (;).
Cc
The email address of the carbon copy recipient. Separate multiple addresses by a semicolon (;).
Bcc
The email address of the blind carbon copy recipient. Separate multiple addresses by a semicolon (;).
Attachments
The URL of the files you want to attach to the email. Multiple attachments can be added to the email using a comma (,) to separate each URL in the list.
Debug

A boolean value related to the execution of the Email work item. For example:

"Success" = true

The Email task is completed immediately and cannot be aborted.

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.