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

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

OnWorkflowItemChanged in parallel with Delay

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :C#


I have a state machine workflow developed in vs2005 running on a document library  that sends our reminders when contracts stored within the library are about to expire. It has 3 states

the state1 delays untilt the 'notification dare' (a field in the library) is hit, then sets the state to state2.

 state2 sends out weekly reminders by delaying for 7  days, sending a reminder and setting the state back to state2. One week before the contract expiration date (anothe field in the library) it sets state to state3.

The state3 sends out daily reminders by delaying for 1  days, sending a reminder and setting the state back to state3.

It works fine, but i need to have the workflow reactt to changes to the date fields in the library. For example in state1 if the notification date is change in the library I need to restart state1 with the new date.

I'm trying to figure out how to have each of these states include an OnWorkflowItemChangedEvent so that the workflow will be reactivaed when eithher the delay timeout is hit OR the workflowItem is changed.  From what I've read, the listener can do this, but its not allowed in a statemachine.  Can someone provide some help as to have a statemachine workflow activated when the underlying item is changed?


View Complete Post

More Related Resource Links

Parallel port complete: programming, interfacing & using the PC's parallel

Parallel port complete: programming, interfacing & using the PC's parallel


Concurrent Affairs: Data-Parallel Patterns and PLINQ


Multicore processors are now ubiquitous on mainstream desktop computers, but applications that use their full potential are still difficult to write. Version 4 of the .NET Framework will deliver several tools that programmers can employ to make this task easier. This article explores the use of one of those tools: Parallel LINQ (PLINQ).

Igor Ostrovsky

MSDN Magazine December 2009

Parallel Debugging: Debugging Task-Based Parallel Applications in Visual Studio 2010


In Visual C++ 10 and the Microsoft .NET Framework 4, Microsoft is introducing new libraries and runtimes to significantly ease the process of expressing parallelism in your code base, together with new tool support for performance analysis and debugging of parallel applications. In this article, you will learn about debugging support in Visual Studio 2010, much of which is focused on task-based programming models.

Stephen Toub, Daniel Moth

MSDN Magazine September 2009

Windows With C++: Visual C++ 2010 And The Parallel Patterns Library


The Parallel Patterns Library allows you to more easily take advantage of parallelism. See what this and other Visual C++ 2010 features are in store.

Kenny Kerr

MSDN Magazine February 2009

Paradigm Shift: Design Considerations For Parallel Programming


This article presents an overview of the motivation behind new techniques that decompose problems into independent pieces for optimal use of parallel programming.

David Callahan

MSDN Magazine October 2008

Parallel LINQ: Running Queries On Multi-Core Processors


Use Parallel Language Integrated Query (PLINQ) to take advantage of multi-processor computers and the newer wave of multi-core processors.

Joe Duffy and Ed Essey

MSDN Magazine October 2007

Parallel Performance: Optimize Managed Code For Multi-Core Machines


While multi-core processors have become increasingly common, most applications still fail to take advantage of multiple cores. Here's an overview of creating multithreaded applications that benefit from these new processors.

Daan Leijen and Judd Hall

MSDN Magazine October 2007

Email enabld list delay on recieving emails


So the situation is, i have a list, that receives emails from a particular account all day long, recently it has started recieving emails "late" being it will mass process emails at various times of the day. Before it proccessed them as soon as they were received.

Event log shows

A critical error occurred while processing the incoming e-mail file C:\Inetpub\mailroot\Drop\e472144001cb44a40000001e.eml. The error was: The process cannot access the file 'C:\Inetpub\mailroot\Drop\e472144001cb44a40000001e.eml' because it is being used by another process..


Have this error everywhere.

        -Restarted SMTP

        -Restarted IIS

It seems SMTP is having issues but wanted to come here and get some insight.


-I havent changed anythign recently except new cable runs to the switch

-There is no mail in the (Drop, Mailbox,Pickup, Queue) folders

-mail setup settings are

              -incoming is set to "Advanced" , no,  server.domain.com

Outgoing is my exange server.



Timer delay

