Destination Queues and Destination Rules


Badge +1
I've come across a problem with destination queues and activity destination rules. In a process I'm developing, I have several activities with destination rules defined to use destination queues. These activities have various events within them (e.g. Mail someone, then update a Sharepoint list). What I'm seeing is that, in certain circumstances, the emails get sent, then subsequent events are triggered multiple times (once for each email sent) - for instance, an activity sends an email to the destination queue, then adds an entry to a Sharepoint list, I get one entry in the list for each email that has been sent.

My destination queues all contain Active Directory groups. Some of these AD groups have more than one user. It is when the AD group contains more than one user that I get the duplicate event behaviour.

Hopefully, this is making sense so far! Now, I can work around this by separating the email events into their own activities, but I'd like to know if this is the only solution? In other words, can I set a destination rule, using a destination queue containing multiple users, for an activity that contains a Server Mail Event and other events?

Thanks in advance!

6 replies

Badge +6
Hi Mike,

This is default behavior when using multiple destination users on an activity that also contains server events.

For EVERY destination user ALL server events are executed so this will explain why the emails and SharePoint list entries are repeated.

You can work around this by adding some kind of counting mechanism (with a process datafield to keep track of the iterations) to the server event code but I would suggest that you move these to seperate activities.

HTH,
Conrad
Badge +3
Also - If you only need one slot then you can use Create Single Activity Instance option as this will only run your events once.
Badge +1
If you only need one slot then you can use Create Single Activity Instance option as this will only run your events once

Unfortunately, this won't work. There is an article in the knowledge base (don't have the reference handy) that says that you can't use a destination queue with "Create Single Activity Instance".

Sounds like my original solution of separate activities for the emails and list updates is the only way to go, then.

Thanks for the help!
Badge +3
Hi Mike,

I'd like to see the kb article if you can find it as the full option name in K2 Studio is "Create single Activity Instance for Queue" and can only be selected if you're using Destination Queues.

Ashley
Badge +1
Ashley,

Number/Title of the KB article is: KB000155 - Create single Activity Instance for Queue. (http://kb.k2workflow.com/articles/kb000155.aspx)

Near the end of the article it states:
The runtime implementation of this forces K2.net Server to create a single Activity Instance and assign that instance to the Destination queue rather that the actual users. The only time that the item is associated with a specific user is when the user opens the item using the K2.net Worklist or custom implementation of the K2.net Worklist. The result of this can cause mail events using the "Send to Destination User" to fail.

As my server mail events are using "Send to destination user", this would impact my process.

Regards
Badge +3
icon-quote.gifmikep:
Ashley,

Number/Title of the KB article is: KB000155 - Create single Activity Instance for Queue. (http://kb.k2workflow.com/articles/kb000155.aspx)

Near the end of the article it states:
The runtime implementation of this forces K2.net Server to create a single Activity Instance and assign that instance to the Destination queue rather that the actual users. The only time that the item is associated with a specific user is when the user opens the item using the K2.net Worklist or custom implementation of the K2.net Worklist. The result of this can cause mail events using the "Send to Destination User" to fail.


As my server mail events are using "Send to destination user", this would impact my process.

Regards


Ok - I see. That's fine. Just wanted to clarify your original comment

There is an article in the knowledge base (don't have the reference handy) that says that you can't use a destination queue with "Create Single Activity Instance".

That is not the case but as you point out there are other considerations.

Reply