Customizing SmartActions
Once SmartActions has been configured on installation, you can customize the messages that are sent from the SmartActions account. What messages are sent is configured within the K2 server configuration file (K2HostServer.exe.config) located at "%ProgramFiles%\K2\Host Server\Bin".
Configure the following items by editing the file as illustrated below:
- K2 SmartActions that action the process.
- Synonyms which can be used in addition to the prescribed actions.
- Help for those actioning tasks via email.
- Error handling messages.
Shown below is a sample for SmartActions configuration. This section contains tags which configure the following:
- The messaging files that the K2 Server uses. Each text file is an individual message template.
- Standard Actions and their synonyms. Use the <actionsStandard>actionsStandard tag.
- Configured actions which have the same affect as a standard action except that they are user configured and standard actions will take precedence over them. The tag name is actionsConfigured
Example K2 server configuration file section for SmartActions:
<messageBus>
<!--
If you do not use the Service Account for MessageBus, remember to update the connection
strings.
-->
<system self="K2:DENALLIX\Administrator" enableListeners="true" allowAmbiguity="true" />
<messages>
<help filename="Templates\Messages\MessageBus.Help" />
<unhandledError filename="Templates\Messages\MessageBus.UnhandledError" />
<error filename="Templates\Messages\MessageBus.Error" />
<replyFormat filename="Templates\Messages\MessageBus.ReplyFormat" />
</messages>
<smartActions>
<messages>
<help filename="Templates\Messages\SmartActions.Help" />
<actions filename="Templates\Messages\SmartActions.Actions" />
<unhandledError filename="Templates\Messages\SmartActions.UnhandledError" />
<error filename="Templates\Messages\SmartActions.Error" />
<actionExecuted filename="Templates\Messages\SmartActions.ActionExecuted" />
<standardActions filename="Templates\Messages\SmartActions.StandardActions" />
<standardActionsWithDescriptions filename="Templates\Messages\SmartActions.StandardActionsWithDescriptions" />
<sleep filename="Templates\Messages\SmartActions.Sleep" />
<sleepError filename="Templates\Messages\SmartActions.SleepError" />
<redirect filename="Templates\Messages\SmartActions.Redirect" />
<redirectError filename="Templates\Messages\SmartActions.RedirectError" />
<delegate filename="Templates\Messages\SmartActions.Delegate" />
<delegateError filename="Templates\Messages\SmartActions.DelegateError" />
<itemNotFound filename="Templates\Messages\SmartActions.ItemNotFound" />
</messages>
<synonyms>
<actionsStandard>
<!-- Supported synonyms for the Redirect action -->
<action value="redirect">
<!-- Shorthand -->
<synonym value="r" />
</action>
<!-- Supported synonyms for the Delegate action -->
<action value="delegate">
<!-- Shorthand -->
<synonym value="d" />
</action>
<!-- Supported synonyms for the Sleep action -->
<action value="sleep">
<!-- Shorthand -->
<synonym value="s" />
</action>
<!-- Supported synonyms for the Help action -->
<action value="help">
<synonym value="h" />
<synonym value="?" />
</action>
<!-- Supported synonyms for the Actions action -->
<action value="actions">
<synonym value="a" />
</action>
</actionsStandard>
<actionsConfigured>
<!-- Common configured actions and allowable alternatives -->
<!--
<action value="approve">
<synonym value="approved" />
</action>
<action value="decline">
<synonym value="declined" />
<synonym>reject</synonym>
<synonym value="rejected" />
</action>
-->
</actionsConfigured>
</synonyms>
</smartActions>
</messageBus>
Configuration File Description | |
---|---|
<actionsStandard> | Standard or system actions that are used by the K2 server to process messaging notifications, such as redirect, delegate, sleep and help. |
<actionsConfigured> | A user configured action which is used by the K2 Server to process messaging notifications. ActionsStandard takes precedence over actionsConfigured i.e. if both are entered at the same time then the actionsStandard would be processed and the actionsConfigured will be ignored. |
<synonym> | A single character or word that the K2 server associates with an standard or configured action. For more information about synonyms see K2 SmartAction Synonyms |
<messages> | Messages sent by the server based on template files containing preconfigured messages. You can customize these files to suit your organization’s needs. |
The messages that are used by the K2 server are located at "%ProgramFiles%K2\Host Server\Bin\Templates\Messages" where you find a collection of text files which can be updated to include information to fit your organization’s needs. When the files are opened you will notice that the text file is a combination of plain text and fields which are populated when the message is sent processed by the server. Shown below is a listing of the folder along with the text files that can be customized.
- Message Bus System Error Messaging Templates
- MessageBus.Error
- MessageBus.Help
- MessageBus.ReplyFormat
- MessageBus.UnHandledError
- For SmartActions Messaging
- SmartActions.ActionExecuted
- SmartActions.Actions
- SmartActions.Delegate
- SmartActions.DelegateError
- SmartActions.Error
- SmartActions.Help
- SmartActions.ItemNotFound
- SmartActions.Redirect
- SmartActions.RedirectError
- SmartActions.Sleep
- SmartActions.SleepError
- SmartActions.StandardActions
- SmartActions.StandardActionsWithDescriptions
- SmartActions.UnhandledError
Shown below is an example of one of the text files, namely the SmartActions.ActionExecuted.txt file. The fields indicated by the curly brackets {} are populated at runtime when the email is sent. The wording can be changed, but if these fields are removed from the text, contextual information relating the worklist item is lost. Note that you must always include the {serial number] context field in the messages so that the K2 server can correlate the message to a particular workflow instance.
Action Executed
On {date} you successfully actioned the worklist item:
- Action: {action}
- Serial Number: {serial number}
You can disable the auto-reply email which the SmartActions account sends to a user once an item is actioned by switching the ActionExecuted enabled flag to false in the K2HostServer.exe.config file.
In the K2HostServer.exe.config file, under <SmartActions><Messages>you will see a list of SmartActions reply messages. Look for the following key:
<actionExecuted filename="Templates\Messages\SmartActions.ActionExecuted" >
Change the key to:
<actionExecuted filename="Templates\Messages\SmartActions.ActionExecuted" enabled="false"/>
Restart your server and confirmation emails are no longer sent.