Building a Leave Application Workflow System using BizTalk Server 2006 and SharePoint Server 2003
page 3 of 7
by Naveen Karamchetti
Average Rating: 
Views (Total / Last 10 Days): 41667/ 104

BizTalk Artifacts

A BizTalk solution generally consists of the following:

A Schema – LeaveApp.xsd

A Property Schema (For exposing the schema properties into an orchestration and ports.)

An Orchestration – RouteLeaveApplications.odx & ProcessLeaveApplications.odx

A Pipeline (optional)


The Leave Application Schema encapsulates all the relevant information required for leave processing.  Designing a schema is the first step in any BizTalk project.  Refer to the leave application schema in Figure 5.  The elements of the schema are self explanatory.

Figure 5


An Orchestration is essentially a Business Process.  In this example the Orchestration Workflow has been split into two parts.  The first part routes the Leave Application submitted by the employee to the manager.  The second part is responsible for picking up the APPROVED/REJECTED/TIMEDOUT leave requests and takes appropriate actions.

A message in an Orchestration binds to a schema, in this case the “LeaveApp” schema shown in the Figure 5.  There are two messages in the orchestration; one is an incoming message and another is the outgoing message.

The “RouteLeaveApplications” Orchestration performs the following:

The Orchestration picks up the Leave Request message from the SharePoint folder.

The message is validated against the number of leaves available from the Employee table.  In the case where no leaves are available an exception is raised by the stored procedure.  This exception is caught by the Orchestration and the message is sent back to the requested employee's folder.  Refer to the Figure 6.

Figure 6


The “ProcessLeaveApplications” Orchestration performs the following:

The BizTalk engine monitors the manager's folder in SharePoint then checks to see if the following conditions have occurred and picks up the message.

Leave Application message Status field set to either “APPROVED” or “REJECTED.”

Leave Application message Status field set to the default value, “REQUEST,” is unchanged after the elapsed timeout.

The message picked up in the previous step is routed to the manager’s boss, in this case to Jack for Approval.  In case Jack does not approve it and the elapsed timeout occurs, the message is again picked up and its status is set to “TIMEDOUT” and routed back to the employee who has raised this request, in this case it is “JOE.”  Refer to Figure 7.

Dynamic Ports

The BizTalk ports, which are used to interact with SharePoint, are Dynamic ports.  BizTalk can determine the destination folder, but only when it receives the Leave request message and retrieves the manager name of the employee.

Listing 1: TIMEDOUT message processing

LeaveAppOut = LeaveAppIn;
LeaveAppOut(LeaveWorkflowSystem.Status) ="TIMEDOUT";
LeaveAppOut(LeaveWorkflowSystem.Comments) ="Leave request timed out even after escalation.";
destinationFolder =LeaveAppIn(LeaveWorkflowSystem.EmpName);
"wss://win2k-2005-pc:80/sites/BizTalkDemos/"+ destinationFolder + ""

NOTE: The last line in the code specifies the destination of the message by the setting the value in the Dynamic port.  Do not worry about the SharePoint path hard coding, this can be moved into an environment variable.

Figure 7


View Entire Article

User Comments

Title: Cannot download Samples   
Name: Ash
Date: 2012-03-25 9:21:00 AM
I cannot download the samples, get 404 - File or directory not found error
Title: biztalk development   
Name: biztalk programmers india blog
Date: 2011-12-07 2:43:43 AM
Spot on with this write-up, I truly think this website needs much more consideration. I’ll probably be again to read much more, thanks for that info.
Title: doing MCA project on leave management using java   
Name: Ruchi
Date: 2010-09-24 1:23:06 AM
Can you provide sample of simple leave application without using sharepoint and infopath ?
Say for example Employee can raise a leave appliation through website and the leave application routed to manager for his approval. Manager login in site and check is workitems. He may approve or reject like.
It's simple and straightforward to understand
My email is
Title: good   
Name: vardhman
Date: 2010-05-29 5:13:45 AM
Title: Workflow   
Name: rajendra
Date: 2009-10-26 2:07:04 AM
Great one.
Title: Request for simple Leave Application Management System   
Name: Zanele
Date: 2009-05-08 9:07:50 AM
Could you please provide me with an up and running above mentioned system but not the executable because I need to view the databases as well as the coding. Thak you.

my email address:
Title: How to install in WSS 3.0   
Name: Jeff Cheung
Date: 2008-10-23 11:42:07 PM
May I know that how to install the download file in WSS 3.0?
Would you please send me a simple instruction for it? Thanks a lot.

