org.opencrx.application.mail.exporter
Class MailWorkflow

java.lang.Object
  extended by org.opencrx.kernel.backend.Workflows.AsynchronousWorkflow
      extended by org.opencrx.application.mail.exporter.MailWorkflow
Direct Known Subclasses:
ExportMailWorkflow, SendMailNotificationWorkflow, SendMailWorkflow

public abstract class MailWorkflow
extends Workflows.AsynchronousWorkflow

MailWorkflow


Nested Class Summary
static class MailWorkflow.MailTransport
          MailTransport
 
Constructor Summary
MailWorkflow()
           
 
Method Summary
protected  void createLogEntry(WfProcessInstance wfProcessInstance, String name, String description, ContextCapable target, Address address)
          Create a log entry which correlates the entry with the email recipient in case target is an email activity.
 void execute(WfProcessInstance wfProcessInstance)
          Execute the workflow specified by wfProcessInstance.
protected static MailWorkflow.MailTransport getMailTransport(String mailServiceName, String fallbackMailServiceName)
          Get mail transport from pool.
 boolean isAtomic()
          The mail workflows are atomic, the may be run in parallel with other workflows.
protected  String setContent(Message message, Session session, javax.jdo.PersistenceManager pm, Path targetIdentity, Path wfProcessInstanceIdentity, UserHome userHome, Map<String,Object> params)
          Set message content.
protected  Address[] setRecipients(Message message, javax.jdo.PersistenceManager pm, Path targetIdentity, EMailAccount eMailAccount, String defaultReplyEMailAddress)
          Collect recipients from target and email account and set corresponding email addresses on message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailWorkflow

public MailWorkflow()
Method Detail

isAtomic

public boolean isAtomic()
The mail workflows are atomic, the may be run in parallel with other workflows.

Overrides:
isAtomic in class Workflows.AsynchronousWorkflow
Returns:

setContent

protected String setContent(Message message,
                            Session session,
                            javax.jdo.PersistenceManager pm,
                            Path targetIdentity,
                            Path wfProcessInstanceIdentity,
                            UserHome userHome,
                            Map<String,Object> params)
                     throws ServiceException
Set message content.

Parameters:
message -
session -
pm -
targetIdentity -
wfProcessInstanceIdentity -
userHome -
params -
Returns:
Throws:
ServiceException

setRecipients

protected Address[] setRecipients(Message message,
                                  javax.jdo.PersistenceManager pm,
                                  Path targetIdentity,
                                  EMailAccount eMailAccount,
                                  String defaultReplyEMailAddress)
                           throws ServiceException
Collect recipients from target and email account and set corresponding email addresses on message.

Parameters:
message -
pm -
targetIdentity -
eMailAccount -
defaultReplyEMailAddress -
Returns:
Throws:
ServiceException

createLogEntry

protected void createLogEntry(WfProcessInstance wfProcessInstance,
                              String name,
                              String description,
                              ContextCapable target,
                              Address address)
                       throws ServiceException
Create a log entry which correlates the entry with the email recipient in case target is an email activity.

Parameters:
address -
wfProcessInstance -
name -
description -
target -
Throws:
ServiceException

getMailTransport

protected static MailWorkflow.MailTransport getMailTransport(String mailServiceName,
                                                             String fallbackMailServiceName)
                                                      throws ServiceException
Get mail transport from pool.

Parameters:
mailServiceName -
fallbackMailServiceName -
Returns:
Throws:
ServiceException

execute

public void execute(WfProcessInstance wfProcessInstance)
             throws ServiceException
Description copied from class: Workflows.AsynchronousWorkflow
Execute the workflow specified by wfProcessInstance. wfProcessInstance may be modified by execute.

Specified by:
execute in class Workflows.AsynchronousWorkflow
Throws:
ServiceException


This software is published under the BSD license. Copyright © 2003-2013, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.