Hi guys, Please can one of you help me out. I have a bit of a trouble with the timer, it delay of 10 seconds which it should be of 5 seconds when I started the timer.   here it is the code Public Class Form1 Dim cPos As Point Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load cPos = Windows.Forms.Cursor.Position End Sub Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick If Me.Panel1.ClientRectangle.Contains(Me.Panel1.PointToClient(Windows.Forms.Cursor.Position)) Then Me.Panel1.Show() If Panel1.Visible = True Then Timer1.Interval = 5000 Timer1.Start() Dim nPos As Point = Windows.Forms.Cursor.Position If cPos <> nPos Then cPos = nPos Else MessageBox.Show("mouse NOT moved in last 5 secs.") Panel1.Visible = False Timer2.Enabled = True End If End If End If End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick Dim nPos As Point = Windows.Forms.Cursor.Position If cPos <> nPos Then cPos = nPos If Panel1.Visible = False Then If Me.Panel1.ClientRectangle.Contains(Me.Panel1.PointToClient(Windows.Forms.Cursor.Position)) Then Panel1.Visib

Parallel Receive Action in Pick

HI,  i have a new question... yes, another :-) I have a Pick in my WF and three PickBranch. The trigger for every PickBranch is a Recive Activity. In my "Action" body i have some activities and, next, a Response Activity. So, when i revice a request from client, one of the trigger go on. That's ok. But how can i make the three Revice parallel? Normally when i had called Operation1, next call to Operation2 or Operation3 are serialized and served after the PickBranch of Operation1 is completed (because i have a While->True loop). But i would a way to start Operation2 and Operation3 (for example) in parallael, when, for example, Operation 1 is in exection. The Parallel Activity is not good for my scenario because i don't would made the calls for all Recive to complete the "Parallel".   Can anyone help me? Thanks

How to execute a set of steps N time, in parallel?

I have a custom workflow activity that creates "tasks" for users to do.  Tasks are shown to a specified user when they log in to the web site.  When this step runs, it takes in a userId, creates a task in the database for that user, and then sets a bookmark.   When the user goes to the web site, they see their tasks.  When they push a button to complete a task, the bookmark is resumed and the step ends.   So far so good.  The problem is that the design now calls for the workflow to be able to kick off multiple tasks for multiple users, and that all the tasks be started at once (that is, its not good enough for user #1 to receive a task, complete it, user #2 receive a task, complete it, etc.  All the users should receive their task to start with, and then they can finish them in any order.)   I can't do this serial with a for loop, since then there'd only be one task "outstanding" at a time, and they'd have to be completed in order.  I can't simply modify the custom activity to take in the multiple pieces of data, because there's a lot of other items that happen in the workflow that need to be done before and after the custom activity for each task.  What I'd really like is something like the Parallel activity, where I create the branch and place all the tasks, but then I can assign the number of times

How to delay the close() in client

HI,        I'm writing a WCF using wsDualHttpBinding as binding property, in my client side i specified the closeTimeout as 00:00:00, it throws the timout exception, when i closed the channel, using close() in client side code.   However, if i specify the closeTimeout  as 00:00:01, it will finish the close of channel, within 1 second. But for 0.01, 0.1 second it cannot able to close, now i want to specify a 30 second closeTimeout, and in the code behind i want to make the close to take more time to finish closing the channel. How can i make the close() to wait,   any idea,

Invoke Delay Activity multiple times

HI! I am using Workflow Foundation workflows with sharepoint lists. I have a state machine workflow. One state of workflow has 2 event driven activities, one is waiting for task change and other is waiting for delay of 1 day. What i need is to send email if delay of 1 day is elapsed and send this email every day. But Delay activity is invoked only once. How can i change it so that it can be invoked multiple times. Shabih

Delay in Sequence Problem??????

I have a Approval work flow..What i am doing is,if the approver doesn't review with in a certain time-period the task will be send to another person in the company.... I did this by using Sharepoint List ..and i am using Listen Activity ... Inside the Listen Activity i am using HandleExternalEventActivity and Delayas Parellel Activity... But it does'nt work...I dont know how to extend it... I refers many article...most of them said there is an issue in delay activity...i got conduced ..is that problem fixed or not ? pls guide me... Thanks ________________________ arWINdh

Parallel foreach c# 4.0

Dear all, I have in a datatable (dt ) some informations  that I have to match with another datatable (dsSparato.Tables["riscontro"]) . Then I wrote the piece of code below   /* CODE */  foreach (DataRow rowspar in dsSparato.Tables["riscontro"].Rows)                 {                                                             var selectedRows = from r in dt.AsEnumerable()                                        where r["barcode"].ToString().Trim().Equals(rowspar["barcode"].ToString().Trim()) && r["codicearticolo"].ToString().IndexOf("ZCOL") == -1                                   &nbs
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