Archive

Archive for the ‘workflow’ Category

ProWF 4: Chapter 8 errata

July 20, 2010 Leave a comment

A problem with the code for one of the examples has just been brought to my attention. The code for the ProblemReporting example in Chapter 8 is missing several lines.  This code can be found on page 309 of the first edition of the book.  The missing lines synchronize the code that is assigned to the Notification event with the Idle event of the workflow instance.  Without this code, the code assigned to the Notification event may execute before the workflow is idle and before the bookmarks have been created.

Here is the revised section of code for the Program.cs file of the ProblemReporting project.  The lines that should be added are highlighted below:

static void Main(string[] args)
{
    try
    {
        AutoResetEvent syncEvent = new AutoResetEvent(false);
        AutoResetEvent idleEvent = new AutoResetEvent(false);

        WorkflowApplication wfApp =
            new WorkflowApplication(new ProblemReporting());

        wfApp.Completed = delegate(
            WorkflowApplicationCompletedEventArgs e)
        {
            syncEvent.Set();
        };

        wfApp.Idle = delegate(WorkflowApplicationIdleEventArgs e)
        {
            idleEvent.Set(); //signal that the workflow is idle
            Console.WriteLine("Workflow is idle");
        };

        wfApp.OnUnhandledException = delegate(
            WorkflowApplicationUnhandledExceptionEventArgs e)
        {
            Console.WriteLine(e.UnhandledException.Message.ToString());
            return UnhandledExceptionAction.Terminate;
        };

        HostEventNotifier extension = new HostEventNotifier();
        extension.Notification += delegate(
            Object sender, HostNotifyEventArgs e)
        {
            Console.WriteLine(e.Message);

            idleEvent.WaitOne(2000); //wait until the workflow is idle

            var bookmarks = wfApp.GetBookmarks();
            if (bookmarks != null && bookmarks.Count > 0)
            {
                Console.WriteLine("Select one of these available actions:");
                foreach (BookmarkInfo bookmark in bookmarks)
                {
                    Console.WriteLine("->{0}", bookmark.BookmarkName);
                }
            }

            Boolean isWaitingForChoice = true;
            while (isWaitingForChoice)
            {
                String newAction = Console.ReadLine();
                if (IsBookmarkValid(wfApp, newAction))
                {
                    isWaitingForChoice = false;
                    wfApp.ResumeBookmark(newAction, null);
                }
                else
                {
                    Console.WriteLine("Incorrect choice!");
                }
            }
        };

        wfApp.Extensions.Add(extension);
        wfApp.Run();
        syncEvent.WaitOne();
    }
    catch (Exception exception)
    {
        Console.WriteLine("Error: {0}", exception.Message);
    }
}
Categories: .NET Framework, workflow Tags: ,

ProWF 4 Publish Date

June 30, 2010 Leave a comment

I’ve had a few emails from readers asking when my ProWF 4 book will be available. It was supposed to be available on June 30 (today) but for some reason it’s not. I’m not sure exactly why it’s held up — I know it’s been printed since I have my author copies in front of me right now. My best guess is that it should be available any day now from Amazon and perhaps a bit longer for other outlets.

WF 4.0, Dublin and Oslo Oh My!

October 28, 2008 Leave a comment

No, I’m not attending the Microsoft love fest known as PDC (although I would have loved to go, I just couldn’t arrange it).  So instead, I get to stay at home and read all about the cool new products and frameworks that Microsoft is announcing (and download the CTPs too).

Unless you’ve been hiding under a rock for the last year or so, you’ve heard something about “Oslo”.  Although like me, you’ve probably not been able to fully understand just where MS was going with all of this.  Well they’re finally starting to present more of their vision for the future of development.

Here’s a link to a good overview that MS has just published (written by David Chappell).  It provides a high-level overview of how some of these future pieces will fit together.  The pieces in this case are WF 4.0, Dublin (Windows Server extensions) and Oslo (Modeling repository).

The books are here

June 18, 2008 1 comment

The author copies of my new Pro WF for .NET 3.5 book arrived today.  They look great!  So if you’ve pre-ordered the book from your favorite on-line book seller, they should be shipping any day now.  The official release date is next Monday the 23rd.

Pro WF for .NET 3.5

April 12, 2008 1 comment

So my last post to this blog was back in November. I’ve been very busy working on an updated version of my Pro WF book. The new edition of my book was originally scheduled for availability in late July, but that date has now been moved up to June 23rd.

The new edition provides coverage of the new WF features in .NET 3.5 and includes two new chapters. One of the new chapters covers WF and WCF integration (workflow services). The other new chapter provides better coverage of building custom composite activities and handling long-running tasks. I’ve also reviewed and updated all of the example code, the text and the screen shots.

Categories: .NET, general, technology, workflow

Visual Studio 2008 now available

November 20, 2007 Leave a comment

After a long wait, Visual Studio 2008 (formerly known as Orcas) is now available. I’ve been using beta 2 for some time now and it’s been very stable. .NET 3.5 is also included with VS 2008. I’ll now have to find a spare day to uninstall the beta and install RTM.

Here are a few pertinent links:

http://msdn2.microsoft.com/en-us/vstudio/default.aspx

http://msdn2.microsoft.com/en-us/subscriptions/bb608344.aspx

http://www.microsoft.com/express/

Let the downloading begin!

Pro WF on sale at Bookpool

October 2, 2007 Leave a comment

Bookpool.com has all Apress books on sale at 50% off list price. It’s a great time to pick up my Pro WF book if you don’t already have it. Since it’s also published by Apress, my .NET Interop recipes book is also on sale.