Google Email Service
The Google App Engine enables authenticated users programmatic access to the Email Service. This is a pretty useful feature in workflows for example for notification messages like in the introductory subscription process.
The expressFlow framework integrates the Google Email Service by the use of the Java Mail API. To get started with this topic we suggest you to read the Java Mail docs from Google App Engine.
The integration of the Java Mail API function calls are encapsulated in the com.expressflow.engine.commands.SendEmailCommand class.
The Command extracts workflow task information from the com.expressflow.model.SendEmail class and sets up the Java Mail Message. The sender details are extracted from the Google UserService which provides programmatic access to the authenticated User. This functionality enables the workflow engine to send Emails in the context of the currently active user.
The recipient is extracted from the information provided in the workflow designer. The workflow designer supports two different ways to add a Recipient to an Email:
- Directly set in the Email details
- Derived from a Variable definition
Whereas the first definition is straight forward, the second allows more flexibility in the definition of recipients: Email recipients do not need to be defined at process design-time. They can be set during the execution of the workflow. This means you can for example define an email variable as part of a Mobile Human Task. With this definition, a user can define the recipient at the beginning of a workflow.
The subject of the Email task needs to be defined at design time. The message body is processed in the same manner as the recipient:
The information for the message body can be set during design time or can be injected during execution time as a value of a predefined variable. Both approaches have advantages and disadvanteges. You have to decide on your own.
Anyway: Enjoy modeling in the cloud!
blog comments powered by Disqus