This documentation is archived and is not being maintained.

WorkflowApplication::ResumeBookmark Method (String, Object)

Initiates an operation to resume the bookmark with the specified name, using the specified value. The bookmark to be resumed is previously created by an activity within the workflow instance.

Namespace:  System.Activities
Assembly:  System.Activities (in System.Activities.dll)

BookmarkResumptionResult ResumeBookmark(
	String^ bookmarkName, 
	Object^ value


Type: System::String
The name of the bookmark to be resumed.
Type: System::Object
An object passed as a parameter to the method that is invoked when the bookmark resumes.

Return Value

Type: System.Activities::BookmarkResumptionResult
The result of the bookmark resumption operation.

The bookmark result indicates whether the resumption operation succeeded or failed.

The following example creates a workflow that uses a ReadLine activity that creates a Bookmark. The workflow is started, and once the Bookmark is created and the workflow goes idle, the user's input is gathered and the bookmark is resumed.

public sealed class ReadLine : NativeActivity<string>
    public InArgument<string> BookmarkName { get; set; }

    protected override void Execute(NativeActivityContext context)
        // Create a Bookmark and wait for it to be resumed.
            new BookmarkCallback(OnResumeBookmark));

    // NativeActivity derived activities that do asynchronous operations by calling 
    // one of the CreateBookmark overloads defined on System.Activities.NativeActivityContext 
    // must override the CanInduceIdle property and return true.
    protected override bool CanInduceIdle
        get { return true; }

    public void OnResumeBookmark(NativeActivityContext context, Bookmark bookmark, object obj)
        // When the Bookmark is resumed, assign its value to
        // the Result argument.
        Result.Set(context, (string)obj);

Variable<string> name = new Variable<string>();

Activity wf = new Sequence
    Variables = { name },
    Activities =
         new WriteLine
             Text = "What is your name?"
         new ReadLine
             BookmarkName = "UserName",
             Result = new OutArgument<string>(name)

         new WriteLine
             Text = new InArgument<string>((env) => 
                 ("Hello, " + name.Get(env)))

// Create a WorkflowApplication instance.
WorkflowApplication wfApp = new WorkflowApplication(wf);

// Workflow lifecycle events omitted except idle.
AutoResetEvent idleEvent = new AutoResetEvent(false);

wfApp.Idle = delegate(WorkflowApplicationIdleEventArgs e)

// Run the workflow.

// Wait for the workflow to go idle before gathering
// the user's input.

// Gather the user's input and resume the bookmark.
// Bookmark resumption only occurs when the workflow
// is idle. If a call to ResumeBookmark is made and the workflow
// is not idle, ResumeBookmark blocks until the workflow becomes
// idle before resuming the bookmark.
BookmarkResumptionResult result = wfApp.ResumeBookmark("UserName", 

// Possible BookmarkResumptionResult values:
// Success, NotFound, or NotReady
Console.WriteLine("BookmarkResumptionResult: {0}", result);

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.