.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

Parallel tasks assigned, cancel one based on response from other?

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :SharePoint

I am setting up a task process where a request is submitted to an approver.  Once approved the accounting dept is assigned a task.  In situations where the dollar amount is low enough, I want approver and  accounting to get the task at the same time so accounting can start the ball rolling.  I have successfully set this up by assiging tasks in parallel.  What I want to do is that if the approver then rejects the task, i want accounting to get a notice to cancel the accounting task and delete any work they've started.

I can get it to work, but it is dependent on both the approval task and the accounting task being finished.  When the approver task is rejected, nothing happens until the accounting task in the same parallel block is completed.  As soon as I mark that as completed, I immediately get the message to cancel.  I would like accounting to get a message to cancel as soon as the approver rejects, regardless if accounting has started or not.

It seems to get the task issued simultaneously I need the parallel, but I can't evaluate and use the approver response until everything in the parallel block is done.  Any ideas on how I could do this?

Using SPD 2010.

View Complete Post

More Related Resource Links

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

To-Do tasks not starting when being assigned from another workflow.


Hi all,

I'm new to doing workflows and i have created a rather straight forward one to manage a leave calander list (Custom List) in SharePoint Designer. 

Here is a baisc overview of the workflow,

  1. User Submits Request -> Gets Email Notification -> Approvers Recieve Email Notification and Assigned TO-DO task
  2. If( leave is approved)-> {conf email to user and email to HR to inform them} else if (rejected) -> {conf email to user}

However the issue that i am having is that the work flow with automatically fire until the TO-DO task which will sit "not started" in thee workflow task list until it is completed manually. When the rest of the work flow will continue along happily.

My question is do i need to run another workflow on the workflow task list or is there a way to force a to-do task to auto complete?

Thanks in advance


Task-Based Programming: Scalable Multithreaded Programming with Tasks


Getting the most out of multicore systems means diving head-first into multithreaded programming. Ron Fosner follows up on his previous article by introducing you to a more sophisticated multithreading technique called task-based programming.

Ron Fosner

MSDN Magazine November 2010

How to get ListItemId for Tasks when using ReplicatorActivity in Parallel mode


I'm creating a sequential workflow where I'm using ReplicatorActivity > SequentialActivity > CreateTask > SendEmailToNotifyAboutTask > ConditionActivityGroup.

Inside CAG I've OnTaskChanged and one Code activity.

I'm using ReplicatorActivity in Parallel mode. Based on initial data, it creates as many tasks parallel. Now I've to send email to all those users with the link of TaskEditForm. For that, I need task Id which I'm not getting for each task. I'm getting the latest task's ID from "ListItemId" property of CreateTask action. I tried several ways e.g. inside the method of SendEmail code activity, I accessed CreateTask action and tried to access CreateTask.ListItemId property, but it's also giving ID of latest task.

If anybody has solution of this problem, please let me know.

All I want is to send users link of Task Edit Form of their tasks so that they can directly come to the Edit Form and select status and complete the task. Any solution in this regard will be appreciated.

Thanks in advance!

Connect to Outlook a Task list that has Tasks with Multiple users assigned


Using MOSS 2007 SP2 and Outlook 2007 SP2 

I go to a task list that has multiple users assigned to a task.

I setup the connect to outlook for this list, and in outlook I only see the tasks that have a single user assigned.

None of the multiple user assigned tasks are visable, is this how it is supposed to work?



SharePoint Foundation - Workflow user has tasks assigned then leaves the company - How to assign to


Hi all,

if a user leaves the company and has workflow tasks pending whats the best practice for assigning them to another user without terminating the workflow.

I have tried renaming the account which allows the user to continue even though the tasks still display the original username.

I guess there are a couple of questions that arise from this.

1. Using SharePoint 2010 Foundation the SharePoint user accounts don't seem to re-sync automatically with AD after a rename, so how can this be done?

2. If we decide to create a new user, how do we assign the new user account to replace the leaver in the workflow without disrupting the flow?

Thanks for any help, can't find anything on the web about this.


Dialogs and ViewModel - Using Tasks as a Pattern

