We know that the event bus in K2…

We know that the event bus in K2[blackpearl] enables event firing.

K2[blackpearl] client events, which provides for a task to be surfaced to a group of people or a Role, can send notification emails to those users about the task assignment. This option is a simple check box in the client event wizards.

The message sent to the users is customisable through the K2 workspace – the web interface. On deployment of the process on the server, K2[blackpearl] creates two notification events under the workflow notification category. One under management events for handling task re-assignments and one under runtime to handle the initial notification for the destinations of the client event.

notwkspc.jpg

You can update these two notification messages to have different messaging as per your needs. The base template is also available on the K2 server as a text file (C:\program files\k2[blackpearl]\host server\bin\Sourcecode.Eventbus.ClientRecorder.DLL.mailTemplate) which you can modify to make global changes. This change won’t affect the already configured events.

dllmailtemplate.jpg

At this stage this interface allows you to use process fields and process data fields. Smartobject data is not available however a simple workaround is to have process datafields that hold your smart object data.

customise.jpg

ensure you have a smartobject load event prior to this client event. If you use the smart object event to create the datafields on demand (map and create option in smartobjectevent) for you inside the process they wont be available in the email configuration editor though. You need to have process data fields created and then mapped in the smartobject event.

mapncreate.jpg

The other option to have an email notification is to look at adding a WF code activity to the client event XOML file. You can add a bit of code in there to send an email. The K2 context object will provide you information related to the event, the worklist item url, etc.

xomlext.jpg

What we did recently was to have a separate process for sending custom email messages using the K2 mail event and initiating a process instance of that process from within this code activity.

code.jpg

2 comments

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s