Content Organizer: iCustomRouter Pending State Issue

The Content Organizer in SharePoint 2010 is a Feature that enables the routing of content to defined destinations such as SharePoint libraries, folders or other Content Organizer managed sites. It achieves this by analysing the items content type/metadata information and then matching that with a set of rules. If it finds a matching rule the item will be moved to the defined destination. 

In practice, it works by information being deposited into an automatically provisioned document library, called the Drop Off library. Once content appears here, it can be automatically routed to an appropriate location by the use of the managed rules. This is an evolution of functionality that was apparent in MOSS 2007 and is available across the SharePoint estate, not just in the Record Centre template.

Occasionally, it may be necessary to change the behaviour of a rule to perform some further processing; perhaps collecting extra information about the item being submitted or logging details to a list to capture some audit data. This could be achieved by the implementation of a custom router ( iCustomRouter ) solution.

A while ago, I had the need to build such a solution that would generate a file-plan dynamically in a Records Centre to reflect the Collaboration space. It would extract the incoming items original url location and then create a replica structure in the Records Centre before moving the item to the newly created library or folder.

With the code written and deployed, the custom router interface was available in the rule item as expected:

The “Custom Router” section of the rule form will appear when you have a custom router registered. This means that an item that fires a matching rule will use the custom router logic before deciding the final destination of the item. Here, you can either perform some action that is supplementary to the rule or cancel what the rule would have done and do something else instead. I will cover the building of custom routers at a later date.

With the rule updated with my custom router, what I saw was documents being submitted to the Drop Off library and just sitting there, even though I knew it was matching my now “custom” rule. Other information flowing in to the library, that matched a rule without a custom router was being immediately routed as expected. So, why was my custom rule causing the item to be in a “Pending” state!

After some investigation work, I discovered that if you submit a Document Set or employ an ICustomRouter to change the routing experience or perform some other action to modify the content when it hits the Drop Off library, the behaviour of the Content Organizer is slightly different. Instead of the submitted item being immediately processed, which is the normal mode of operation, a Document Set or document that meets a rule that employs a custom router, will sit in the library waiting for a timer job. This is because SharePoint does not know what the Document Set contains and hence what it needs to unpack or, in the case of a custom router, does not know what that process load will be. Each of these actions could potentially be a long running operation. To ensure that there is no blocking of the Content Organizer, these types are only processed when the Web applications “Content Organizer Processing” job runs from the timer service (Note: Each Web application has it's own timer job). Looking at the timer job:

You will note from the schedule that it only runs “Daily”. When I encourage the timer job to run, the items that matched my custom rule all fired off merrily on their way.

Lesson of the story: You may need to manage the frequency of the timer job to something more appropriate for your business.

Written by:

Nigel Bridport


Microsoft Consulting Services UK

Click here to see my bio page