BizTalk Utilities CV ,   Jobs ,   Code library
 
Go to the front page to continue learning about XML or select below:

Contents

ReBlogger Contents

 
WSE
SOA
XML

 
 

All posts by : Advanced Workflow: Enabling Tricky Scenarios

Page 1 of 1

2006 Oct 18

1 of 13 | My New Blog - Two things have happened which made me think I needed a second blog: My job has changed slightly so I've got a few non-workflow things to say now. I wanted a place where I didn't feel obligated to stick to work related topics. Let me introduce to you http://SharedMemory.spaces.live.com.  It's just a place for me to post the interesting non-workflow things that I come across at work as well as any other random technical thoughts that come to mind. Enjoy. Nate...

2006 Jun 20

2 of 13 | Forum post about Persistence, IEventActivity, Transactions, and Correlation - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=488698&SiteID=1&mode=1 There was a great set of questions that showed up on the forum the other day and I've finally gotten around to answering them all.  I was planning on posting the answers in this blog, but instead I'll just reference back to the forum post. Summary:* What is persisted with a workflow instance and what state am I in after a computer crash?Queues, the internal list of scheduled items, and the binary serialization of the workflow tree are all persisted.  Reloading an instance after a workflow crashes gives you the exact state you had at the last persistence point. * I want a single activity which d......

2006 May 19

3 of 13 | Passivation (Dehydration, Unloading) Policy - Windows Workflow Foundation (WF) ships with two out of box modes of passivation (also referred to as dehydration and unloading) of a workflow.  Passivation is the process by which a workflow's state is saved to the database AND the workflow is removed from memory for the time being. Out of Box Support Unfortunately our support is very binary and only related to the idle time of a workflow instance.  Our base persistence service class, WorkflowPersistenceService, defines a boolean method UnloadOnIdle which will be called when a workflow goes Idle.  If this method returns true, then the instance in question will be unloaded (persisted and removed from memory).  If, howev......

2006 Apr 25

4 of 13 | ASP.NET and DefaultWorkflowSchedulerService - QUESTION: Can I use DefaultWorkflowSchedulerService instead of ManualWorkflowSchedulerService in my IIS hosted WorkflowRuntime? ANSWER: Do so at your own risk.  It's like swimming in an unguarded pool or skydiving ... Using the DefaultWorkflowSchedulerService in an IIS host (specifically ASP.NET) is one of those good/bad scenarios depending on point of view.  Windows Workflow Foundation (WF) has no qualms about using the DefaultWorkflowSchedulerService in an ASP.NET hosted scenario and everything will work just fine from a WF point of view.  The problem is that ASP.NET does NOT like people using up all its threads. Our ManualWorkflowSchedulerService was written specifi......

2006 Mar 21

5 of 13 | Spawned Contexts - Replicator, While, State, EventHandlers, and CAG - Ever wonder why this.delayActivity1.TimeoutDuration sometimes doesn't change the timeout duration?  How come this.callExternalMethodActivity1.ParameterBindings["(ReturnValue)"] isn't giving you the value you expect in some scenarios?  How is it possible that sometimes this.GetActivityByName("foo") does not equal my sender for one of foo's events?  The answer to all of these questions is: spawned contexts. One of the most powerful and most easily misunderstood concepts in Windows Workflow Foundation (WF) is that of new contexts executing cloned activities.  Before we even define a spawned context, let's go back to the beginning ... The Beginning One of the ......

2006 Mar 01

6 of 13 | Clean up your Created Workflows - QUESTION: What happens to a workflow instance I've created but never started? ANSWER: Calling WorkflowRuntime.CreateWorkflow() will give you back a WorkflowInstance which, in essence, is a proxy to a runtime instance in the Created state.  But what happens to that instance if it is never started? Upon calling CreateWorkflow you have caused the runtime to create an in-memory instance of the workflow.  This includes calling Initialize on the entire workflow tree as well as readying runtime resources like tracking channels.  This in-memory instance will not "unload on idle" because the Created state is technically not idle ... only something that is running can become idle. T......

