Sladescross's Blog

Blogging about Sharepoint related stuff

SharePoint Designer for Parent Child Workflows June 13, 2012

Filed under: Association Column,Child,Parent,Workflow — sladescross @ 4:45 pm

http://sharepoint.stackexchange.com/questions/15620/how-to-start-a-child-workflow

Association Column

SharePoint Designer workflows do not natively have any way to launch another workflow, but there are ways to accomplish this.

  • Configure the secondary/child workflow to start “On Change”
  • Create a site column that will be used as control field between the parent/child
  • Add the site column as an Association Column on both workflows so they can see it
  • Have the parent workflow set the control field with a status value (e.g. “Start”)
  • Have the child workflow read the status to know it should fire. When done, have it update the status (e.g. “Complete”)

It is possible that other native fields (e.g. an existing status column) could be used instead of a control field, but I like using a specific control field to communicate between the parent and the child.

If you need the parent workflow to wait for the child, add a “Wait for …” activity to wait for the control field to be set to “Complete”.

If you need to pass additional state between the workflows you can either add additional association columns, or use a secondary list.

http://blogs.msdn.com/b/sharepointdesigner/archive/2011/05/02/association-columns.aspx

To warm this site up (and also warm my team up for upcoming posts), let’s start with a small but very useful feature new in SharePoint Designer 2010 (aka. SPD).

When do we need association columns

Let’s first start off by setting a scenario. You are a workflow author who is used to using SPD and you are required to make a workflow that should be used in many lists or document libraries with some workflow-specific fields. How do you implement it? Here are some examples of choices you might try to achieve this goal.

· List workflow

o You can start from list workflows. You will add the workflow specific fields to the list directly. And during design time in SharePoint Designer, you can see the fields and create your workflow logic using those fields.

o But when it comes to reusing this workflow in other lists or doc libraries, you don’t have good answer for it.

Reusable workflow with association column

o You are almost as familiar with SPD as the one who knows base content type concept. So you know the concept of association column.

o As you start authoring the workflow, when you need a field, you just create it right away with association columns, where you can choose between an existing site column and a new one. You don’t go back-and-forth all the way among workflow designer, site content type, and site column UIs. You can do everything in one place and that’s it.

o In addition, there is no issue with reuse because reusable workflow definitions carry the fields with it and workflow package supports it.

 

 

 

 

 

 

About these ads
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 63 other followers