Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microsoft Windows Workflow Foundation 4.0 Cookbook

You're reading from   Microsoft Windows Workflow Foundation 4.0 Cookbook Get the flexibility of Windows Workflow Foundation working for you. Based on a cookbook approach, this guide takes you through all the essential concepts with recipes you can apply or adapt to your own specific needs.

Arrow left icon
Product type Paperback
Published in Sep 2010
Publisher Packt
ISBN-13 9781849680783
Length 272 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Andrew Zhu Andrew Zhu
Author Profile Icon Andrew Zhu
Andrew Zhu
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Microsoft Windows Workflow Foundation 4.0 Cookbook
Credits
About the Author
About the Reviewers
Foreword
Preface
1. Workflow Program FREE CHAPTER 2. Built-in Flow Control Activities 3. Messaging and Transaction 4. Manipulating Collections 5. Custom Activities 6. WF4 Extensions 7. Hosting Workflow Applications 8. Custom Workflow Designer Index

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),
                                   new BookmarkCallback(OnResumeBookmark));
        }
        public void OnResumeBookmark(NativeActivityContext context,
                                     Bookmark bookmark...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image