none
Choosing between Event Receivers and Workflows to implement a business scenario RRS feed

  • Question

  • I want to implement a business scenario for our custom list inside our sharepoint enterprise server 2013, to manage our project management projects. The business scenario is as follow:-

    1. Contributor users can create a new Project item.
    2. Then certain users inside a security group named “Senior Managers” will get notified by email.
    3. “Senior Managers” can review the item, and then modify it.
    4. If they are satisfied with the project item they can change a custom column named “Approved by Senior Managers” to true.
    5. Once the item is being “Approved by Senior Managers”, the Technical Team leader for the item creator will get notified and he can start working on the project.
    6. The Technical Team leader for the item creator will be dynamically retrieved from our active directory, based on our own hierarchy .
    7. Once the project is closed the Technical Team leader can close the item, by changing its status to closed.

    Now we want to have a certain level of custom authorization rules as follow:-

    1. Once the item is “Approved by Senior Managers” the original Contributor and other contributors should not be able to modify the item.

    2. The Technical Team leader should not be able to modify the item until it is set to “Approved by Senior Managers”.

    Now I did not implement any complex business scenarios using workflow, where I only used workflows to update list items and send emails when items are created or edited…

    So for the above scenario, I find this approach to implement it using Event Receivers:-

    1. Create a new custom list named “Projects”.
    2. Create 3 security groups; Project Contributors + Senior Managers + Technical Team leader (this should include all our technical team leaders. such as the network team lead, the software team lead, the user support team lead, etc..).
    3. Grant these 3 groups edit permission on the list.
    4. This will allow all users to edit/create list items at any stage. And to control this , I can create an event receiver when the project item is being updated, the event receiver will do the following:-

      • Prevent Project Contributors from editing an item if it has been “Approved by Senior managers”.
      • Prevent Technical Team leader from modifying a project item until it has been “Approved by senior Manager”.
      • Also implement sending notification emails.
      • And also notify the item creator’s team leader. Where I will be querying our active directory to get the team leader for the user who created the project item.

    Now I am note sure if using Event Receivers is the way to go for? Or my business scenario is better to be implemented using workflow 2010 or 2013 and why ??

    Regards

    Monday, April 24, 2017 11:35 AM

All replies

  • Hi,

    For your scenario, I would recommend you to use Event receivers instead of using workflow.

    There are some steps that could not be achieved with workflow, such as the step 6.

    Best Regards,

    Victoria

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, April 28, 2017 11:29 AM
    Moderator
  • Hi,

    For your scenario, I would recommend you to use Event receivers instead of using workflow.

    There are some steps that could not be achieved with workflow, such as the step 6.

    Best Regards,

    Victoria

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com


    But is this type of interaction considered more as a workflow oriented ?? and if we exclude point 6 then you would go with workflows ?? and why ?
    Friday, April 28, 2017 11:37 PM
  • Hi john,

    In my opinion, both workflow and event receiver will be considered in such scenarios. And it depends on you want to achieve this goal in an OOTB way or coding way. With workflow, we just need to use the OOB actions to achieve the goal. With event receiver, we need to build the project in Visual Studio and coding.

    But it depends on your choice, and sometimes the workflow may have some limitations when achieving what we want.

    Best Regards,

    Victoria


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, May 4, 2017 6:22 AM
    Moderator
  • Hi john,

    In my opinion, both workflow and event receiver will be considered in such scenarios. And it depends on you want to achieve this goal in an OOTB way or coding way. With workflow, we just need to use the OOB actions to achieve the goal. With event receiver, we need to build the project in Visual Studio and coding.

    But it depends on your choice, and sometimes the workflow may have some limitations when achieving what we want.

    Best Regards,

    Victoria


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    But as i did not work with workflows before,,, then how the user experience will be ? now with event receivers i can depend on the built-in create and edit forms,, and using events such as item updated, item updating, item created, etc... to check for my business logic and show error/s if a user try to change a value or try to edit an item he should not edit,, etc.. where the starting point will be either the create form or the edit form... and submitted the form will cause the related event receiver to fire..

    but with workflow how the user experience will be? will the workflow uses its own forms or users will also be accessing the built-in create and edit forms which will fire the workflow??? can you adivce ? and will the same workflow get fired each time (as in the event receiver case)?or the workflow will have stages and each stage can be forced to fire according to the item values (such as the item status)??

    Friday, May 5, 2017 12:30 AM
  • Hi john,

    In my opinion, both workflow and event receiver will be considered in such scenarios. And it depends on you want to achieve this goal in an OOTB way or coding way. With workflow, we just need to use the OOB actions to achieve the goal. With event receiver, we need to build the project in Visual Studio and coding.

    But it depends on your choice, and sometimes the workflow may have some limitations when achieving what we want.

    Best Regards,

    Victoria


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    i checked couple if tutorials and videos about creating workflow 2013, and i am not sure if those kind of actions can be achieved using workflows:-

    1. Point 6. The Technical Team leader for the item creator will be dynamically retrieved from our active directory, based on our own hierarchy .

    Since inside the workflow i do not have the ability to query the active directory and check for AD groups ? is this correct? while if i am writing event receivers the process will be somehow straight forward...

    2. Point 2. The Technical Team leader should not be able to modify the item until it is set to “Approved by Senior Managers”.

    Now in event receivers i can force the event receiver to run when the item is being updated, and cancel the update if the user is not authorized to edit the item at this stage... while in the workflow ,, i am not sure if i can do this.. especially as i know in workflow 2010 the workflow will run after the item is physically updated,, so i can not cancel the update operation... but i am not sure if the case inside workflow 2013 is different ...

    Friday, May 5, 2017 4:02 PM