src/Microsoft.PowerShell.Activities/Activities/SetHostValue.cs
/// <summary>
/// Internal reflection call to set the ResumeBookmarkTimeout property, which
/// controls how much time Workflow allows an activity to run while a bookmark is
/// being resumed. The workflow default is 30 seconds, which can be exceeded
/// on heavily loaded systems especially on parallel workflows.
/// There is not a public property for this value, so the implementation below is
/// the one recommended by the workflow team.
/// </summary>
/// <param name="timeout">How long to wait.</param>
Internal reflection call to set the ResumeBookmarkTimeout property, which
controls how much time Workflow allows an activity to run while a bookmark is
being resumed. The workflow default is 30 seconds, which can be exceeded
on heavily loaded systems especially on parallel workflows.
There is not a public property for this value, so the implementation below is
the one recommended by the workflow team.
Internal reflection call to set the ResumeBookmarkTimeout property which controls how much time Workflow allows an activity to run while a bookmark is being resumed . The workflow default is 30 seconds which can be exceeded on heavily loaded systems especially on parallel workflows . There is not a public property for this value so the implementation below is the one recommended by the workflow team .
private static void SafelySetResumeBookmarkTimeout(TimeSpan timeout)
        {
            Type activityDefaults = Type.GetType("System.Activities.ActivityDefaults, System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            if (activityDefaults != null)
            {
                FieldInfo resumeBookmarkTimeout = activityDefaults.GetField("ResumeBookmarkTimeout");
                if (resumeBookmarkTimeout != null)
                {
                    if (timeout.TotalSeconds == 0)
                    {
                        TimeSpan currentTimeout = (TimeSpan)resumeBookmarkTimeout.GetValue(null);
                        if (currentTimeout.TotalSeconds == 30)
                        {
                            resumeBookmarkTimeout.SetValue(null, TimeSpan.MaxValue);
                        }
                    }
                    else
                    {
                        resumeBookmarkTimeout.SetValue(null, timeout);
                    }
                }
                else
                {
                    System.Diagnostics.Debug.Fail("Could not find ResumeBookmarkTimeout property");
                }
            }
            else
            {
                System.Diagnostics.Debug.Fail("Could not find ResumeBookmarkTimeout type");
            }
        }
private static void SafelySetResumeBookmarkTimeout ( TimeSpan timeout ) { Type activityDefaults = Type . GetType ( " " ) ; if ( activityDefaults != null ) { FieldInfo resumeBookmarkTimeout = activityDefaults . GetField ( " " ) ; if ( resumeBookmarkTimeout != null ) { if ( timeout . TotalSeconds == 0 ) { TimeSpan currentTimeout = ( TimeSpan ) resumeBookmarkTimeout . GetValue ( null ) ; if ( currentTimeout . TotalSeconds == 30 ) { resumeBookmarkTimeout . SetValue ( null , TimeSpan . MaxValue ) ; } } else { resumeBookmarkTimeout . SetValue ( null , timeout ) ; } } else { System . Diagnostics . Debug . Fail ( " " ) ; } } else { System . Diagnostics . Debug . Fail ( " " ) ; } }
Internal reflection call to set the ResumeBookmarkTimeout property, which
controls how much time Workflow allows an activity to run while a bookmark is
being resumed.
Internal reflection call to set the ResumeBookmarkTimeout property which controls how much time Workflow allows an activity to run while a bookmark is being resumed .
// This is an attempt to reset the workflow default. // First see if it's been explicitly set. If so, don't reset it. // They've specified a value. Use it.
timeout
TimeSpan
None