Extracting Data from a Task Notification Return E-mail
When you design a task notification, you can create a task notification action that sends an e-mail to a specified recipient. You can include a Task Action Link control in the e-mail message to enable the recipient to send an e-mail response back to the Task Engine. For more information, see:
As a task developer, you might want to extract certain information from the return e‑mail message to use in further task processing, such as the sender, the date, attachments, body text, or anything else contained in the e-mail message.
For example, you might design the task notification e-mail so the recipient can approve or reject a purchase order using the task action link, and also enable the user to optionally enter a comment. When a comment is present, you want to extract the comment from the return e‑mail message and include it in the task information, along with the user ID of the sender.
You can do all of this when you create the action that is executed when the return e-mail message is received. From the Java code of the action being executed, you can access the original Mime e-mail message object from the faces context under the "mimeMessage" bean name. From this object you can further access all e-mail properties and data:
javax.mail.internet.MimeMessage mimeMessage =
resolveExpression("#{mimeMessage}");
Related Topics