Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
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.
- Design a BPMN2 process definition in the Process Designer of Business Central. Add the Email task to the workflow.
-
Select the Email task and click
to 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");new org.jbpm.process.workitem.email.EmailWorkItemHandler("localhost","25","me@localhost","password");Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, email server parameters can be supplied using a constructor in the
ProcessMain.javafile:EmailWorkItemHandler emailWorkItemHandler = new EmailWorkItemHandler("localhost", "1125", "", "",true); ksession.getWorkItemManager().registerWorkItemHandler("Email", emailWorkItemHandler );EmailWorkItemHandler emailWorkItemHandler = new EmailWorkItemHandler("localhost", "1125", "", "",true); ksession.getWorkItemManager().registerWorkItemHandler("Email", emailWorkItemHandler );Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Configuring Deadline
You can configure the Deadline email feature in two ways:
Mail Session on Container Level
With this method, the Deadline email feature uses
EmailSessionProducerto look up themail/jbpmMailSessionusing JNDI. The following example is for Red Hat JBoss EAPstandalone.xml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Using email.properties
If the
mail/jbpmMailSessionis not found, Red Hat JBoss BPM Suite searches for/email.propertieson 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
mail.smtp.host=localhost mail.smtp.port=25 mail.from=xxx@xxx.com mail.replyto=xxx@xxx.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow
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
"Success" = trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow
The Email task is completed immediately and cannot be aborted.