Author: Mats Halfvares, Content Studio Development Team.

Published: 2009-06-08

Applies to: Content Studio 5.2 Release

Type: Bug


Symptoms

Asynchronous event handlers for the OnDocumentApprove, OnDocumentSave OnDocumentCheckOut and OnDocumentCheckIn events never execute in Content Studio version 5.2.

Cause

When there is an asynchronous event handler for any of these events, the internal code that performs the action and eventually triggers the event handlers does not calculate the identifier of the document category. This has the impact that Content Studio cannot not detect whether there are any event handlers assigned to the category. However, if a synchronous event handler exists on the same category and event, the calculation is correct and the asynchronous event handlers are detected correctly.

Resolution

This problem can easily be solved by adding a synchronous event handler for the same event and category. This event handler does not need to do anything - just be there. You can download such an event handler using the link in this article.

EVWorkAround.zip

For those who like to build a dummy event handler themselves you can use the follwing source code. In order to compile you need a reference to the CS5Interfaces.dll assembly.

using System;
using ContentStudio.EventActions;

namespace EVWorkAround
{
    public class Handler : ICSEventHandler
    {

        #region ICSEventHandler Members

        public void EventHandler(string eventXMLArguments, 
                                 string customData, 
                                 object content, 
                                 ICSCredentialsContainer credentials,
                                 ref bool cancel,
                                 out int status,
                                 out string statusText)
        {
            cancel = false;
            status = 0;
            statusText = "Success";
        }

        #endregion
    }
}
Imports System
Imports ContentStudio.EventActions

Namespace EVWorkAround
    Public Class Handler 
    Implements ICSEventHandler
    {

        #Region ICSEventHandler Members

        Public Sub EventHandler(eventXMLArguments As String, _ 
                                customData As String, _ 
                                content As Object, _
                                credentials As ICSCredentialsContainer, _
                                ByRef cancel As Boolean, _
                                ByRef status As Integer, _
                                ByRef statusText As String) _
                                Implements ICSEventHandler.EventHandler
            cancel = False
            status = 0
            statusText = "Success"
        End Sub

        #End Region
    }
End Namespace

Status

This is a confirmed problem with Content Studio version 5.2 and will be fixed in Content Studio 5.2 SP1 which is scheduled for release Aug / Sept 2009.