/// <summary>
        ///     Returns the <see cref="WorkRequest" /> implementation of the current open work request.
        /// </summary>
        /// <typeparam name="TWorkRequest">The type of the work request.</typeparam>
        /// <param name="source">The process framework application.</param>
        /// <param name="action">The function that will initialize the work request (should be used for custom implementations).</param>
        /// <returns>
        ///     Returns a <see cref="WorkRequest" /> representing the work request; otherwise <c>null</c>.
        /// </returns>
        /// <exception cref="ArgumentNullException">action</exception>
        public static TWorkRequest GetWorkRequest <TWorkRequest>(this IMMPxApplication source, Func <int, IMMPxApplication, TWorkRequest> action)
            where TWorkRequest : WorkRequest
        {
            if (source == null)
            {
                return(null);
            }
            if (action == null)
            {
                throw new ArgumentNullException("action");
            }

            Design design = source.GetDesign();

            if (design == null)
            {
                return(null);
            }

            return(action(design.WorkRequestID, source));
        }