O'Reilly logo

Microsoft Windows Workflow Foundation 4.0 Cookbook by Andrew Zhu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an Input Message activity using Bookmark

When a workflow is running and we want to send a message to the workflow during run time, how can we achieve this? We can use Bookmark to achieve this. In this task, we will create an activity using Bookmark, which will function as a message input activity.

How to do it...

  1. Create the InputMessage activity:

    Add a new code file to the ActivityLibrary project named InputMessage.cs. Then, replace all the default code with the following code:

    using System.Activities; public class InputMessage<T>:NativeActivity { public InArgument<string> bookmarkName { get; set; } public OutArgument<T> result { get; set; } protected override void Execute(NativeActivityContext context){ context.CreateBookmark(bookmarkName.Get(context), ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required