Welcome to Windows Workflow Foundation (WF)
Top Tasks :

WF Community Bloggers

Browse by Tags

  • Red Gate to continue development of .NET Reflector

    .NET Reflector, by Lutz Roeder, must be one of the most useful tools I have when developing .NET code. Usually it is the first thing I install right after Visual Studio not even waiting until I need it because I know I will.

    So the big news is that Red Gate, makers of the Ants profiler and lots of other tools, are taking over from Lutz Roeder and will continue developing .NET Reflector. Interesting move and I hope this means a bright future for the .NET Reflector.

    Read more about this here.

     

    Enjoy!

     

    www.TheProblemSolver.nl
    Wiki.WindowsWorkflowFoundation.eu

  • Explaining Roy Fielding's Dissertation to my Wife - Roy is to REST as Dizzy is to Bebop (theoretically)

    My lovely wife Shannon is helping to do proof-reading on my book , and today she was working on the preface. One of the things I talk about in the preface is about Roy Fielding, and how his dissertation is really a named codification of the architecture of the Web She said to me "This really bugs me, why does someone get credit for just naming and distilling something that already exists" I replied with "Well - naming things is important and he was part of the effort to create the thing (the Web) so he should get some of the credit" She said "Hmm - I still don't get it, can you give me an example from outside of the world of technology" I said "Imagine when bebop was being created as a genre of music. Think about Dizzy Gillespie , imagine he wrote a paper in about 1950 describing bebop, how it worked, and what went into creating it, and how to tell bebop from other forms of jazz based on chord structures, etc." That made sense to her, so I thought I would blog about it. :-) Check out my BizTalk R2 Training . Read More...
  • REST posts

    Now that I'm done with the major writing portion of my book , I'm going to try to post more. Many of my posts will be about the technical details of using REST and WCF (the main thrust of my book). I'm going to also start some linking to other blogs, which in the past I've kind of stayed away from. The purpose of these links will be to try to bring some of the ideas of REST that exist outside of windows and .NET developers, to the .NET developer's space. The post I am linking to today is by Steve Vinoski . Steve is a pretty interesting person, having worked at a company that built RPC systems for many years, he is now building software for a company (I think we still don't know what the company is or what it does. The point of his post today is one that I have found to be pretty true. People that actually has built a system with REST versus SOAP/RPC aren't the ones out there saying that SOAP/RPC is superior to REST (or the typical "I just don't get why I'd care about REST"). Check out my BizTalk R2 Training . Read More...
  • Book review: Pro WF by Bruce Bukovics

    Windows Workflow Foundation, WF for short, is one of the technologies I work a lot with and as a consequence I own several books about WF. Comparing this book with the others I can only say it is one of the best books you can get on the subject. It has a good coverage of almost all the subject you are going to need to know. Not only is there a good coverage but the explanation and examples are very clear. Now there are a few thing missing from the book. As it was written with the .NET framework 3.0 there is no coverage of the WCF integration that comes in the form of the SendActivity and the ReceiveActivity. While this is unfortunate it is also understandable and I can only hope that the author has the time to update the book with one more chapter.

    For a book this size, about 700 pages, I was amazed at how little I could find that I didn't like. In fact one of few errors I could find is the statement that only a single instance of the WorkflowRuntime can be created per AppDomain. This is a myth that stems back to the first beta's where it was briefly the case but the restriction has been lifted long ago and has never been part of the released product. But given the size of the book and how few people ever need to create multiple WorkflowRuntime objects it is hardly a big objection.

    So my advise: If you are getting into Windows Workflow Foundation make sure you buy this book!

     

    Enjoy.

  • Could Agile Trend Be Driven By Technology?

    Ok, I just got back from vacationing in the Gulf of Mexico and I feel reenergized...so reenergized I feel like writing a bit! It seems that all I hear about is Agile development methodology anymore. User groups and Special Interest Groups (SIGs) have even changed their names to reflect some connection to Agile's methodology, but still I can't help but wonder what the whole Agile movement stems from. If I think back to what I learned in college, my thoughts are drenched from listening over and over about the Waterfall methodology. This was what colleges were training young graduates to use once we hit our first job, but 10+ years ago technology was much different. Let's talk a little about the Waterfall Methodology. The Systems Development Lifecycle (SDLC) was a little bit different then. Development started with Planning and once development of the gathered requirements was finished and the solution was deployed, the lifecycle ended with Maintenance. If changes were needed, well then the lifecycle started over again. Well back then technology was different or should I say harder to develop. There really was not the level of Rapid Application Development (RAD) like there is today. Other than Joint Application Development (JAD) sessions, clients were not as involved with the overall development lifecycle. Business/System analysts were just then making their ways to the front lines because developers were still somewhat tucked in the dark depths of basements, looking for their staplers. Read More...
  • Microsoft Visual Studio 2008 Service Pack 1 Released

    Ready for ASP.Net generation? This service pack is a must! It does this by taking advantage of LINQ and rich functionality supplied by AJAX. Download the service back here I also found a great article in this month's Visual Studio Magazine Read More...
  • Visual Studio 2008 Service Pack 1 available

    It is available from the subscriptions download at http://msdn.microsoft.com/en-us/subscriptions/default.aspx

     

    Get it while it is hot Smile

     

    Enjoy!

  • Want To Speak At Jacksonville Florida's Code Camp

    Looks like invitation for speaking at the Jax Code Camp is still open. This would be a great opportunity if you are trying to become a speaker within your community or if you would like to share your technology passion with others. If you do not want to speak but are interested in attending, register here . Read More...
  • More on using a TransactionScopeActivity within a ReceiveActivity

    In a previous blog post I write about what happens when you place a TransactionScopeActivity within a ReceiveActivity and an exception occurs that is supposed to roll back the transaction. In short the story was very bad and we could come up with only a partial workaround, not a pretty sight.

     

    But there is more to it than just that little horror story. Suppose you do the obvious and place the a TransactionScopeActivity within a ReceiveActivity and no exception occurs. Say like the workflow below, please note that the codeActivity1 only sets the return value and causes no error.

     

    image

     

    Now the transaction is committed and the WCF call returns perfectly normally so everything is good right. Well not quite Sad

    The obvious first point is that the TransactionScopeActivity serves no real purpose. After all if it isn't allowed to fail under any circumstances why bother with it in the first place. Well ok there is the point of doing several updates as a single transaction so other users cannot see a partially committed order but that is about it.

    But that is actually the least of my worries as there is a far bigger issue to worry about and that is called workflow persistence.

    Yes that is right. After all when we are using a TransactionScopeActivity workflow persistence is mandatory. The TransactionScopeActivity is decorated with the PersistOnClose attribute so the state of the workflow will be persisted as soon as the transaction is complete. And normally that is a good thing but in this case it is the cause of the second problem because this is still inside the ReceiveActivity. So basically we are storing the workflow state as it is just before returning an answer to the client. Now if everything is running fine that won't matter because the workflow will continue until it is finished and everyone is happy. But suppose the workflow host terminates before the workflow is finished? In this test I added the DelayActivity, and set UnloadOnIdle to false so it doesn't persist the state, giving me the opportunity to kill the workflow runtime. Now if I restart the runtime It is going to reload the last state of the workflow and continue from there. And guess what it's going to do first? You guessed it: it is going to send the response to the client for a second time. Of course the client is no longer around and that action fails with an InvalidOperationException with message "Workflow unloaded between request & response."

    I guess the message is not entirely correct as it should say "Workflow reloaded between request & response." but it's close enough.

    The bottom line is the workflow terminates unless you specifically allow for this to happen and catch the error.

     

    So basically we have a choice between putting the TransactionScopeActivity inside a ReceiveActivity, not being able to throw an error and having a restore problem, or putting the TransactionScopeActivity around the ReceiveActivity, something that only works with a sequential workflow and an initiating ReceiveActivity as I described in the previous post.

    I guess these options make me pretty unhappy Sad.

     

    Enjoy your workflow transactions!

  • Ron Jacobs and I speculate on Oslo

    This video was shot at TechEd US 2008 - they just sent me this URI this week - http://mfile.akamai.com/14853/wmv/microsofttec.download.akamai.com/14853/TechEdOnline/Videos/08_NA_Dev_techtalk_41_low.asx Guess I am catching up on things to posts :) Check out my BizTalk R2 Training . Read More...
  • Entries out of order - but another user group talk

    I love the San Gabriel .NET user group - mostly because its so close to home! I'll be speaking on my newest favorite subject - REST! on August 20th - details here http://www.sgvdotnet.org/ Hope to see LA locals there :) Check out my BizTalk R2 Training . Read More...
  • R2 class in New York done!

    Had a great week! Thanks to all that attended. Here is the source code for demos are promised. demos.zip (1.99 MB) Check out my BizTalk R2 Training . Read More...
  • BizTalk User Group Sweden

    Another user group talk for me - this time in Sweden! Here is the info (in Swedish) http://biztalkusergroup.se/blogs/info/archive/2008/08/06/n-228-sta-tr-228-ff-den-4-e-september-med-jon-flanders.aspx See you there! Check out my BizTalk R2 Training . Read More...
  • SQL Server Compact 3.5 SP1 released

    Steve Lasker just announced that SQL Server Compact 3.5 service pack 1 is released, read his announcement here.

    They added support for the entity framework, great stuff. And another neat feature is native 64 bits support. No longer do you need to target X86 and use WoW [:0]. Great if you are using my SQL Server Compact Workflow Persistence Service.

    Enjoy!

  • Using a TransactionScopeActivity with a WCF ReceiveActivity

    I got an email from a friend last week asking about using a ReceiveActivity and, while receiving, using a TransactionScopeActivity to transitionally save some data in a database. Seems like a common enough scenario right? Well he was having some problems. If everything worked and the transaction succeeded everything was fine and the answer came back. But if an exception occurred and the transaction was aborted be was receiving a real weird error:

    System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Workflow service unexpectedly unloaded from memory while executing a ReceiveActivity. Make sure that the the workflow does not contain any blocking activities within a ReceiveActivity.  (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
    System.InvalidOperationException: Workflow service unexpectedly unloaded from memory while executing a ReceiveActivity. Make sure that the the workflow does not contain any blocking activities within a ReceiveActivity.).

    If we where to believe the message there was a blocking call, something there most certainly was not!

    And to make things more confusing, if we removed the TransactionScopeActivity and just let the exception occur it would bubble back to the client just as it was supposed to. So what gives?

    Well a lot of people looked at this and in the end we declared this a pretty bad bug. Mind you our words not those from Microsoft. But we did find a workaround. So lets take a look at a repro and how to fix this. My original test workflow looked like this:

    image

    I receive a WCF request, start a transaction, determine the return value in a code activity, throw an exception and return. Seems reasonable right? Well I thought so but it produces the error claiming there is a blocking statement. While tracking this Marvin actually noticed that the workflow idle event was raised! Excuse me, a workflow is becoming idle to undo a transaction sounds kind of wrong. And of course when a TransactionScopeActivity is used in a regular workflow, ie non WCF call, there is no Idle event.

     

    A partial solution

    So the way to get this to work is create the following workflow:

    image

    So instead of creating a TransactionScopeActivity inside of my ReceiveActivity I am doing it the other way round. Sounds kind of weird right? Well I think so but it does do the right thing as it returns the correct fault information to the client and then undoes any transactional work done.

     

    So why does this workaround work in this case?

    The ReceiveActivity has its CanCreateInstance property set to true so this is the request that actually creates and starts the workflow. This means that the workflow is created and starts executing from the top. Yes that is right, it starts from the top, not from the ReceiveActivity so any activities before that are also executed. I suppose that potentially opens a can of worms but we will leave that be for the moment. In this case the WCF request is received, this starts the workflow, this in turn starts the transaction, the message is received and processed and the transaction either commits or, like in this case, rolls back.

    How about a non creating ReceiveActivity?

    Well I am afraid no luck there as this workaround isn't going to work then. The problem is that we start a transaction before we start waiting for the additional WCF calls and the TransactionScopeActivity has a a TimoutDuration. So in all likelihood the transaction timeout will occur before the message is received and this effectively cancels the ReceiveActivity meaning it cannot receive the message.

     

    I think this is a pretty major problem with the way WF and WCF work together. After all transactions a an essential piece of business applications and not being able to use them inside of a WCF request is a deadly sin.

     

    Enjoy with case Smile

More Posts Next page »

<August 2008>
SuMoTuWeThFrSa
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us