LWF-Events: When to modify binderdocuments?

Sometimes it is necessary to modify documents while routing a job. The API offers two different events which can be used to archive this.

Post FolderRouting
Most times a binder contains just two documents: The CoverDocument and the MainDocument. As the CoverDocument is usually not used to store user-data, the MainDocument ist the only document to modify. As the PostFolderRouting-Event gives you direct access to the MainDocument, this should be the event to choose!?

PostDocumentRouting
In opposite to the PostFolderRouting-Event, this one is called  for each document contained in a binder. Changing just the MainDocument results in the need to check, weather the routed document is a MainDocument or not. But this event has a big advantage: Documents are being saved automatically! So, better use this one!?

The answer is simple
PostDocumentRouting. But why? It’s because of the automatic save. This ensures, your changes are stored to the document. When changing a document in the PostFolderRouting event, I faced some unmodified documents, which I was not able to explain. Using PostDocumentRouting never had that kind of trouble.

Follow

Get every new post delivered to your Inbox.