The ViewModel/MVVM pattern continues to gain popularity, with a blog post showing up every so often, and with tweets and retweets popping up even more often :-). At the same time, there are some interesting topics beyond the core pattern that continue to fuel experimentation. A big one amongst those is how should applications use dialogs when using the view model pattern.

The crux of the problem is the desire to keep the view model independent of UI concerns, and ensure it can be tested in a standalone manner, but that often comes to odds when you want the view model to launch a dialog, and/or do some work after the dialog is closed.

ASP.Net Gridview Edit Update Cancel Commands

In ASP.Net 2.0, GridView Control also provides the functionality to edit and update the data retrieved from the database using CommandField template. You can cancel the action using Cancel Command of the CommandField. GridView consists of events that can be used to perform the actions like edit, update and cancel upon the Data items displayed in the ASP.Net GridView Data Control.

5 GridView Themes Based on Google's Personalized Homepage (igoogle)

One of the silly features I have found that I like about igoogle is how the pages color palette changes depending upon the time of day. So as the day progresses from morning to afternoon to evening the colors on the page change as well. Like I said, I know this is a silly feature, but I like it. And I have asked around a little bit and seems like other people like it to. To get a better idea of how the colors change, here are the background images from a few of the HTML elements.

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

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


dynamically adding sql server columns based on number of files in fileuploader


I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.


I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!


Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")


Unique content within master page based on conditions met


 Hi all-

I would like to present users with unique content based on certain conditions being met as they land on the home page (default.aspx).  The condition logic will be in the VB code behind Page Load event. The content will go in a content placeholder as specificed from the master page. 

However, the content change wouldn't be something small (ie making a panel or label visible or not) but rather it will be different HTML,  Divs and databound gridview content.  The HTML content will be stored in the database.

Can someone point me in the right direction for best practices on how to accomplish this?


Response.BinaryWrite help needed


Hi all

Im new to .NET and stuck now, so i hope anyone can help my with my problem.

I have a MS SQL database where i have stored some documents as Binary data. I cant figure out how to retrieve them and show/download them in my browser.

I found some guides online and have try to put something together.


private void Write()
 int id = 0;
 string strID = Request.QueryString["id"];
 int.TryParse(strID, out id);

 var db = new ModelDataContext();
 var doc = db.DocumentDatas.Where(x => x.ID == id).FirstOrDefault();

 byte[] byteArray = File.ReadAllBytes(doc);


How do i fill the byteArray with the data?

Thanks in advance :)


Response.Redirect slow


I'm in the middle of migrating servers and on the new server Response.Redirect is extremely slow. It takes around 20 seconds for the browser to get the redirect. This is something that was quick on the existing server. It's an ASP.NET 2.0 application, both servers are running IIS6.

Additionally, if I "manually" do the redirect, it's fast. For example:

Existing way:


takes around 20 seconds on the new server

New way:

Response.Status = "302 Moved Temporarily";
Response.AddHeader("Location", url);

is fast on the new server.

Any ideas why Response.Redirect would be so slow on the new server?

Problem making Role based Menu in MVC application



 I want to make Rolebase menu in MVC such that if user doesnot have permission for some action then that Action name shouldnot be shown in the Menu.

 I have used the code in the url(http://forums.asp.net/t/1566328.aspx) in my MVC application.My application is a Discussion Forum(in MVC) same functionality as in this forum forums.asp.net

 I have used Controllers for post, thread etc.In each controller there are some actions that are using [Authorize(Roles)] attribute

 but this coding does not count  those Actions in Controllers having Authorize attribute according to the url http://forums.asp.net/t/1566328.aspx 

 In the code, Authorize attribute is applied to Controller class, but my requirement is of Applying Authorize attribute to some actions in controller so that some are available for all users and  some links are available rolewise.Now what is the solution for that?



replacing ok and cancel button of an alert message with YES an NO button in asp.net web application.


i want to replace ok and cancel button of an alert message with YES an NO button in asp.net web application.When a user will click yes the data will be saved in the database and if user clicks that will act as a reset button and do not save the data in database and the control will move with as usual to the redirect page.Any pointers will be highly appreciated.I am usin g C# language.

How to get data from table based on four table



I need to know how to show top 30 records from four table

with fastest speed.. in ms sql server 2005..

hope You do the needfull


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