7 of 13 | Workflows and Transactions - QUESTION: How do I get access to a transaction inside my workflow? ANSWER: First of all, this post has nothing to do with flowing a transaction into a workflow instance.  That is a completely different topic which we might cover at some other time. TransactionScopeActivity With that out of the way, there are two ways to get access to a transaction inside of your workflow.  The first is through the TransactionScopeActivity activity.  In simplest terms, a System.Transactions.Transaction is created at the start of the TransactionScopeActivity and every activity inside the TransactionScopeActivity will have a valid Transaction.Current. At the close of the TransactionScopeActi......

2006 Feb 23

8 of 13 | ActivityExecutionStatus.Faulting - QUESTION: Can I return ActivityExecutionStatus.Faulting from a signal method to "fault" the activity? ANSWER: As a general rule only the current status and Closed are valid return values from any of the signal methods.  Therefore: Execute() – Return values of ActivityExecutionStatus.Executing and Closed valid. Cancel() – Return values of ActivityExecutionStatus.Canceling and Closed valid. HandleFault() – Return values of ActivityExecutionStatus.Faulting and Closed valid. Compensate() – Return values of ActivityExecutionStatus.Compensating and Closed valid.  If an invalid value is returned from a singal method then the runtime will throw an InvalidOperationException which will p......

9 of 13 | Parallelism in Windows Workflow Foundation (WF) - QUESTION: Does a ParallelActivity start one thread for each branch?  How many threads will it use for processing? ANSWER: The short answers are "no" and "1".  If you've heard it before, then these answers make sense.  If not, then read on for an explanation of parallelism in WF. To promote programming simplicity for both the custom activity and workflow writer, WF has chosen to make the guarantee that only one .NET thread will be executing any portion of a workflow at any given time.  This means that the handler for your CodeActivity, the Execute method for your custom activity, and the sequence in your EventHandlerActivity will never have to worry that some other......

10 of 13 | Replicator Tips and Tricks - Here are a few tips and tricks for using the ReplicatorActivity successfully.  It is a powerful activity which, when approached from the correct point of view, can be relatively easy to use. Definitions seed value - a value added to either of the ReplicatorActivity's child collections.  This value is associated with a single instance of the replicator's child. template activity - the direct child of the replicator is referred to as the template activity.  At replicator startup one instance of the template activity will be run for each seed value in the child data collection. Tips and Tricks Use your activity properties!  Oftentimes users are confused as to where bes......

2006 Feb 22

11 of 13 | Activity "Lifetime" Methods - QUESTION: How do I manage resources (like sockets) which are held by an activity? ANSWER: System.Workflow.ComponentModel.Activity has several overridable methods defined, but there is a newer subset of these methods which I like to refer to as "Lifetime" methods.  These are methods that bookend the activity's life from some point of view.  They are: OnActivityExecutionContextLoad / OnActivityExecutionContextUnload / Dispose Initialize (also a signal method) / Uninitialize Short Version The short version is that OnActivityExecutionContextLoad and OnActivityExecutionContextUnload bookend the activity's memory lifetime as far as the Windows Workflow Foundation (WF) runtime ......

12 of 13 | Any Questions? - Is there anything about Windows Workflow Foundation (WF) that you would like to know and feel is an appropriate topic for this blog?  If so, please add a comment to this post.  I will use the comments as seeds for future postings.  Even if someone has already posted your specific question, please add your own comment as well so that I can do a better job prioritizing. Note that posting here does not in any way guarantee that I will respond, but I will try to do the best that I can.  Another good resource for general WF questions is the http://www.windowsworkflow.net.  This site has articles and samples of its own as well as links to other blogs and related MSDN for......

13 of 13 | Introduction - The purpose of this blog is to provide public answers to the Windows Workflow Foundation questions that I come across every now and again at work.  These questions usually target a specific scenario but can be easily abstracted to a more general inquiry of "how to accomplish X" or "why does Y happen" or "what is the purpose of Z".  The end goal is to provide a quick reference for the solutions to tricky problems that custom activity writers and complex scenario developers will face during design and implementation.  As such, welcome to Advanced Workflow: Enabling Tricky Scenarios. About the author: My name is Nathan Talbert and I work for the Windows Workflow Foundation team......

Page 1 of 1

Newest posts
 

    Email TopXML