State Machine Activity Pack and ADO.NET Activity Pack CTP1 Release now Available

For the last year I’ve had to say “Sorry we don’t have the State Machine in WF4.”  If you are a fan of the state machine I’ve got good news.  Today the team is releasing the first CTP of a couple Activity Packs on CodePlex.  To give them a spin, just download from CodePlex and check out the user guide.

State Machine Activity Pack


After installing, you get some new activities in the toolbox that allow you to create a state machine.


The State Machine supports composite states and all sorts of really cool stuff.  I’m just getting ready to take a 2 hour flight back to Seattle so you know what I’m going to do on the plane…

I’ll have a screencast on available for this soon.

ADO.NET Activity Pack

In the hands on labs for Workflow you may have noticed that when I wanted to update the database I used a CodeActivity<T> and wrote some Entity Framework code.  That was because there was no set of activities for updating a database.

Now we have a simple set of activities for doing ADO.NET calls.

  • ExecuteSqlQuery activity allows you to query a database using SQL statement or stored procedure and process the query result.
  • ExecuteSqlQuery<T> activity allows you to get a collection of objects from the query result to be used in the workflow.
  • ExecuteSqlNonQuery activity allows you to modify database using SQL statement or stored procedure, such as INSERT, UPDATE and DELETE.

For example, if you have a query to return a list of suppliers you can use ExecuteSqlQuery<T>


Next you configure the connection


Then you define the query you want to execute


Then you define how to turn the query result into something you want to use


Can’t wait to try this one out – I’ll have more for you later.  Got to catch a plane now – hope my battery holds up!

Comments (4)

  1. DaRage says:

    This high level programming is going no where! NO WHERE I TELL YOU!

  2. Steve says:

    Where can I get some more info on persisting all these bits?  I want to have a simple workflow which each activity is a "Person" and they set a state to Approve or Reject (and close the workflow on a reject)

    …I’m totally stumped where to go to learn this 🙂

  3. Ron says:

    @Steve – persist what bits?  Persist the workflow or persist the person in the database?

  4. Guang Yang says:

    @Steve – there is a user guide of this state machine and ADO.NET activity at and Take a look.

Skip to main content