Monday, March 12, 2007

SharePoint 2007 workflow - AssociateonActivation

Some of you might have seen the AssociateOnActivation element in the workflow.xml (see example below) when building a SharePoint workflow in Visual Studio 2005 with the last build of the ECM Starter Kit and might be wondering what it is good for. Here's the explanation:

The value for AssociateOnActivation value will be false for most workflows but its value is set to true for the out-of-the-box document approval and collect feedback workflows. You probably noticed that these two workflows are available for all items in a SharePoint document library, although they are not in the list of workflow associations of the document library. This is because these workflows are associated to the document content type. So if you want to make your custom workflow automatically available on any item of the Document content type, just add <AssociateOnActivation> to true.

<Elements xmlns="">
Name="Expense Report workflow"
Description="This workflow is used to approve expense reports"
CodeBesideAssembly="ExpenseWorkflow, Version=, Culture=neutral, PublicKeyToken=70c99ed3a3700cf4"
<!-- Tags to specify InfoPath forms for the workflow; delete tags for forms that you do not have -->
<Task0_FormURN>urn:schemas-microsoft-com:office:infopath:ExpenseTaskForm:-myXSD-2007-02-24T15-08-38</Task0_FormURN>                                                     <AssociateOnActivation>false</AssociateOnActivation>

You should check out the upcoming SharePoint 2007 MVP book for more goodies such as this one.


1 comment:

(MSDN-Blog) wael said...

Thanx man thas really usefull..