The post-action function makes it possible to react to file-specific actions such as the release. The action might, for example, trigger the execution of a third-party application or send a request..
Every time a file-specific action (creation, workflow action, deletion) has been performed in the Content Manager, it calls the procedure notificationCmd.
To this procedure, five arguments are passed:
-
logType: The action type. It is one of:action_comment(File was commented)action_create_subobj(File was created in the folder)action_delete_subobj(File was deleted from folder)action_admin_obj(A file field was modified)action_edit_obj(Editing process started)action_give_obj(Draft version was given to someone)action_take_obj(Draft version was taken)action_forward_obj(Draft version was forwarded)action_commit_obj(Draft version was committed)action_reject_obj(Draft version was rejected)action_revert_obj(Draft version was reverted)action_sign_obj(Committed version was signed)action_release_obj(Draft or committed version was released)action_unrelease_obj(Released version was unreleased)action_deactivate(Released version was deactivated, available from version 6.5.0)
-
objectId: ID of the file with which the action was performed. -
userLogin: The login of the user who performed the action. -
receiverLogin: The login of the user or the name of the group who/which receives the file. -
logText: The comment of a workflow action
Standard Post Action Function
Up to version 6.7.0: The supplied post-action function calls the e-mail notification function (see below).
From version 6.7.1: The supplied post-action function calls all notifications that have been placed in the script/cm/serverCmds/notifications directories. The e-mail notification function can be found in the central share directory. Further custom post-action functions can be placed into the instance-specific directory instanceName/script/cm/serverCmds/notifications. The name of the script file must be nameNotification.tcl, and the procedure nameNotification must be defined in it. For further information about this mechanism please refer to the file share/script/cm/serverCmds/notificationCmd.tcl.
E-Mail Notification
The supplied E-mail notification sample sends messages for particular actions to the users responsible next in the workflow.
The e-mail notification will only work if the e-mail server to use has been specified and set-up properly.
Specifying the E-Mail Server
The E-Mail-Server can be specified in the instance/default/config/server.xml file. Enter the host name of a reachable SMPT mail server as the value of the email.host key. Example:
<email>
<host>mail.my.domain</host>
</email>
Deactivating E-Mail notification
Up to version 6.7.0: The standard e-mail notification can be deactivated by providing an empty definition of emailNotificationCmd. For this, create the file script/cm/serverCmds/notificationCmd.tcl in the instance directory and place the following line into it:
proc emailNotificationCmd {args} {}
From version 6.7.1: Create the file script/cm/serverCmds/notifications/emailNotification.tcl in the instance directory and place the following line into it:
::notifications::remove emailNotification