Email Capture plugin - bluesoft-rnd/aperte-workflow-core GitHub Wiki

Email Capture plugin empowers users to perform a set of automated actions on Aperte Workflow processes just by sending standard email messages. Each action is stored as separate rule and executed as part of bigger configuration.

Plugin capabilities

  • Starting new process instances.
  • Performing actions on tasks inside running processes.
  • Storing email attachments as process attachments inside any document repository that supports CMIS standard.
  • Matching email message subject, sender and recipients with regular expressions.
  • Matching process name, process task and actions with regular expressions.
  • Independence from any specific mail vendor or protocol, by using the Java Mail.

Plugin downloads

The plugin source code can be obtained from its Aperte Workflow github repository.

Compiled version can be downloaded with Aperte Workflow Bundle from sourceforge repository.

Plugin installation

Copy the plugin jar into your existing Aperte Workflow installation. Place it into bundle installation directory. If not changed in PluginServlet init parameters it should be either ${aperte.workflow.home}/osgi-plugins or ${liferay.home}/osgi-plugins.

Plugin configuration

Database configuration

Plugin runtime configuration is based on following database tables. Because the plugin uses Hibernate as DB abstraction layer the types of the fields were listed as Java types.

pt_email_checker_config

Column name Type Required Default value Role
id Long True Primary key
automaticUser String True Name of the user that will be visible as the author of all performed operations. It does not have to be an existing Aperte Worklflow user.
mailSessionProperties String True Configuration in properties format that will be used to connect to mail server. See Java Mail specification for details.

pt_email_checker_rule_config

Column name Type Required Default value Role
id Long True Primary key
configurationId Long True Foreign key on pt_email_checker_config.id
folderAttributeName String True cmisFolderId Under which process attribute a CMIS folder ID for the documents is stored. Use of this attribute is suggested only when process uses a single CMIS folder (without subfolders).
lookupRunningProcesses Boolean True Lookup running processes. The running process is looked up using email subject (with removed tokens provided by subjectRemovables attribute, removed whitespaces and uppercased) matched to ProcessInstance.keyword.
When the process is initiated by email, ProcessInstance.keyword is filled with email subject using the algorithm presented above.
newFolderPrefix String True pt_ Prefix used when creating a folder dedicated to a process instance on CMIS.
omitTextAttachments Boolean True Should attachments of unknown or text/* content-type be added published do CMIS
processCode String True Process code to start. Must match ProcessDefinitionConfig.bpmDefinitionKey value.
processIdSubjectLookupRegexp String True When processIdSubjectLookupRegexp is defined and matched and also matching process has been found and matches field processStepName. This action will be performed on the process, propagating further its execution. The regexp should contain one grouping, which will allow the engine to extract ProcessInstance.externalKey. The process to be propagated further has to be waiting in a task in a special task.
processTaskName String True The name of the task. Must match BpmTask.taskName.
recipientRegexp String True Java regular expression that matches email recipient (both name and email address). If the recipient does not match, email is ignored for this rule. Empty field means that recipient is not validated.
repositoryAtomUrl String True CMIS repository Atom URL. If not provided, email attachments are ignored and not stored in CMIS.
repositoryId String True default CMIS repository ID.
repositoryUser String True Administrator CMIS repository user.
repositoryPassword String True Administrator CMIS repository password.
rootFolderPath String True /processtool/
docs
CMIS repository root folder path. In this root folder, a folder with process name and prefixed with newFolderPrefix is created. In this folder, a sub-folder with a name subFolder is created and email attachments are stored there. If the folders on the path do not exist, the mechanism attempts to create them.
runningProcessActionName String True When processIdSubjectLookupRegexp is defined and matched and also matching process has been found and matches field processStepName. This action will be performed on the process, propagating further its execution.
The process to be propagated further has to be waiting in a task in a special task.
senderRegexp String True Java regular expression that matches email sender (both name and email address). If the sender does not match, email is ignored for this rule. Empty field means that sender is not validated.
startNewProcesses Boolean True Should a new process be started when no running process has been matched.
subjectRegexp String True Java Regular Expression that matches email subject. If the subject does not match, email is ignored for this rule. Empty field means that subject is not validated.
subFolder String True /processtool/
test1
CMIS subfolder name.
subjectRemovables String True Tokens removed from subject. Used for matching of processes using lookupRunningProcess mechanism. Tokens are separated by \s java regular expression.

Documents are stored in ${rootFolderPath}/${newFolderPrefix}${processCode}/${subFolder} path inside CMIS repository.

It is worth mentioning, that different combinations of runningProcessActionName and ''processIdSubjectLookupRegexp'' can provide simple decisions for a process. Email's sender address will be marked as a decision source, so there should exist some kind of regexp on sender's email and some verification of sender (e.g. SMTP AUTH) should be used.

Sample configuration

Sample template

⚠️ **GitHub.com Fallback** ⚠️