Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have an InfoPath document which submits to a SharePoint library. Once a new item is submitted, I am wanting to create tasks based on data in the filled out form.
For example, a user is able to request a variable number of items via the form (repeating table). I would like to create and monitor a task for each item requested. I am using visual studio 2010 and a state machine workflow. I have attempted to invoke child-workflows on each requested item with little success, as the parent workflow errors when creating multiple children workflows.

What is the best way to create a dynamic number of tasks and monitor them until completion?

share|improve this question
    
I have no issues querying data from the submitted form, this question is completely focused on creating a unknown number of tasks and monitoring each in parallel until they are all completed –  user2419 Feb 15 '11 at 19:31

2 Answers 2

Can you monitor it via some Event Handler and keep track of the modifications of each tasks?

share|improve this answer

I agree with Sebastien, let an ItemEventReceiver (itemAdded) or workflow create the tasks for you, preferably a custom task contenttype, which includes a column that stores the InfoPath Item's ID (so you can easily trackback / query for tasks related to a specific infopath form).

Then, to check if all tasks have completed, have an event receiver (ItemUpdated) bound to your custom task contenttype check for completion:

  • query for all item with contenttype == custom task contenttype AND with the same InfoPath id AND which have status != Complete
  • if query count > 0, not all tasks are done, so do nothing
  • if count == 0, notify InfoPath item / form owner, etc.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.