Writting a basic Workflow in SharePoint Server 2007
Maybe is a good time to start a new phase on my blogging experience. My friend Luis Du Solier MVP in SharePoint has a blog in English as well, so I think from now on I will write and share some information in English language. The reason is just for fun and just for share content about Microsoft technology with the entire world. I need to learn how to express myself in new ways and I think blogging it’s a great opportunity to do that.
Ok, let’s talk about the workflow capabilities of Microsoft Office SharePoint Server 2007.
First, let me tell you that a workflow it’s a concept for describing a set of steps and conditions that a certain process can have for ensure the accomplishment of several rules that are enforce in any aspect of a business.
In Microsoft Office SharePoint Server 2007 a.k.a MOSS 2007 we can enable workflow scenarios for automate a business process. In this post I will create a very basic workflow and share how can you use the Microsoft Office SharePoint Designer 2007 to create a custom workflow.
As a developer you write workflows in your apps. If you take the time to see your code, you will find from an overall perspective a workflow existing in your application that represents the business rules that you need to enforce in order to stream line a business process. Microsoft in the new version of the .NET Framework called .NET Framework 3.0, has integrated a full workflow engine that developer can use to understand and represent business process or program flow. MOSS 2007 uses Workflow Foundation from the Microsoft .NET Framework 3.0 to enable rich and extensible Workflow scenarios applied to the collaboration space.
Crescencio Estrada owner of Mexican Curios Shop needs to be aware of some of the most expensive artisanal items that he sells and also buy from local artisans. He has several people doing this job, but, for really expensive items he needs to approve the purchase. To do so, he wants to see some relevant information about the item and most important, the cost and base on that he approve or deny the purchase.
As you can see, we have too special items in the Document Library and also we have a cost column. This document library has enable the content approval feature. We will use SharePoint Designer 2007 Beta to enable a very basic workflow that has the following condition:
If the Cost is less than $1, 000 then they are approve
If the Cost is greater than $1, 000 then needs to be approve
Open the Microsoft Office SharePoint Designer 2007 Beta
Select File – Open Web Site and type the Web Site Url.
Now SharePoint Designer loads the site structure.
Select File – New
Select the SharePoint Content Tab and select Workflow from the category list
Select the Blank Workflow Template and click Ok
SharePoint Designer 2007 will load a new windows called Workflow Designer.
In the Workflow Designer we can give a name for our workflow and select on which component of our site we want to enable this custom workflow. And also, we can define some of the start options for our workflow.
There are some useful command button we can use to enable variables and initialization parameters for our workflow. But we only are going to click Next.
Now we will design the steps of our workflow, we have two options Condition and Actions.
When we click the Condition button several options are displayed:
This condition can help us to evaluate any value or state of each document that is in Special Items document library. We will select Custom Condition (Special Items).
In the field link we are going to select the Cost field that we have in the Special Items Document Library.
Then select the equals link to chose the condition.
Now type the value we define for this condition.
Ok, now we have a condition configured and it’s time to set the action that will fire when this condition it’s true. There are some available actions when a condition occurs.
In this case we will define a Set Moderation Status action allowing us to select the approve, pending or denied status for our document base on the condition previously evaluated. Because the cost of our Special Item is less than 1000 we will select Approved and define some comment.
There is a link called Add “Else If” Condition Branch so we can still evaluate other values. So click this link to create another branch. And select the same condition (Custom Condition) but whit the Is greater than condition criteria.
We also can define more actions for the same condition. In this case I will send a email to Mr. Crescencio Estrada.
Then, just click the Finish button. And the Workflow designer will compile and save this workflow.
Upload some document to our Special Items Document Library don’t forget to specify a cost lower than 1000 a greater than 1000. You will see that the status column is Pending or Approved base on the condition.
Well, in this basic post we see how can define a custom workflow for a Document Library in MOSS 2007.