GrailsFlow

Send Event via Email: Corrections related to Email Reply

Details

  • Type: New Feature New Feature
  • Status: Test Internally Test Internally
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.0
  • Fix Version/s: 1.0
  • Component/s: None
  • Labels:
    None
  • Request Controller:
    Scheibe, Andreas
  • External Supervisor:
    Voitovich, Mary
  • Executing Programmer:
    Voitovich, Mary
  • Ext Project Id:
    GRUJA-01.2

Description

The following corrections to send events via email (see GFW-45) are required:

1. The user who gets notification email should reply to this mail.

In current implementation notification email contains links for creating event emails - this is wrong.
An explicit Email Reply is needed instead.
The email reply has the advantage that user can see that email was replyed.

2. Reply should be of text/plain content type (simple text, not HTML)

3. Message body should contain all necessary information for Node execution:

  • processID=<processID>
  • nodeID=<nodeID>
  • event=<event> – which event will be executed
  • reqester=<user name> – who invokes execution
  • <varName>=<varValue> – for all necessary variables

Keys that used for processID, nodeID, event, etc and even message format may vary, so application should have possibility configure EventEmailResieverJob to use it's own implementation of how to parse email message.

4. In case of incorrect contentType, wrong or missing values or errors returned by sendEvent() feedback email should be send back to user.

Issue Links

Activity

Hide
Voitovich, Maria added a comment - 29/Oct/09 1:31 PM - edited

Email processing updated:

  1. Created class com.jcatalog.grailsflow.extension.SendEventParameters to encapsulate parameters for ProcessManagerService.sendEvent():
  • Long processID
  • String nodeID
  • String requester
  • String event
  • Map<String, Object> variables
  1. Created common interface com.jcatalog.grailsflow.extension.email.EventEmailProcessor with 2 methods:
  • SendEventParameters parseEventMessage(Message message)
    method that should process email message and return parameters for sending event. If message is incorrect it should return null.
  • void processSendEventResult(Message message, SendEventParameters parameters, int result)
    method that after sending event receives original message, sendEvent parameters and the result returned by sendEvent(). Feedback notification can be implemented with this method.
Show
Voitovich, Maria added a comment - 29/Oct/09 1:31 PM - edited Email processing updated:
  1. Created class com.jcatalog.grailsflow.extension.SendEventParameters to encapsulate parameters for ProcessManagerService.sendEvent():
  • Long processID
  • String nodeID
  • String requester
  • String event
  • Map<String, Object> variables
  1. Created common interface com.jcatalog.grailsflow.extension.email.EventEmailProcessor with 2 methods:
  • SendEventParameters parseEventMessage(Message message)
    method that should process email message and return parameters for sending event. If message is incorrect it should return null.
  • void processSendEventResult(Message message, SendEventParameters parameters, int result)
    method that after sending event receives original message, sendEvent parameters and the result returned by sendEvent(). Feedback notification can be implemented with this method.
Hide
Voitovich, Maria added a comment - 29/Oct/09 2:11 PM

Implementation of the ticket requirements meet following problems:

  • Replies created by different email clients may different content types. text/plain , text/html, multipart/alternative were received as replies on the same mail with differently configured Mozilla Thunderbird clients. I can imagine that The Bat, Gmail and other may have event more content types. As a result it's not clear how to parse email body to get necessary values.
  • Reply patterns may differ for different email clients. Reply even may not content original message (also checked with Mozilla Thunderbird). So it's impossible to guarantee that when pressing on reply user will get variableName=variableValue pattern to fill it with values. In this case user would be forced to type variables names himself, which would lead to typos, losses and so on.

Since format or reply message is not clear, implementation of the EventEmailProcessor that will meet the requirements of the ticket was not done. To implement it we have to reduce possible variants of content type and format of reply message and expect that user's email client can create reply of necessary format.

Show
Voitovich, Maria added a comment - 29/Oct/09 2:11 PM Implementation of the ticket requirements meet following problems:
  • Replies created by different email clients may different content types. text/plain , text/html, multipart/alternative were received as replies on the same mail with differently configured Mozilla Thunderbird clients. I can imagine that The Bat, Gmail and other may have event more content types. As a result it's not clear how to parse email body to get necessary values.
  • Reply patterns may differ for different email clients. Reply even may not content original message (also checked with Mozilla Thunderbird). So it's impossible to guarantee that when pressing on reply user will get variableName=variableValue pattern to fill it with values. In this case user would be forced to type variables names himself, which would lead to typos, losses and so on.
