.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> SharePoint >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Real World Workflow Scenario with 2 Contracts in SharePoint

Posted By:Jean Paul       Posted Date: August 30, 2014    Points: 200    Category: SharePoint    URL: http://www.dotnetspark.com  

In this article we can go through a real world scenario involving signing, emailing, converting, content types and workflow.
 

In this article we can go through a real world scenario involving signing, emailing, converting, content types & workflow.

Scenario

We have 2 types of Contracts:

1. Standard Contract

2. Non-Standard Contract

Standard Contract is created by a user, signed by an Administrator and gets completed.

Non-Standard Contract is created by a user, approved by Accounting Department, and then converted to a Standard Contract and the Standard Contract procedure follows.

Solution Design

In the SharePoint terms, we can think of 2 Content Types:

1. Standard Contract

2. Non-Standard Contract

We need 2 site columns:

1. Document Status

2. Contract Status

We need a list to store the items.

1. Custom List as type & Attach File feature is enabled

2. Above 2 content types are associated

Additionally, we can have 2 workflows:

1. Standard Contract Workflow

2. Non-Standard Contract Workflow

Following would be the life cycle overview of a Standard Contract:

1. A user creates an item

2. Administrator signs the item

3. User gets notified

4. Workflow completes

Following would be the life cycle overview of a Non-Standard Contract:

1. A user creates an item

2. Accounting Department approves the item

a. A standard item is created

b. Standard workflow will continue

3. Accounting Department rejects the item

a. User gets notified

4. Workflow completes

Workflow 1

Following are the steps to implement the solution for Workflow 1: Standard Contract

Step 1 Create Content Types

Open Site > Site Settings > Site content types page.

Create the Standard Contract content type with following columns.

clip_image002

Create the Non-Standard Contract content type with following columns.

clip_image004

The site column Document Status is of type Choice with values:

· Unsigned

· Signed

The site column Contract Status is of type Choice with values:

· Submitted

· Approved

· Rejected

Step 2: Create the list

Create a new Custom List and name it as Contracts. Open the List Settings > Advanced Settings > Enable management of content types. From the List Settings add the above 2 content types to it.

clip_image006

Step 3: Create Workflows

Run SharePoint Designer 2010 & Open our site. Click the Workflow pane on the left.

clip_image008

Click on the Reusable Workflow button from the toolbar.

clip_image010

Here we are creating a reusable workflow for the Standard Contract content type. Enter the name of workflow in the appearing dialog box & choose the appropriate content type.

clip_image012

In the workflow designer, drag & drop the following condition & actions:

clip_image014

The steps say that:

1. If current item > Document Status property is equal to Not-Signed

a. Send an Email to Administrator

2. If current item > Document Status property equal to Signed

a. Send an Email to user who created the item

Save the Workflows & Publish it.

clip_image016

Step 4 Associating Workflows

Back inside SharePoint, open the List > List Settings > Workflow Settings

clip_image018

Select the Standard Contract and Standard Contract Workflow and enter a unique name as shown above.

Scrolling down, make sure you checked the following 2 check boxes for invoking workflow on item creation & updating.

clip_image020

Click the Ok button to save changes.

Step 5 Testing the workflow

Now create a new item of type Standard Contract in the list.

clip_image022

On saving the item, the workflow will be automatically started & the Administrator should receive an email. I am using SMTP4DEV tool for capturing emails generated from SharePoint.

clip_image024

The Administrator can modify the Document Status value to Signed & update the item.

clip_image026

Then the workflow will send an email to the item creator as shown below.

clip_image028

This confirms the Standard Contract workflow.

Workflow 2

Following are the steps to implement the solution for Workflow 2: Non-Standard Contract

Step 1 Create Content Types

We have already created the content types & site columns for this workflow.

Step 2: Create Workflow

Open SharePoint Designer 2010 > Workflow pane > New Reusable Workflow

Enter the workflow details as shown below.

clip_image030

Create the Conditions & Actions as shown below.

clip_image031

Please note that the second If statement is doing the following activities on Approval:

1. Send Email

2. Create a new item in Contracts list of type Ordinary Contract

clip_image033

Additionally, use the Add button to add a Document Status column & set to Not-Signed.

clip_image034

This action will make sure the new item will be having Not-Signed

 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend