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

We have a customer that will be creating many sites based on a site definition.

The sites include a list. We would like to connect a workflow to that list such that the workflow starts whenever a new item is added to the list.

We are using SharePoint Foundation 2010 and developing the workflow with Visual Studio 2010.

What is the best way of doing this?

share|improve this question
    
Do you want the workflow to be part of the site definition? What will the workflow be authored in SharePoint Designer or Visual Studio? –  Muhimbi Jun 28 '10 at 13:46
    
The workflow will be created in Visual Studio. It can be part of the site definition, all sites that use this list will have the same site definition- –  Shiraz Bhaiji Jun 28 '10 at 14:16
    
Did you ever find the answer (or workaround) to this that you can add below? –  Alex Angas Jun 6 '11 at 5:58
    
@Alex, we coded it in the feature receiver. In our case we needed to be carefull that the list that we were associating the workflow with had been created before we associated. –  Shiraz Bhaiji Jun 7 '11 at 13:12
add comment

1 Answer

up vote 2 down vote accepted

http://blog.brianfarnhill.com/2009/02/associating-workflows-programatically/

I have been working on a site that will be using some custom workflows ... I want to associate these workflows as part of the site creation process ... to do this I created a feature with a receiver class and used code to add the workflow.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.