Notifying the Yankee

Last we left off, we turned a pseudo relation into an exclusive relation.

Specifically, we created a participant2user relation, which allowed us to traverse from an activity to the user who participated in the activity with a path like: focus_obj2act_entry:fact2participant(role_code=1):participant2user:login_name

Real World Usage

As promised, lets give this some real world usage. Specifically, lets use this to notify someone when a case (or other workflow object) is yanked from them.

A few years ago, I showed how to implement yank notifications by email. In that post, I gave some details about the challenges behind using a business rule to do this:

The problem with implementing this as a business rule is that there is no data that holds onto the previous owner.

Clarify’s solution to this is to have the Classic Client always send an integrated Notifier message (insert into table_message). Which is fine if you use the Notifier; worthless if you do not.

The solution I came up with back then was to add some custom code to the application level (specifically Dovetail Agent). This is OK, but increases your maintainability, especially when you’re dealing with multiple apps (Dovetail Agent, Dovetail Mobile, etc.).

But now that we have an exclusive relation that allows us to get to the previous owner, we’re in business for creating a proper notification via a business rule.

Add a participant

First, we need something to add a participant record when a yank occurs. We could do this in the application code (Dovetail Agent, Dovetail Mobile, etc.). But since these all use the Dovetail SDK under the hood, we’ve gone ahead and made the change to the SDK to do this. As of Dovetail SDK 3.1, the Yank API now adds a participant record as part of its processing. Specifically, it adds a participant that is the user who the workflow object was yanked from. The yankee, if you will. It uses a role_code of 1, which means “affected by”. i.e. this is the user that was affected by the yank action.

Business Rule Recipient

As discussed in the previous post, we can now add a business rule recipient alias for the user who the case was yanked from.

Property Name: Yanked From User

Subtype: Alias

Path: focus_obj2act_entry:fact2participant(role_code=1):participant2user:login_name


Business Rule

I can now create a business rule that uses the “Yanked from User” as a recipient of a rule:

Object Type: Case
Rule Name/Description: Notify Yanked from user
Start Events: Yank
Cancel Events: None
Conditions: None
Action Title: Notify Yankee
Who to Notify: [Yanked from User]
Start Action: 0 minutes
From: Event Creation
Using: Elapsed Time
Repeat : Never

RE: [Object Type] [Object ID] was yanked from you by [Logger]
[Object Type] [Object ID] was yanked from you by [Logger].

View this case in Dovetail:
http://myserver/mobile/Cases/Summary/[Object ID]

Business Rule In Action

Log in to Dovetail, and yank a case from someone.

From the Activity Log, I can see that the rule fired:


And the person the case was yanked from will now get a notification, such as:


What’s nice about this approach (rather than hard-coding it to notify just by email) is that the user’s notification preferences will be honored. So if they’re using email by day, and SMS notifications by night, Rulemanager will notify them via they’re defined preferences.

Let the yanking commence

For many years this has been an annoyance to me (not getting notified when a case was yanked from me). Now, I feel we have a good solution to this.

Hope you find this useful.