My email address is :
Title: Request for simple leave application without using sharepoint.   
Name: kumaran
Date: 2008-10-01 1:33:48 AM
Can you provide sample of simple leave application without using sharepoint and infopath ?
Say for example Employee can raise a leave appliation through website and the leave application routed to manager for his approval. Manager login in site and check is workitems. He may approve or reject like.
It's simple and straightforward to understand.
Title: Nice but need Help   
Name: Arun
Date: 2008-09-01 1:24:20 AM
Nice Article. But my task is to develop the same within Sharepoint but not with BizTalk. Could you please guide me with this to develop the same simpler and easy in Sharepoint portal
My email id is:,
Title: Development of BizTalk application   
Name: Mike Wassermann
Date: 2008-08-01 4:26:14 PM
I need a little help with the Sharepoint side of the article, I don't have any experience with Sharepoint and don't understand how to configure the sharepoint stuff to get the BizTalk stuff to work. Any detail steps on setting up sharepoint to get the code to work will be helpful.

Title: Deployment of Biztalk application   
Name: Ranjeet
Date: 2008-05-12 10:55:07 AM
how can we coneect Biztalk application to C# application. please help me. i m new in biztalk server2006.

Thanks in aadvance
Title: simplified Sample Application in BizTalk Server 2006   
Name: Ranganath
Date: 2008-04-23 7:04:59 AM

This is the First Time i am learning the BizTalk server 2006.

I want simplified sample Application in it.

i.e. Step By Step
Title: Good Example   
Name: Guru Raam
Date: 2008-03-04 7:12:56 AM

I'm new to BizTalk, this example is very useful to me.

Title: Error   
Name: Nikunj R
Date: 2007-06-16 4:45:39 AM
After deployment i stuck with following error ,
event id:5753
when putting .xml file receive location i got the error:
The published message could not be routed because no subscribers were found. This error occurs if the subscribing orchestration or send port has not been enlisted, or if some of the message properties necessary for subscription evaluation have not been promoted. Please use the Biztalk Administration console to troubleshoot this failure.
My email id
Title: Regarding Leave Sample   
Name: Nikunj R
Date: 2007-06-16 3:21:52 AM
I am very impress with your comment, i wants to know how to set sharepoint connection in application
mi id:
Title: Help needed   
Name: Malathi
Date: 2007-03-24 12:31:56 AM
I am new to Biztalk and I tried to launch this leave work flow system, but not able to lauch successfully, Can you please help me to launch this? I restored the database, created the infopath template but not able to build and deploy the application. It would be nice if you give me the step by step instruction to launch this.

Thanks in Advance


Title: Implement Leave Request Case Study   
Name: Pouyan
Date: 2006-11-22 7:26:30 AM
Hopfully i could use this case study and after struglying a lot i could configuring and launch the system. Thank you very much to provide this title.
If any one faces a problem to use this sample i can share my experiences with him. Contact me by this E-Mail:
Title: Business process development stages   
Name: Jon
Date: 2006-11-07 9:58:03 AM
Very entertaining issue. I haven't heard of this one. It will be necessary to visit you on a thicket!
Title: Good work   
Name: Harry Tsavdaris
Date: 2006-11-04 5:59:05 PM
I am new in Biztalk and Sharepoint and you example is very useful.
Title: Need more details how to run the sample solution   
Name: Abhijit Mahato
Date: 2006-11-01 2:37:40 AM
This article is really very good. From last couple of months i was just searching any article about the integration of BizTalk and Share point server. Actually i am using BizTalk 2004 and Sqlserver 2000. Could you please provide me some more details about this, so that i can use it.

Thanks in advance
Abhijit Mahato
email :
Title: How to Deploy   
Name: Pouyan
Date: 2006-10-09 3:13:21 AM
I still try to use your sample. I am new in using Biztalk and visual stuadio 2005. Would you plesae provide me a little more detail document to deploy your sample on my computer? I have the following questions:
1-How can i edit the Sharepoit connection ?
2-How can i add the "DBLIB.EMPLOYEEUTIL" variable (When i start to Deploy i get SQL-Connection Error)
By the way i installed SQL-Server 2005 and Sharepoint and it seems there is no problem to use your sample.
Thanks a lot in advance.
Title: SQL-Server Problem   
Name: Pouyan
Date: 2006-10-07 7:47:40 AM
Dear Naveen Karamchetti,

I am very interested in to you your sample. Actually i am new in using BizTalk. My problem is to use SQL-Server with SP4 instead of SQL-Server 2005. Are there any way to use this sample by SQL-Server2000. I couldn't restor SQL-Server backup file.

All the best
Title: Workflow   
Name: Steven
Date: 2006-05-30 1:28:45 AM
Workflow using BizTalk has been explained very well in this article. Unfortunately BizTalk HWS for workflow is complicated to use, and hence this could be the best way.
Title: Good   
Name: Ram Potturi
Date: 2006-05-26 11:30:30 PM
Thank you very much for good article.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-05-18 9:42:16 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search