Monday, July 4, 2016

Event Receivers vs Workflows



Main Differences Between SharePoint Event Receivers and SharePoint Workflows are:

1. Event handlers Can't be manually initiated - workflows can be initiated either automatically or manually.

2. Event Handlers can be Synchronous or Asynchronous - Workflows are always async (They executes after the operation)

3. In Event Receivers we can cancel the operation (such as add/update/delete) - But in Workflows its not possible. 

4. Event handlers execute from a Particular WFE, So when some thing goes wrong in that WFE, It may end-up. But Workflow Jobs are robust and  can resume even after Reboots. 

5. Usually Event handlers runs for short period - Workflows can be longer even for years!

6. There is no User Interface/user Interaction in Event Receivers - Workflows can have user interactions such as getting user input in Initiation forms.

7. As the Name indicates, SharePoint Event receivers are triggered by events like New Item Adding-Added, Updating-Updated, Deleting-Deleted, etc. - But Workflows triggered only on Creation/Change/deletion.

8. Event Receivers are created using Visual studio - Workflows can be via SharePoint user interface, SharePoint Designer, Visio or Visual studio.

9. Workflows leaves "Workflow History" logs which we can refer for debugging - Event handler doesn't do such.

10. Event receivers are better for large volume - Workflows are better for small amount of data.





Event ReceiversWorkflows
Can execute either before or after the operationAlways executes after the operation
Can cancel the operationCannot cancel the operation as the item will have already been created
Cannot be launched manually by the userCan be started manually by the user
Not designed for user interactionSpecifically designed for user interaction
Can execute in response to many different actions, including deletesCan only execute in response to one of four events – Manual, an item being created, an item being edited, and an item being submitted for approval
Must be created in Visual StudioCan be created with Visual Studio, Visio or SharePoint Designer



t RecieversWorkflowTimer Job
Can execute either before or after the operationAlways executes after the operationWe ll Add
Can cancel the operationCannot cancel the operation as the item will have already been createdWe ll Add
Cannot be launched manually by the userCan be started manually by the userWe ll Add
Not designed for user interactionSpecifically designed for user interactionWe ll Add
Can execute in response to many different actions, including deletesCan only execute in response to one of four events – Manual, an item being created, an item being edited, and an item being submitted for approvalWe ll Add
Must be created in Visual StudioCan be created with Visual Studio, Visio or SharePoint DesigneWe ll Add
Syncronous Events and Asyncronous EventsWorkflows are always async
Event handlers execute from a Particular WFE, So when some thing goes wrong in that WFE, It may end-upBut Workflow Jobs are robust and can resume even after Reboots.
Usually Event handlers runs for short periodWorkflows can be longer even for years!
Event handlers execute from a Particular WFE, So when some thing goes wrong in that WFE, It may end-upBut Workflow Jobs are robust and can resume even after Reboots.
There is no User Interface/user Interaction in Event ReceiversWorkflows can have user interactions such as getting user input in Initiation forms.
SharePoint Event receivers are triggered by events like New Item Adding-Added, Updating-Updated, Deleting-Deleted, etcWorkflows triggered only on Creation/Change/deletion.
Event handler doesn't do such.Workflows leaves "Workflow History" logs which we can refer for debugging
Event receivers are better for large volumeWorkflows are better for small amount of data.

No comments:

Post a Comment