Recently I created parallel task approval workflow and I needed to use the onTaskCreated activity. Till that my workflow worked fine and since I added this activity to the project the workflow stopped working properly. I search for the solution on the Internet and it turns out that this is Microsoft bug and it seems to be permanent. More about it you can read here: http://support.microsoft.com/kb/970548
There are two ways how to achieve the same functionality.
First one is to create event receiver in the task list. Second one is to add Delay activity after CreateTask activity and then perform some code(Delay activity ensure that task will be created and you can work with them then).
I used event receiver to substitute the onTaskCreated activity. How I did it you can look here on my blog: http://david-row.blogspot.com/2011/09/how-to-create-workflow-history-event.html
Anyway even that Microsoft offers workaround, it will cause more work than just drag and drop activity to your workflow. Also you have divided one project to the two and sometime it can be really bothering to make some changes in them.
I also tried second way with Delay activity but it doesn't seems to be good solution. As I wrote above I was creating parallel task approval process and problem was that somebody could approve task when Delay activity was still running. This cause that approval this task was not registered by workflow. So if I would be sure that nobody would approve task for example in first hour I could use this solution. Even you can set timer job of the workflow on 1 minute it still doesn't seems to be good solution to me.
This is just my opinion and you can also read more on this blog: http://www.elumenotion.com/Blog/Lists/Posts/Post.aspx?ID=69
Ok then, I hope this can help somebody to choose which way to substitute onTaskCreated activity. Both solutions have their pros and cons... Maybe Microsoft will solve some bugs in next version of SharePoint :)
No comments:
Post a Comment