An event handler to start the Approval Workflow in MOSS 2007

>> Saturday, 30 June 2012

An event handler to start the Approval Workflow in MOSS 2007
The Approval Workflow is a workflow present in the default installation of Office SharePoint Server 2007. The inclusion of features such as workflow within sharepoint has certainly given a great new touch to the product and the resulting benefits can be truly useful. The workflow in question, in fact, offers advanced features with regard to the approval of a generic object, I say generic because the flow of approval may be linked both to the elements of a document library, which the elements of a simple list (as may be a schedule or list of news), and the modification of the contents of a content page (in SharePoint sites with the publishing feature activated.) These are the characteristics of the workflow:

* approval of the transactions are divided into task
* ability to manage the flow in parallel or in series mode
* rules for assigning tasks to individual users or user groups
* ability to delegate the execution of a task to another user (or group)
* ability to reassign a task to another user (or group)
* option to terminate the workflow first refusal (in multi-task)
* ability to update information on the state of the end of the workflow
* to add a voting system object
* option to terminate the workflow if the content object is changed

Given all these features, I would say that we can all agree that the approval system default Sharepoint Services is clearly outdated by the introduction of this workflow.
Reply With Quote
#2
Old 13-03-2011
Blazej's Avatar
Blazej Blazej is offline
Member

Join Date: May 2008
Posts: 863
Re: An event handler to start the Approval Workflow in MOSS 2007
To use it within a SharePoint list, you must not do is go on the list settings of the selected list, select the Workflow Settings and choose the process of adding a new workflow. Here you will see a page containing all installed in the site collection workflow father and all the settings for the proper installation of the workflow. Such information includes the name of the task list and history list and how to start the workflow. Sharepoint allows you to start a workflow in two ways:

* adding a new item
* modification of an existing item in the list

Once you have chosen installation parameters, the wizard will take you to the configuration page of the selected workflow. In our case, this page will contain all matters pertaining to the configuration properties of Approval Workflow. Selected default values, we have completed successfully the installation process and we can start to use all the features offered by this powerful flow of content approval.
Reply With Quote
#3
Old 13-03-2011
GeforceUser GeforceUser is offline
Member

Join Date: Mar 2009
Posts: 1,364
Re: An event handler to start the Approval Workflow in MOSS 2007
Customizing the workflow

Although the approval workflow in question appears to meet all our needs, we try to think of a scenario in which, for example, we need to set a different group of approvers for each one of our list, among other things definitely need real in large corporate environments, where content in a given category, must be approved by different divisions. To do this, we must try to change the default boot parameters of the workflow and write a custom event handler to the creation of a new item in the list (or even being edited), I start the new flow approval. To start "by hand" a workflow within SharePoint, we can make use of using the method of the class StartWorkflow SPWorkflowManager (Microsoft.Sharepoint.Workflow namespace). This method accepts as parameters:

* the item to which to attach the workflow
* the workflow template to be used
* a boolean value indicating whether the workflow should start automatically or not
* initialization parameters, in XML format

Reply With Quote
#4
Old 13-03-2011
void void is offline
Member

Join Date: Nov 2008
Posts: 1,193
Re: An event handler to start the Approval Workflow in MOSS 2007
These parameters must be passed to init Infopath form of workflow, it is from this form that we're going to pick up the data structures to initialize the flow and allow the start. These are the steps for creating data structures from the init form of the workflow:

1. Achieve the following location on the server c: \ Program Files \ Common Files \ Microsoft Shared \ web server extensions \ 12 \ TEMPLATE \ FEATURES \ ReviewWorkflows \ Forms \
2. Copy the file ReviewRouting_Init_1033.xsn (Infopath form in workflow init)
3. Open the form with Infopath by clicking with the right mouse button on the file and selecting the "design" in the context menu
4. Choose File menu> Save as source files
5. Choose the location to save the file
6. Close form

In this way, Infopath created the file scheme for data structure initialization of Approval Workflow. Now this pattern is transformed into a class. NET so that you can use it inside our event handler. To make this transformation, we use use XSD utility, included with the default installation on the entire SDK. NET Framework 2.0.

0 comments:

Post a Comment

Read - Share - Comment

About This Blog

Share and Save

About Author