B.2. Email Task Attributes
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.
Design a BPMN2 process definition in the Process Designer of Business Central. Add an Email Service task to the workflow.

-
Select the
Email Service Taskand open the Properties panel. Open Assignments and fill in the
To,From,Subject, andBodyproperties, and any other relevant input attributes.
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 Definitionsproperty 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:
- Open the Project Editor and click Project Settings: Project General Settings → Deployment descriptor from the menu.
Scroll down to the Work Item handlers list and click Add to add the
EmailWorkItemHandlerto 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
The Deadline email feature can be configured in two ways:
Mail Session on Container Level
With this method, the Deadline email feature uses
EmailSessionProducerto look up themail/jbpmMailSessionvia JNDI. The following example is for Red Hat JBoss EAP 6standalone.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>Using email.properties
If the
mail/jbpmMailSessionis not found, Red Hat JBoss BPM Suite searches for/email.propertiesin the class path. The content should look like 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
Fromaddress 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.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.