views:

104

answers:

1

Hi Everybody,

I have written a custom workflow in visual studio 2010 with custom Task Edit Form which is associated with content type and that content type is in turn associated with Task List. When an item is created in the target list to which my custom workflow is attached, a task item is created when I click on that task item it loads the custom Task Edit Form page where I have defined the UI and on click of Approve button I just Alter the task by using method SPWorkflowTask.AlterTask(this._TaskListItem, taskHash, true); when this line executed it executes the Task Changed invoked method where I am taking true and false value from the UI and updates the corresponding metadata in target list.

The problem is when I create 2 target list items their workflow status becomes pending and when I approve one of them, both the items get approved i.e. Task Changed event get called 2 times and both line items workflow status become completed. The task list item corresponding to one approved get 100% completed but other one did not show its completion.

A: 

Are you using Parallel Replicator? If yes problem is likely in wrong usage of correlation tokens.

cement
I am not using any parallel replicator. It is a basic approval workflow with 4 main activities that are CreateTaskWithContentType, TaskCreated, TaskChanged inside while loop and TaskCompleted. All these activities contains a same correlation token.
Tejas
Do you have one workflow instance for two items? If yes - you need correlation token for each task in order to define which one got approve.
cement