Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.
Showing posts with label Workflows. Show all posts
Showing posts with label Workflows. Show all posts

Friday, December 02, 2011

SharePoint 2010 Workflows


SharePoint 2010 Workflows

A quick view on whats new with SharePoint 2010 Workflows :

1. SharePoint 2010 workflows are build upon the workflow engine provided .Net
Framework 3.5.

2. List and Site workflows - In addition to the SharePoint lists we can now create
workflows for SharePoint sites as well. These are called as "Site Workflows".

3. SharePoint Designer 2010 Changes - MS has provided a new graphical workflow
designer for designing workflows. These workflows can be deployed in SharePoint
Server directly from the designer.

4. Editing Out-of-Box workflows - Another Improvement in SharePoint Designer
2010 workflows is that it now allows you to edit the out-of-the-box workflows that
come with SharePoint.

5. Re-usable Workflow - In addition to above, with Designer 2010 you can also
create reusable declarative workflows. That means unlike SharePoint 2007 designer
workflows, you don't have to bind a workflow to a specific list. You can resuse them
by binding it to more than one list or multiple lists.

6. User profile in Workflow - User Profile data can now be bound to properties in
workflow. This will make it possible to get information about the SharePoint user
profile in the workflow itself.

7. Moving SharePoint Designer Workflows - The resuable designer workflows can
now be moved to another SharePoint server or to Visual Studio 2010 with a
workflow .wsp file. "Save as Template" command can be used to create the WSP
file for the workflow.

8.Changes in List Events - SharePoint 2010 adds four new workflow Event
Receivers for list based workflows. The four workflow event receivers available are
Starting, Started, Postponed and Completed. These are similar to other SharePoint
list\library event receivers and they execute code on the server in response to the
event.

9. Workflow Templates - To make development easier, Visual Studio 2010 includes
event receiver project types to make using the workflows and events fairly simple.

Now to Start developing workflows what do you need.

1. SharePoint designer - If you need to customize the Out-of-box workflow or wants
to create a "not so complex" reusable workflow. You can however, deploy your
designer workflow in any sharepoint enviornment using a wsp file. See Move
Designer workflow using wsp

2. Microsoft Visio - If you want to design a workflow which has complex workflow
chart, you can design it in Viso and later it can be pulled in to SharePoint designer.
Also, note that you can only create Sequential workflows in viso.

3. Creating Worflow in VS - Visual Studio 2010 provides templates to create
workflows and creates events for the workflow.

Lets look at some of the Videos available for creating workflows using all above
methods.

Monday, November 28, 2011

SharePoint 2007 Custom Workflow Basics

Learn what the basic concepts and terms are of custom workflows that are created through Visual Studio using Windows Workflow Foundation and which can be used on lists, libraries, and content types in SharePoint.

Two types of workflows
You can create two types of workflows in Visual Studio:
Sequential
State Machine
Sequential workflows
A sequential workflow consists of a set of activities, which are executed in a rigid, predefined manner. The work performed generally follows a predictable number of pathways.
A good example of the application of a sequential workflow is a document approval process, where a document is modified and reviewed by many people. The document would go from person to person, and thus follow a route where the logic has been predefined.
State Machine workflows
A state machine workflow consists of states and transitions between states, which can be executed randomly. The work performed generally follows unpredictable pathways.
A good example of the application of a state machine workflow is a defect tracking system. While a defect can be marked as fixed by a developer, a tester can change the status of the defect back to active if he finds that the defect has not been resolved. The defect can go from state to state several times or end up with a state such as refer to customer or functions as designed. The amount of possible states a defect can go through are unlimited and cannot be defined beforehand.
The difference between a workflow template and a workflow
A workflow template is the blueprint for a workflow; it defines the sequence of events, actions, or activities that take place when the workflow does its work.
A workflow template can be associated with a list, library, or content type. Associating is the act of binding a workflow template to a SharePoint object. Once you associate a workflow template with a list, library, or content type, it becomes a workflow, that is, a piece of work that can be run on the object.
When you start the workflow, an instance of the workflow is created to run on the object. The latter is called a workflow instance.
Identifying relationships through correlation tokens
A workflow instance interacts with several SharePoint objects (task lists, and documents or items) during its lifetime. In SharePoint you can have many workflow instances running at the same time and interacting with several objects at the same time.
To be able to identify which workflow instance is interacting with which object, you must use an identifier that links one particular workflow instance to one particular SharePoint object. Each workflow instance must be bound to its own items.
Such an identifier is called a correlation token. A correlation token links a workflow instance to its documents, items, and tasks. It prevents confusion between different workflow instances.

