Last month we saw how to create simple and complex forms in MS Outlook that could be used to gather information in a particular way from other users. You could create a Public folder on Exchange that would use a particular type of form whenever someone tried to post to that folder so that the data collected is in a consistent format. If you had a folder called “Leave Applications”, the form you create could be containing the start and end dates for the leave, the reason for the leave etc. However, what we looked at last month was just the data collection part–not the data collation part.
We’ll take you through the concepts you need to know and tools you can use to create complete workflow applications using Exchange. Unlike previous articles we will not be build a complete application here. Instead, I’ll try to walk you through the process of creating such a workflow application.
The Workflow Designer lets you create states and transition for your workflow applications |
Workflow Designer
The first thing you need to do to create Workflow apps is to get the MS Exchange Workflow Designer (EWFD). This is one of the most important tools you will need in creating the workflow. Part of the MS Office Developer Suite, this tool can be downloaded for free from the Download section in the Exchange site at Microsoft. Once you download it, extract and install the tool either on the server itself or on a client machine that can connect to the Exchange Server.
The next important step to do is to enable scripting and permissions on the Exchange server. For this first go to the Exchange server and open up the Exchange System Manager and go to Servers> (Server Name)>Protocols> HTTP> Exchange Virtual Server> Public. Go to the Access tab in the properties of this folder and select “Scripts” under “Execute Permissions”.
Next, open Start>Compo-nent Services>Computers>My Computer>COM+Applications> Workflow Event Sink>Roles on the server. Add your login to both the “Can Register Workflow” and “Privileged Workflow Authors” roles. Both these steps are detailed in the installation of the EWFD, but many skip over this step. This can cause a lot of headaches in getting the workflow to work
properly!
Once you have completed the steps above, you are almost ready to start creating workflows. Just one more step needs to be completed–creating a public folder for hosting the application. You can use either MS Outlook or Internet Explorer with the Outlook Web Access (OWA) to create the folder. This action sets you as the owner of that folder and gives you workflow creation rights as well.
Now that the Exchange server is ready for use, you need to plan out how your work is going to flow in this folder. Say, you are creating a folder that performs a simple tool for Expense tracking. All that a user has to do to submit his official expenses is to post a message in this folder. As soon as he does that, the form that is displayed will allow him to enter total expenses for different heads for a particular month and year. When posting, this information goes to a database or spreadsheet as well as get mailed to the accounts department.
Compose form
Once you have worked out all the details required, design a Compose form in Outlook for the post. Last month’s article described how to do this. Once the form is created, publish it to the Exchange public folder you created earlier. Close the form design and then right-click the folder in Outlook, select properties and choose the name the form you published in the “When posting to this folder, use” field. Test the form by using the New post button in Outlook. Instead of the normal mail form, you should see your newly created form instead.
Multiple Form workflow
You can create multiple form workflows in Exchange too. For example in the sample we are talking about, you could have the accounts department maintain a “approved/not approved” list that automatically mails the user with the status of his reimbursements based on his expense report submission being accepted or rejected by the accounts. However this case is much more complex than what can be talked about here and is left as an exercise for the reader.
To create the workflow in Exchange, open the EWFD and create a new project. You must enter the name of the Public folder to which this is associated by giving a URL of the form http://
1. Create States: These are each “level” in a workflow that the process can achieve — for instance, “Submitted”, “Approved”, “Saved”, “Rejected”, etc.
2. Create Transitions: These are the “events” that transform one state to the other. For example, the event “Approve” can transform the state “Submitted” to the state “Approved”.
You can associate scripts for states, state events and transitions. You have access to the Outlook forms object model, Exchange server object model, as well as all the scripting object models for VBA and VBScript. Simply double click the state or transition, select the event and start coding. If you have worked with Visual Studio, the interface will be extremely familiar to you.
Once you have created the appropriate scripts and saved them you can test it out by posting a new message in the public folder. Remember, that you can actually collect the value in each field of the form and can use objects like ADO to connect to databases and store and collate the values.
Workflow using Exchange is a complex but highly effective method of creating a process driven intranet for your users. A lot of the tasks are automated and you needn’t spend time in coding them. Understanding the Exhange and Outlook object models is the key to developing a powerful but simple to use Exchange Workflow.
Vinod Unny is a Technology Consultant at Enterprise InfoTech