Task Notices

Task notices provide the capability to automatically send templated email and Slack notifications when a stage in the task instance lifecycle is reached. You can configure task instance notices by adding the appropriate template name corresponding to the lifecycle outcome on the Notices tab of the Manual Task Activity properties. The Notifier Classes column on this tab is populated by default with the MDW Framework implementation, which you may override if desired by specifying your own custom TemplatedNotifier implementation. Multiple notifier classes may be registered by specifying a comma-delimited or #-delimited list. It is recommended that rather than implementing TemplatedNotifier directly you extend the MDW class TaskEmailNotifier.

Email Templates

Templates for task lifecycle emails and Slack notices are the same as described in the general Notification Activity documentation. Pre-built sample templates provided with the MDW baseline package include taskOpenEmail.html and taskOpenOneClick.html.

For simple HTML templates, the implicit model value represents the TaskRuntimeContext object, whose getters can be accessed as in the following examples: You can insert images into your e-mail body in the same manner as for general notification activities.

Recipients

By default notices are sent to users who belong the workgroups associated with the task (except assignment notices which are sent only to the task assignee). Alternatively recipients can be overridden and configured the same way as described in the general Notification Activity docs.

Lifecycle Outcomes

A notifier may be invoked when the following lifecycle transitions occur for a task instance. See the documentation topic Task Actions for an explanation of the actions which may trigger these transitions.

Open Task instance is newly-created or becomes unassigned
Assigned Task instance has been claimed or assigned to someone
Failed Task instance has been failed due to a user performing the Abort action
Completed Task instance has been completed by a user performing the Complete action or a custom action
Cancelled Task instance has been cancelled by a user
In Progress Task instance has been flagged as being worked by a user
Alert Task instance is approaching its scheduled Due Date without having been completed
Jeopardy Task instance has passed its scheduled Due Date without having been completed


For a discussion of a more general task observer pattern which enables you to execute arbitrary Java code in response to a lifecycle event, see the topic Task Observers).