Friday, 27 September 2013

Workflow Interview Questions

What  is Workflow ?
Workflow is a series of tasks that produce an outcome.
workflow is  automated movement of documents or items through a sequence of actions or tasks that are related to a business process.

WF programs run in a special environment known as the WF runtime

Activities are the building bricks that developers use to construct WF programs
We can consider each activity as an atomic and reusable set of instructions that represents a single unit of work.
activities are black boxes of reusable code that expose properties and events.
The consumer of an activity can simply drag and drop it on a design surface within Visual Studio.
The consumer of activity also generates event handlers for activities and write code behind these event handlers.

There are four stages in the Sharepoint workflow cycle -- associate, initiate, modify and complete









 Workflow Types:



Workflows that are included in Office SharePoint Server 2007
Approval
Collect Feedback
Collect Signatures
Disposition Approval
Three-state
Group Approval
Translation Management

Steps involved in using workflows
1.      Adding a workflow to a list, library, or content type
2.      Starting a workflow on a document or item
3.      Modifying a workflow in progress
4.      Completing workflow tasks
5.      Tracking the status of workflows



What are the types of workflow that you can design in SharePoint 2010.
Ans. you can design List Workflows, Reusable List Workflows and Site workflows using SharePoint designer 2010.

Steps Involved to Create Workflow from SPD :
Steps : Initialize
            Modify
            Associate

Steps:
It is used to organize the actions and conditions that make up the workflow into groups

Actions:
A very basic unit of work that can be added to the workflow.

Conditions:
conditions control whether or how actions will do their work.Conditions give the workflow author the opportunity to add branching and conditional logic to the workflow, hence controlling what happens based upon circumstances at run time.
Q. What is a workflow?
Ans. Workflows are the way an organization functions, a series of actions that correspond to a work process, such as the process for purchase orders.SharePoint 2010 helps you automate these workflows, thereby increasing the efficiency and productivity of the organization.
Q.What are ways to create input forms for workflow ?
Two different approaches can be used to develop custom input forms for a WSS workflow template.
• You can create your forms by using custom application pages, which are standard .aspx pages deployed to run out of the _layouts directory. ( disadv: lot of code required when compared to Infopath approach)
• using Microsoft Office InfoPath 2007 (disadv: picks up a dependenct on MOSS, i.e. it cannot run in a standalone WSS environment)

Q. What is the difference between method activity and event activity in WF ?
A method activity is one that performs an action, such as creating or updating a task. An event activity is one that runs in response to an action occurring.

Q. What are the types of workflow that you can design in SharePoint 2010.
Ans. you can design List Workflows, Reusable List Workflows and Site workflows using SharePoint designer 2010.
Q. What Reusable List Workflows and Site workflows ?
Ans.
Reusable List Workflows -
You can create a reusable list workflow (reusable workflow) in the top-level site in the site collection, and that workflow can be made globally reusable — meaning that the workflow can be associated to any list, library, or content type in the site collection. You can also create a reusable workflow in any subsite in the site collection; this workflow is available for reuse in that particular subsite.
Site workflows - A site workflow is associated to a site — not to a list, library, or content type. So unlike most workflows, a site workflow is not running on a specific list item. Because of this, many of the actions that are available for items not available for site workflows.
Q. Can you modify the Out-of-Box workflows in SharePoint 2010 ?
Ans. In SharePoint 2010, you have an option to customize the Out-of-Box workflows. The four most popular workflows in SharePoint Server 2007 — the Approval, Collect Feedback, Collect Signatures, Publishing Approval workflows — have been completely rebuilt as declarative reusable workflows, meaning that they are now fully customizable in SharePoint Designer 2010.
Q. What are events, actions, conditions and steps?
Ans. Lets look at this one by one.
Events - An event is what starts or initiates a workflow. Events can also be used to manage the timing of actions within a workflow, such as waiting for the status of an item to change. There are three events that can start a workflow:
* An item is created.
* An item is changed.
* A workflow participant clicks a start button on the SharePoint site.

