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…

0

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…

4

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…

1

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…

19

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…

28

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…

3

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…

0

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…

7

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…

12

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() –…

0