Skip to main content

This one seems to be kind of stupid, but I am not able to figure out what is happening here. So maybe anyone can help me with that. I'm working with K2 BlackPearl 4.5.


I am using an activity to define the destination users. The users in the destination set of the activity are located in an AD Group. I set the destination rule option to "all at once", "create a slot for each destination" and "resolve all roles and groups to users".
Within the activity there is only one "send mail" event. This one is configured to send the mail to the destination user and to the originator (checkboxes set).


When there are 4 users within the AD group used for the destination set, the workflow sends 5 emails. the problem is, that the originator is allways included. So the originator receives all 5 mails.


How do I have to configure the Activity / Event to send out only one mail with all the receipients in the to field (or what also would be possible: send two mails. One for the dest. users and one for the originator).


Thanks for your replies!
Cheers,
Thomas

This occurs because the mail event will run for each slot that is created, thereby sending an email to the destination user for that slot, and ALSO to the originator.


You could put a copy of the email into another Activity that precedes this activity. This email event would then send an email to the originator. Change the email event in the existing activity to send only to the destination user.


The result will be an email initially to the originator, followed by an email to each of the destination users.


Alternately, you could build a data field/xml field that contains all of the emails that you want to send to, and then specify who the email should be sent to that field.


There may be other ways, but this is how I have achieved it in the past.


Hope this helps!


I bet if you look at the mail the Originator receives the "To" field will show all the destination users? I have seen this similar behaviour when using escalation mails. Try the following:


Instead of using the Originator check box, add the ProcessOriginatorEmail field from the Context Browser > Process Instance > Originator> Email


Please let me know if this works.


Vernon



Hi Vernon,


thanks for your reply. We tested your suggestion in the following way: We put the originator into the "To" field, but the emails got also duplicated for each user in destination users.


We are going to figure out with the requestor for that workflow if it is ok if we put the destination users into the "To" field. If so, there will be one email with all the destination users in the "To" line.


again thanks for your reply,


Thomas


Hi Thomas,


I think you will find that this behaviour is by design. Since you are creating a slot for each destination, all of the events in that activity will be run for each slot. As mentioned above, this will mean that the email event will be called for each slot. It won't matter whether you put the originator in the "To" field, or tick the box, the event will always run for each slot, so if there are 7 destination users (and therefore 7 slots), the email will be sent to the originator 7 times.

I expect that even if you put all of your destinaion users into the "To" field of this event, if it remains in the same activity that has 7 destination users (and therefore 7 slots), then this will mean that the originator and the destination users will all receive 7 copies of the email.


If you want to send a single email, you will need to either:
1. change the settings for the activity so that there is a single slot (this doesn't sound feasible, as it would completely change the behaviour)
OR
2. move the email event to a separate activity just prior to the existing activity, and either specify the recipients of the email, or set this activity up as a single slot with the same destination users as the original activity, and tick the originator and destination users as the recipients of the email.


Hope this helps?


Reply