Since format or reply message is not clear, implementation of the EventEmailProcessor that will meet the requirements of the ticket was not done. To implement it we have to reduce possible variants of content type and format of reply message and expect that user's email client can create reply of necessary format.
Hide
Voitovich, Maria added a comment - 30/Oct/09 4:26 PM

Description updated due to discussion with Mr. Scheibe.

Show
Voitovich, Maria added a comment - 30/Oct/09 4:26 PM Description updated due to discussion with Mr. Scheibe.
Hide
Voitovich, Maria added a comment - 03/Nov/09 2:57 PM

Implemented.

When EmailEventReceiverJob is enabled it checks specified email account and passes each mail to the eventEmailProcessor bean. Bean parces email and returns SendEventParameters bean that is used for sending event to the process.

Default implementation:

This implementation that is configured for Grailsflow plugin by default

Parses each email, gets from body:

  • processID=<processID> - process number to send event to. If not specified then no event sending will be invoked.
  • nodeID=<nodeID> - node name to send event to. If not specified then no event sending will be invoked.
  • event=<event> - which event will be executed. If not specified then no event sending will be invoked.
  • reqester=<user name> - who invokes execution. If not specified in email body then sender address will be used.
  • <varName>=<varValue> - for all necessary variables

If there are multiple values for the same key then first value will be taken.

Reply email example

event=approve
resolution=Ok

masha@mail.scand wrote:
> Reply to this email and modify following lines if necessary
>
> Please leave one of following lines for event in reply message:
> event=approve
> event=reject
> Note: if there's more than one event in the reply the first one will
> be used.
>
> Update values for variables
> resolution=
> Note: if there's more than one value for variable in the reply the
> first one will be used.
>
> !!Unable to render embedded object: File (PLEASE DON'T CHANGE FOLLOWING SERVICE INFORMATION) not found.!!
> processID=1
> nodeID=ManagerApproveHolidays

Default implementation does not send any feedback to the user.

Customizing

To have custom implementation of the email processing you should specify in the application context eventEmailProcessor bean that implements com.jcatalog.grailsflow.extension.email.EventEmailProcessor interface, i.e. for example of class that extends com.jcatalog.grailsflow.extension.email.GrailsflowEventEmailProcessor

Show
Voitovich, Maria added a comment - 03/Nov/09 2:57 PM Implemented. When EmailEventReceiverJob is enabled it checks specified email account and passes each mail to the eventEmailProcessor bean. Bean parces email and returns SendEventParameters bean that is used for sending event to the process.

Default implementation:

This implementation that is configured for Grailsflow plugin by default Parses each email, gets from body:
  • processID=<processID> - process number to send event to. If not specified then no event sending will be invoked.
  • nodeID=<nodeID> - node name to send event to. If not specified then no event sending will be invoked.
  • event=<event> - which event will be executed. If not specified then no event sending will be invoked.
  • reqester=<user name> - who invokes execution. If not specified in email body then sender address will be used.
  • <varName>=<varValue> - for all necessary variables
If there are multiple values for the same key then first value will be taken.
Reply email example
event=approve resolution=Ok masha@mail.scand wrote: > Reply to this email and modify following lines if necessary > > Please leave one of following lines for event in reply message: > event=approve > event=reject > Note: if there's more than one event in the reply the first one will > be used. > > Update values for variables > resolution= > Note: if there's more than one value for variable in the reply the > first one will be used. > > !!Unable to render embedded object: File (PLEASE DON'T CHANGE FOLLOWING SERVICE INFORMATION) not found.!! > processID=1 > nodeID=ManagerApproveHolidays
Default implementation does not send any feedback to the user.

Customizing

To have custom implementation of the email processing you should specify in the application context eventEmailProcessor bean that implements com.jcatalog.grailsflow.extension.email.EventEmailProcessor interface, i.e. for example of class that extends com.jcatalog.grailsflow.extension.email.GrailsflowEventEmailProcessor

People

Vote (0)
Watch (0)

Dates

  • Created:
    28/Oct/09 5:23 PM
    Updated:
    24/Nov/09 2:07 PM
    Resolved:
    24/Nov/09 2:07 PM