Actions – An action is the most basic unit of work in a workflow. SharePoint Designer 2010 provides a set of ready-made, reusable actions for you to incorporate into your workflow.
For example, your workflow can:
* Create, copy, change, or delete list items (including documents).
* Check items in or out.
* Send an e-mail message.
Conditions - When you design a workflow, you can use the workflow editor to create rules that apply conditional logic to SharePoint sites, lists, items and content types. A rule establishes a condition where the workflow performs the associated action only if that condition is true. For example, you can create a rule where the workflow sends a reviewer an e-mail message only if an item is created by a specific person.
Q. What are Parallel and Serial actions ?
Ans. When you have more than one action associated with a condition, the actions can be set up to run at the same time (parallel) or one after another (serial), the default.
Q. What are the Types of forms associated with the workflow ?
Ans. With SharePoint Designer 2010, you can create three types of workflow forms:
Initiation form – An initiation form gathers information from the workflow participant when they start the workflow. It is automatically generated when you create the workflow in SharePoint Designer 2010. Initiation forms are displayed to users when they manually start a workflow on a given SharePoint item. With an initiation form, users can specify additional parameters or information about the workflow as it applies to the given SharePoint item.

Task form – A custom task form allows workflow participants to interact with tasks in the Tasks list specified for the workflow. With the Custom Task Wizard, you can easily create custom form fields and add them to a custom task form. When you finish designing the workflow, SharePoint Designer 2010 automatically generates the InfoPath or ASP.NET forms for your custom tasks.
Reusable workflow – association form – A reusable workflow, by default, only provides the fields common to all items, such as Created and Modified by. This is because a reusable workflow isn't by default associated with a list, library, or content type. An association form enables you to associate fields with a reusable workflow so that the fields will be available when you design and run the workflow.
Q. When are these forms get created ? And how do you customize it ?
Ans. SharePoint Designer 2010 automatically generates the forms, but you can customize them by going to the settings page for the workflow, in the Forms section, click the form you want to customize. Workflow forms are either InfoPath or ASP.NET pages. They are stored on the SharePoint site with the workflow source files.

8 Steps to Create Workflows using SharePoint Designer
Workflows are now an integral part for any project. You can build a SharePoint work flow using the available templates, SharePoint designer and Visual Studio 2005 / 2008. This tutorial will mainly concentrate on workflow creation using SharepPoint designer. We will walk through the basic 8 steps needed to create workflows using SharePoint designer.

I have published some videos on SharePoint, WCF, WPF, WWF, design patterns, UML, FPA, Enterprise blocks, etc. You can watch the videos here. You can download my 400 .NET FAQ EBook from here.
SharePoint designer helps us to create workflows and attach the workflows to a content type like list, document, etc. In other words, SharePoint designer creates workflows and publishes the workflow on the SharePoint server site.



To understand it better, we will build a simple workflow of completed and incomplete tasks. We will create two lists, one is the incomplete tasks and the other the completed tasks. The workflow will flow something like this:


  • User will create a task and enter the status of the task. 
  • If the task is incomplete, nothing will happen. 
  • Once the task is marked as complete, the task will be copied from incomplete task list to completed task list. 
  • The task will be deleted from the incomplete task list. 



So let’s understand the eight important steps we will need to create the above workflow using SharePoint designer.
Step 1

Create a team site using the SharePoint team site template.
Step 2

Create two task lists, one is incomplete task list and the other completed task list.
To create task list, click on site action -> Create: Add a new library list -> create a task.

Step 3
Start the SharePoint designer.

Step 4

Open the site in your SharePoint designer using click on file -> open site.



Step 5

Go to workflows by clicking on file -> new -> SharePoint content and click ok as shown in the below figure:


Step 6

This is an important step. In this step, we define two important things. The first is this workflow will be attached to which list. Currently we have attached the workflow to incomplete tasks list. Second we need to define the events on which the workflow should be activated. For the current scenario, we have considered two events; one when the item is created and the second when the item is updated.



Step 7

This is one more crucial step where we need to define on what condition the workflow will execute and what action should take place if the condition is true. So when a task status is completed, two actions will take place. First the task will be copied from the incomplete task list to the completed task list. Second the task is deleted from the incomplete task list.

Once you click finish, you can see the workflow created in the SharePoint designer. This workflow is also published to the SharePoint server,
You can see if the workflow is associated with the incomplete task list. Go to incomplete tasks -> Settings -> List settings -> Workflow settings. You can see that the workflow is attached to the incomplete task list.


Step 8

Ok, now it’s time to see the workflow in action. So go to incomplete task list and create a task with status completed.


Once you click ok, you see the task for some seconds in the incomplete tasks list and then the task is copied to the completed task list and deleted from the incomplete task list.


No comments:

Post a Comment