Skip to content

BPM Notifications plugin

kkolodziej edited this page Jan 8, 2013 · 20 revisions

BPM Notifications plugin introduces email notifications, that can be sent to Aperte Workflow users when process state is changed. Entire implementation is based on BPM engine events and external configuration. That way no additional modifications are necessary inside process definitions, cutting down the cost of possible failures and integration tests when change in notification behaviour is required.

Plugin capabilities

  • Sending email notifications to any email addresses.
  • Matching process names with regular expression.
  • Matching process states with regular expression.
  • Independence from any specific mail vendor or protocol, by using the Java Mail.
  • Advanced text formatting and transformations, by utilizing the Freemarker template engine.

Provided components

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_ext_bpm_notify_config

Column name Type Required Default value Description
id Long True - Primary key
active Boolean False False Should this configuration be evaluated by plugin
notifyEmailAddresses String False - Comma separated list of e-mail addresses to notify
notifyTaskAssignee Boolean True - Should the task owner be notified
processTypeRegex String False - Regular expression (java syntax) that must be matched by process definition name for the configuration to be effective.
sendHtml Boolean True - Should the e-mail content be send as HTML
skipNotification Boolean True - Should the notification for task owner be skipped when the state change was triggered by the task owner
stateRegex String False - Regular expression (java syntax) that must be matched by process state name for the configuration to be effective
templateName String True - The name of the BPM Notification e-mail template to be used

pt_ext_bpm_notify_template

Column name Type Required Default value Description
id Long True - Primary key
sender String True - Sender address, as expected by Java Mail InternetAddress
subjectTemplate String True - Content of the template that will be rendered as message subject, as expected by Freemarker TemplateLoader
templateBody String True - Content of the template, as expected by Freemarker TemplateLoader
templateName String True - Name of the template

Properties configuration

mail.properties

This properties are used to construct Java Mail session with password authentication. User name is stored inside mail.smtp.user and password is stored inside the mail.smtp.password property. For further informations refer to Appendix A of Java Mail Specification.

WARNING Since 2.0 this file is used only, when no configuration profile is available.

Sample sql configuration

INSERT INTO PT_EXT_BPM_NOTIFY_CONFIG(ID, ACTIVE, NOTIFYEMAILADDRESSES, NOTIFYTASKASSIGNEE, PROCESSTYPEREGEX, SENDHTML, SKIPNOTIFICATION, STATEREGEX, TEMPLATENAME)
VALUES (9999971, TRUE, 'someone1@aperteworkflow.org,someone2@aperteworkflow.org', TRUE, '.*', TRUE, FALSE, '.*', 'state-bpm-notification');

INSERT INTO PT_EXT_BPM_NOTIFY_TEMPLATE(ID, SENDER, SUBJECTTEMPLATE, TEMPLATENAME, TEMPLATEBODY)
VALUES (9999972, 'test@aperteworkflow.org', 'New state of ${process.internalId} - ${process.state}', 'state-bpm-notification', 'Process <b>${process.internalId}</b> experienced a state change to <b>${process.state}</b>, triggered by user <b>${user.login}</b>.<br/><br/>This is also a valid Freemarker template, one can use most of the language features.<br/><br/><#assign x=3><#list 1..x as i>${i}</#list>');

BPM notification portlet (Since 2.0)

BPM Notification GUI is available from admin panel:

Or as portlet:

In Admin panel the notification configuration is available out of the box, but as portlet, it must be first configured:

1) Adding BPM Notification as portlet:

Add BPM notification according to: Adding Widget configuration to GUI

2) Configuring BPM Notification:

See: BPM Notification Configuration Tutorial

Clone this wiki locally