/// <summary>
        /// The on idle.
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        private void OnIdle(WorkflowApplicationIdleEventArgs args)
        {
            HttpExceptionHelper.WriteThread(
                "OnWorkflowIdle waiting for bookmark {0} instance Id {1} with bookmarks {2}",
                this.pendingBookmark,
                args.InstanceId,
                args.BookmarksToDelimitedList());

            this.Idle = true;

            if (args.ContainsBookmark(this.pendingBookmark))
            {
                this.pendingBookmark = null;
                this.protocolEvent.Set();
            }
        }