.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Workflow Foundation 4.0 Persistance Issue.

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :Windows Application

I am trying to get the list of all the workflow instances that have been suspended due to unhandled exception.

I am looking at the [System.Activities.DurableInstancing].InstancesTable . the value of the instance is not being updated when the instance is terminated or workflow is completed. but the instance record is created.

given below is my instance persistance code.


 SqlWorkflowInstanceStore instanceStore = new SqlWorkflowInstanceStore(@"Data Source=[machineName];Initial Catalog=[DatabaseName];Integrated Security=True");
      instanceStore.InstanceLockedExceptionAction = InstanceLockedExceptionAction.AggressiveRetry;
      instanceStore.InstanceCompletionAction = InstanceCompletionAction.DeleteNothing;
      InstanceView view = instanceStore.Execute(instanceStore.CreateInstanceHandle(), new CreateWorkflowOwnerCommand(), TimeSpan.FromSeconds(1));
      instanceStore.DefaultInstanceOwner = view.InstanceOwner;
      WorkflowApplication newApp = CreateWorkflow(instanceStore);

This is my workflow completed code


 static void WfCompleted(WorkflowApplicationCompletedEventArgs e)
      if (e.CompletionState == ActivityInstanceState.Faulted)
        Console.WriteLine("Workflow {0} Termin

View Complete Post

More Related Resource Links

Real-World WF: Best Practices For Windows Workflow Foundation Apps


The heart of Windows Workflow Foundation is its declarative programming model. Here are some best practices to consider when using WF to realize software solutions in the real world.

Josh Lane

MSDN Magazine December 2008

WF How-To: Building State Machines with Windows Workflow Foundation


State Machine workflows represent a different way of visualizing program logic. Rather than flowing from activity to activity like sequential workflows, State Machines transition from state to state. Learn about uses for State machines and see how to design and build a State Machine workflow with Windows Workflow Foundation.

Keith Pijanowski

MSDN Magazine February 2008

Cutting Edge: Windows Workflow Foundation, Part 2


In last month's column, I presented a helpdesk workflow sample that focused on Windows® Forms client applications. This month I'll discuss ASP. NET workflow applications and the ability to expose a workflow as a Web service and invoke a Web service from a workflow.

Dino Esposito

MSDN Magazine April 2006

Cutting Edge: Windows Workflow Foundation


In the January 2006 issue, Don Box and Dharma Shukla introduced Windows® Workflow Foundation and discussed the overall architecture of the framework and its constituent components (see WinFX Workflow: Simplify Development With The Declarative Model Of Windows Workflow Foundation).

Dino Esposito

MSDN Magazine March 2006

WinFX Workflow: Simplify Development With The Declarative Model Of Windows Workflow Foundation


Windows Workflow Foundation allows you to write workflow-based programs in terms of domain-specific activities that are implemented in CLR-based programming languages such as C# and Visual Basic. Here Don Box and Dharma Shukla get you started.

Don Box and Dharma Shukla

MSDN Magazine January 2006

XOML only workflow performance issue while creating

  In our application we are using XOML workflow and create workflow instance using workflowRuntime.CreateWorkflow(workflow, ruleReader, workflowParameters) where workflow and ruleReader are objects of XMLReader created using XmlReader.Create().For one of our business process automation we have developed XOML only workflow which has 35 states and 95 events. When we try creating an instance of the workflows it is taking more time and the time taken to create the instance is 3 min.Can any one suggest is there any other way to create workflow instance of XOML only workflows other than workflowRuntime.CreateWorkflow(workflow, ruleReader, workflowParameters)Your help is higly appreciated.Environment:    VS 2008    ASP.NET 3.5    WWF 3.5    XP  

Where is the issue tracking workflow?

Hi All, Going through the out of the box workflows currently and I can't work out where the Issue tracking workflow would be found? Technet doco refers to both the three state and issue tracking as being separate workflows and that the issue tracking workflow is about we pages. http://technet.microsoft.com/en-us/library/cc263148.aspx#DefinedAgain  I can create an issues tracking list and add a three state workflow to that. Just trying to learn about the Issue Tracking workflow. Any ideas on where I can add or configure this workflow? Thanks, Gavin  

State Machine Workflow XOML issue

"Please help me out this problem" "Its too urgent" I have modified State Machine Workflow XOML file and upload again with my application. Now i am getting error while calling CreateWorkflow(). I am getting the following error. "Wokflow Validation Failed" "Activity 'handleExternalEventActivity1' validation failed: Property 'InterfaceType' is not set." If i am uploading the existing XOML file then it is working fine without any error. What i have to do and where i did mistake?

Document Workflow Issue

I have started to see some irregualrities in my document workflow setup whereby a user will recieve an email to say they have started the workflow on their dcument that they have uploaded, within this email there is a list of 3 reviewers, but now these reviewers are not being listed, i have looked in the event log and i have loads of event id 3083 which states: The protocol handler Search.Mapi2Handler.1 cannot be loaded. Error description: Class not registered Any ideas?? The event id`s i have seen are 6875, 3083, 1516

Microsoft Windows Workflow Foundation 4.0 Cookbook

@Andrew Zhu, Can you let me know, when the book will be published. I pre-ordered the ebook, but not sure when that will be out.

Sharepoint 2010 Workflow issue

I am using SharePoint Designer 2010 to implement a workflow approval process on InfoPath forms. I added the workflow on an InfoPath and although it shows me that the workflow is completed, it doesn't do what it is supposed to do. It is supposed to send an email to the Manager once the form is submitted and fulfills certain critieria. It doesn't send that email. The workflow is fairly simple: If Form:Department equals (ignoring case) XYZ Email xyz   The type of workflow is "List Workflow". I am not sure where I am going wrong. It looks a simple thing to solve but my mind seems blocked. Any clues??

Adding Flexibility to SharePoint 2010 Workflows Using the Windows Workflow Foundation Rules Engine

Learn about Windows Workflow Foundation rules engine capabilities and benefits to automate business logic and processes for workflows in SharePoint 2010 applications.

Issue in Look up field in SPD workflow


I have created a workflow in my task list. I have also created another SharePoint List known as "Leave Application" which is a forms library. Now i want to use 2 fields from "Leave Application" list to the task list. 

I am using SharePoint Designer to create my workflow. I want to extract two fields from my "Leave Application" list to task list so that i can show these fields in my task view.

How to do that? In task list, i am only able to see the columns which i created in task list. But what if i want to use 2 columns from some other list in to the task list so that task list can get the same values for those fields or columns when the user fills leave application form.

Also in the action "Collect Data from a User", if i want to add fields from other list then how to do that?

Can anyone help me in this?


Sharepoint Foundation: Edit Three-State Workflow


Hi, can one edit the out of the box Three-State workflow through Sharepoint Designer?
We are using Sharepoint Foundation and the Three-State workflow doesn't appear under Workflows in Designer, although it is available as a template in Foundation.

I would like to see how that workflow was created to help me in creating my own custom workflows.

I created a New Task List and managed to get the WF to create a task after an Event was created in a Calendar. But I am not sure how to create a second Task after the 1st was completed.


Custom Task poeprties values persistance issue?



This is the case: I wrote a simple task that has one property Display text, it displays text once the package if fired. This built in task has an interface. The user should normally enter the display text property value and click OK then that value is persisted. If the user interface is closed then reopened then this value should be held as normally.

Should I write custom code to cache this value and then write a code to persist it or this is done through a provided way by the SSIS, I asked this question before and CosyRock oriented me to some code samples which I followed with a great intention but until now I couldn't figure out how to persist properties values.

In this case I use the IDtsTaskUI interface to tie the task to its interface and you know there isn't an Edit method such is IDtsComponent interface so I can imlement it to commit or rollback values?

 Thank you

The complexity resides in the simplicity

Time card management template workflow issue


If we installed Time card management template in share point 2007 By default it will be working (work flow) right?

Otherwise we have to configure anything?

If i try this workflow message is failed to start

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend