Lab 19 - Automated e-mail task notifications

Lab Goal

To set an automated e-mail notification for a task so that if a new task is not claimed within two minutes, an e-mail notification is sent to the group.

Approve Rewards Task

still has issues...

In the previous lab we discovered a problem with our tasks when claimed by a user from the group, but then did not complete the task in a timely manner. We setup automated task reassignment for this, but now we have another issue. New tasks are arriving for the group to process, but without a notification no one in the group is aware of waiting tasks.

Approve Rewards fix

To fix this new issue, we can setup automatic e-mail task notifications for the group. Every time a new Approve Rewards task arrives, someone from the group will have two minutes to claim the task or an e-mail notification will be sent.

User task notification

  • In project authoring we open rewards process
    • AUTHORING -> PROJECT AUTHORING -> rewards-approval

User task notification

  • Select (click) Approve Reward user task and slide out Properties panel

User task notification

  • In Properties panel under section Extra Properties
  • Select Notifications field to open Editor for Notifications

User task notification

  • Click on Add Notification for a new entry:
    • Type: not-started
    • Expires At: 2m
    • From: Administrator
    • To Users: erics
    • To Groups: manager

User task notification

  • Complete the notification fields:
    • Reply To: [leave empty]
    • Subject: Task needs attention
    • Body: [Enter body message shown below]
  • Click on OK button to close editor

User task notification

  • Save the process and add commit message as shown
  • Now it is time to test our e-mail task notification deadline of 2 minutes for unclaimed tasks

Intermezzo

Configuration for e-mail

If you followed this workshop from the start, you have installed using the brms-install-demo project, this provides all the JBoss BPM Suite configuration changes needed to process e-mail notifications. For exact details see the following article:
Automating e-mail User Task Notifications (part 1)

Test task notification

  • Build and deploy the rewards project
  • Project Authoring -> Tools -> Project Editor

Test task notification

  • click on Build & Deploy button in top right corner

Test task notification

  • Click on No in Information popup to just build and deploy
  • Watch for the green popup bar stating that the build was successful

Test task notification

  • Now we can examine our deployed process definition
  • Project Authoring -> Process Mangement -> Process Definitions
  • To view our definition details, click on the magnifying glass icon under Actions

Intermezzo

Running e-mail server

Before starting a process instance and waiting for the notification to trigger an e-mail, we will need an e-mail server running to monitor the incoming port 25 for SMTP (e-mail) traffic. We have provided a fakeSMTP application in the brms-install-demo project's support directory, you can start this as admin user (here as unix admin user) to catch incoming mail:
$ sudo java -jar support/fakeSMTP.jar

Intermezzo

fakeSMTP e-mail server

The pop-up window shown just needs you to click on the START SERVER button, after which we can monitor this for incoming e-mail task notification from our process.

Test task notification

  • Now back to the overview of our process definition details
  • You can start a process instance from here by clicking the New Instance button

Test task notification

  • We can also start a process instance from the Process Definition view by clicking the start-icon under Actions

Test task notification

  • Either way, we get a popup start process form that we designed previously
  • We fill in the rewards submission details and click on the arrow at the bottom

Test task notification

  • Watch for the yellow popup bar stating Process instance started
  • We are then presented with the process instance view, notice progression to Approve Reward task
  • Note your Instance ID may differ from ours

Test task notification

  • Open the task list to view waiting user tasks
  • Project Authoring -> Tasks -> Tasks List
  • Our task is in the Active and Group lists until claimed

Test task notification

  • If we leave this task in the group and wait 2 minutes
  • We should see two sets of e-mails generated, 1 for user erics, 1 for group manager

Test task notification

  • Part of the BPMN specification is that this notification is sent only once, so won't happen again
  • Our task is still in the Active and Group lists until claimed

Notification or

Reassignment

  • Also note, once you trigger an e-mail notification, automated task reassignment is not available
  • There is either an e-mail notification, or you can claim a task that can be reassigned back to the group, not both
  • We can now claim the task by clicking on lock icon, work on it by clicking on check icon and complete task form

Rewards process project

(more coming soon...)
Eric D. Schabell
JBoss Technology Evangelist
@ericschabell
http://schabell.org

JBoss BPM Suite Workshop

Lab 20 - Rewards process project (more coming soon...)