Saturday, December 16, 2006

Custom Workflow using SharePoint Designer 2007

I could not find a simple descriptive article on creating workflow using sharepoint designer so here it goes if you are looking out for one . The custom workflow is one level but using designer life is so simple that adding multiple level is matter of "kind of duplicating" the steps .You can also view the same document at url http://docs.google.com/View?docid=dgqwf6bx_20c5ghkm and save as .mht for offline reading.

Scenario

  • Author creates document and submits the approval request to the

  • Reviewer approves/rejects the document.

    • In case of approval email is sent to author notifying approval

    • In case of rejection email is sent to author notifying rejection

Implementation :


  • Create an sharepoint list with approval enabled

  • Open sharepoint designer 2007

  • Open the desired site for workflow as shown below :

    • Click File ->Open Site

    • Enter the url of the desired site in site name section and press “Open”


    • This will open the site

  • Creating new workflow

    • Click File -> New

    • The “New “ Dialog box will pop up

    • Select “SharePoint Content” tab

    • Select workflow from the list box “Blank workflow”


    • Assign appropriate name to workflow in my case its “Approval workflow”

    • Select the list in sharepoint list to which this workflow should be associated

    • Select the start condition of the workflow

      • Start when item is created

      • Start when iten is changed

      • Manual workflow start up


    • Before we start we will go forward and define some initiation workflow variables .

    • Click on the initiation button

      • Define a variable named “workflowstatus” and set the default value as “notstarted”


1 STEP 1


  • Lets start defining the workflow

    • First define a step name “To Approver”

    • Click conditions button and you will get an drop down


    • Select “Compare any data source” you will get option as shown in figure

    • click on the “value” you will get an input box with an eclipse button like this


    • Click on that “fx” eclipse button

    • You will get dialog box like this with “current item” as default selection

    • change the selection to”Source: workflow data” and in the field section select :Initiation :workflowstatus”


    • Click Ok

    • Now select the “value” field after “equal “ and in the input box fill “notstarted”

    • No we are ready with our condition with says “ If “workflowstatus” variable is equal to “notstarted” then execute the defined action

    • Lets Go forward and put process in our action section

    • select “Set workflow variable”

    • Set the values as shown in fig below

    • Now we have set the workflow variable” workflowstatus”to started

    • Lets send E-Mail to the Reviewer for approval request

    • From the actions Menu select send an EMAIL

      • click on “this message” which will eventually pop up a self descriptive dialog box

      • Fill all the appropriate fields for EMAIL and Email is set

        • To : “Reviewer Email ID”

        • Subject

        • Body

    • After email to reviewer we have to make sure that our workflow waits for “Approval/Rejection ” from the Reviewer

    • In order to achieve a “WAIT” we have to add one more action

      • So click on the actions and select “Wait for field change in current item”

      • Assign values and make condition as shown below

Ie Wait till the “Approval status “ is not either “Approved/Rejected”

  • We are done with our first step where the author has requested an approval and reviewer has received mail of approval request


2 STEP 2



    • In this step we have to take care of 2 conditions “Approved /Rejected “

    • To define seconf step click “Add workflow step “on eight pane of workflow designer

    • The Second step would look like this

    • So define 2 conditions “If approved “ and If Reject “

    • The branching of condition can be achieved using the drop down of activity

    • This will take care of the second step

    • Once the email is send stop the workflow by selecting “stop workflow” from the Action menu , this make stop the workflow and make the workflow status to complete


NOTE: Always make sure to stop workflow in all the implementation, in case its missed the workflow will still be alive in the system and that might lead to server performance degradation




9 comments:

Anonymous said...

PLZ help. I want to create a counter wich counts how many times a document has been opened...Im wery new in Sharepoint plz help: tintasbarnes@gmail.com thnx....

Aleem said...

Good post, but the most picture is not shown full, which is the last in Step 1. I couldn't figure out what value you set in the wait actions against 'Approval Status'.
Regards
Aleem

Raghu Iyer said...

@Aleem ,

I have set the last approval status to pending.You can access these images using the given link in post for better image quality.

http://docs.google.com/View?docid=dgqwf6bx_20c5ghkm

Anonymous said...

Thanks Raghu,
Sorry for the typo in my comments, I meant the most important picture wasn't shown full. It's now clear, you gave a very good description. Keep it up mate.

Daniel - SP Development said...

The article How to wait for a change in any list, wait for multiple field changes the current item provides a different take on waiting for field changes in the current item.

The article explains how to configure a workflow which uses Standard (OOB) workflow actions and is developed using SharePoint Designer. Instead of using the "Wait for field change in the current item" action, the components of the workflow which are completed after waiting is finished are added to a separate "On Change" workflow, which uses standard conditions in the first step to determine if it can continue. If the conditions are not met for the field in the current item, the workflow will stop. If another instance of the workflow is running, new instances will also stop by setting a "Workflow_running" field to yes while an instance is running.

Using this technique gives you more control when waiting for specific criteria to be met. This includes being able to wait until a field in another list item is updated, or waiting for multiple fields in the current item.

See How to wait for a change in any list, wait for multiple field changes the current item (SharePoint Workflow) for more details.

Custom Paper Writing said...

Many institutions limit access to their online information. Making this information available will be an asset to all.

Anonymous said...

didn't give email detail.
i didn't see anything better than the ssp one

Anonymous said...

thank u very much for the lovely post.i am a newbie n i couldnt find a better post than this. nicely compiled, very useful.thank u once again from d bottom of my heart.

Niyaz said...

HI Raghu

Awesome post.

After implemented the same I'm getting an issue related to the mails I'm getting two mails for every request. Not sure what went wrong. Please let me now if you have any idea

Thank in Advance