locked
Task reassignments using UpdateTask Activity RRS feed

  • Question

  • Hello,

    I'm trying to reassign the task by using UpdateTask activity after OnTaskChanged activity and it works, BUT MOSS shows me the error page with "Task update was not accepted." error message. Anyone have some ideas, maybe there is a better way of task reassignment ? Several days of googling have brought no results and if you could send me a working example you would save my life (mssemyonov_amp_yahoo.com).

    P.S.

    If I'm changing my workflow so that UpdateTask activity is running after OnWorkflowItemChanged everything works fine without errors, I think there is something wrong with OnTaskChanged - UpdateTask combination.

    Tuesday, April 10, 2007 3:45 PM

Answers

  • Thanks, God,... I found!!!

    The cause of the problem was the sharing of the same SPWorkflowTaskProperties field between OnTaskChanged.AfterProperties and UpdateTask.TaskProperties, just bind them to the different fields and manually copy the information between them.

    Tuesday, April 17, 2007 4:04 AM

All replies

  • Try to change the assignee in afterTaskProps in OnTaskChanged event.
    Wednesday, April 11, 2007 3:39 PM
  • You can't change the task properties in the onTaskChanged activity, you can just monitor modifications that you've made through the task form or by using UpdateTask activity.


    I think in the state machine workflow it's possible to enter in the endless cycle when  in some state you have a loop that begins with OnTaskChanged and ends with UpdateTask activity... any way I've checked there is the same problem (see 1-st. post) in the sequential workflow.

    Wednesday, April 11, 2007 4:31 PM
  • You are right about not being able to change task properties. Though MSDN doc says: Gets or sets an SPWorkflowTaskProperties object that contains the current task property values for any properties that were updated. In code you can set the AfterProperties but it doesn't do anything.

    I guess in your scenario you need to use state workflow so that when an assignee reassigns the task to another, his task is closed and a new task is generated for the new assignee.

    Wednesday, April 11, 2007 7:51 PM
  • Thanks, God,... I found!!!

    The cause of the problem was the sharing of the same SPWorkflowTaskProperties field between OnTaskChanged.AfterProperties and UpdateTask.TaskProperties, just bind them to the different fields and manually copy the information between them.

    Tuesday, April 17, 2007 4:04 AM
  • Sorry could you explain in a bit more detail what your solution was pls? When you say 'fields' does that mean you created a new 'SPWorkflowTaskProperties' variable and assigned the taskproperties property to this in the designer; and in the update event used this variable to populate the 'AssignedTo' property?  
    Tuesday, April 17, 2007 12:41 PM
  • Bless... it works, thanks!
    Tuesday, April 17, 2007 12:57 PM
  •  int itemId = this.firstTask_AfterProperties.TaskItemId;
     updateTaskfirstTask_TaskProperties.TaskItemId = itemId;
     updateTaskfirstTask_TaskProperties.AssignedTo = firstTask_AfterProperties.ExtendedProperties["Field"].ToString();
    This was the code I have written in Update Task Activity.

    I had spent lot of time for this. Thanks Maxim4 for the answer.

    Pradeep
    Thursday, January 7, 2010 6:47 PM
  • Hi All,

    I seem to have a peculiar issue. I use "Form A.xsn" to kick-off the workflow (published to a form library). I have made copies of "Form A.xsn" such as "Form_A_Task.xsn" to be used as custom task edit forms (these forms contain ItemMetadata.xml file as secondary dataconnection). On the Createtask I am able to see the the data passed from "Form A" that the end user might have used to kick off the workflow. However, The reviewer when he ammends any data field values on the task form "Form_A_Task.xsn", I am not able to see those updated values in onTaskChanged activity using onTaskChanged.AfterProperties.ExtendedProperties["<FieldName>"].ToString();

     

    Could anyone please help me out with this one. 

     

    Thanks & Regards,

    Anand
    Wednesday, October 20, 2010 2:04 PM
  • Hi Pradeep KVD or Maxim4

        I'm having a similiar issue.  I get the exact same error message when a user updates a task but where my issue differs is that I'm not using an update task activity.  All the updates are taken place in the chagne task activity.  After reading the thread I'm thinking about adding an update task activity after the change task activity.  can you explain what do you mean when you said not to use the after task properties from the change task activity.  Do you mean to go and fetch the task from the list and update it thereafter? 

    Sterling


    Wednesday, September 19, 2012 7:09 PM