Thursday, 19 September 2013

correlation tokens in SharePoint workflow

Correlation Token:
  • Is way to group together a set of related activity.
  • worflowTokem - created by default in workflows used to group together the whole workflow.
  • Is a unique identifier that enables mapping between the objects in a workflow and the environment that is hosting the Windows Workflow Foundation (WF) workflow runtime.
  • It can be referred for uniquely identifying each instance of a workflow, modification or task.  When SharePoint initiates a workflow, it does not have a unique set of objects. Instead, if one instance of the workflow is already running when the second initiates, the second will reuse objects from the first.
  • Correlation token properties ensure that the single activity object is operating on the correct workflow instance and accessing the correct details about the workflow.

You will have a separate correlation token for the each of the following:

  • The workflow itself.
  • Each task you need to reference in the workflow

Declare the correlation token for the workflow in the OnWorkflowActivated activity. Then, for each activity that affects the entire workflow, bind that activity’s correlation token to the correlation token of the OnWorkflowActivated activity.

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Thanks Leslie...I've started adding post to my blog again..keep visting...

    ReplyDelete