How to associate a workflow to a custom contentType

If you want to attach your custom workflow to a content type (single, multiple or all of the content types.. below are samples..

Associate workflow with a single contentType
Notice the highlighted portion which is a ';' delimited two part entry.
First is the type of category and second is the id of the entity. In this example, the category is content type and I have specified the id of the content type that should be available for this workflow.

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Workflow
     Name="WFName"
     Description="This workflow will .."
     Id="532c0a2d-fa10-4dad-80a4-1069b2bd8e27"
     CodeBesideClass="Demo.Workflow.Workflow1"
     CodeBesideAssembly="$assemblyname$"
      InstantiationUrl="_LAYOUTS/DEMO/DemoForms/form0_Init.aspx">
    <Categories/>
    <MetaData>
      <AssociationCategories>ContentType;0x010100a945f312c7bd4a589d1489ca8307f24d</AssociationCategories>
      <StatusPageUrl>_layouts/WrkStat.aspx</StatusPageUrl>
    </MetaData>
  </Workflow>
</Elements>



Associate workflow with a multiple contentType
notice that every set of category is seperated by the delimiter ';#'
<MetaData>
  <AssociationCategories>ContentType;0x010100a945f312c7bd4a589d1489ca8307f24d;#ContentType;0x0101009a30bd7a9c18447e9b806af9c0931b9c</AssociationCategories>
</MetaData>



Associate workflow with a all contentTypes
<MetaData>
  <AssociationCategories>ContentType</AssociationCategories>
</MetaData>



Associate workflow with a all contentTypes and Lists
<MetaData>
  <AssociationCategories>ContentType;#List</AssociationCategories>
</MetaData>

Workflow Basics


This post provides an overview of creating Workflows using Sharepoint Portal, Managing security levels in Sharepoint Portal site.

What is WorkFlow:

A workflow is a natural way to organize and run a set of work units, or activities, to form an executable representation of a work process. This process can control almost any aspect of an item in Windows SharePoint Services, including the life cycle of that item.

You can create workflows that are as simple or complex as your business processes require. You can create workflows that the user initiates, or workflows that Windows SharePoint Services automatically initiates based on some event, such as when an item is created or changed.

Suppose you need to create a simple workflow that routes a document to a series of users for approval or comments. This workflow would include actions that the system needs to perform, as well as provide interfaces for the users to interact with the workflow in prescribed ways.

For example, send an e-mail message to the selected users when the document was ready for review. Those users would then need to be able to notify Windows SharePoint Services when they had completed their reviews and, optionally, enter any comments. The workflow framework included in SharePoint Server 2007, enables you to model such complex work processes and present them to end users in an easily understood, unobtrusive manner that guides them through each step of the process.

Workflow Types:


Windows Workflow Foundation supports two fundamental workflow styles:

Sequential workflows  :Represents a workflow as a procession of steps that execute in order until the last activity completes. However, sequential workflows are not purely sequential in their execution. Because they can receive external events and include parallel logic flows, the exact order of activity execution can vary.
State machine workflows   :Represents a set of states, transitions, and actions. One state is denoted as the start state, and then, based on an event, a transition can be made to another state. The state machine can have a final state that determines the end of the workflow.