locked
Sharepoint parallel workflow RRS feed

  • Question

  • Hi

    can anyone tell me about the parallel approval workflow and it should send mails to two persons simultaneously and if anyone rejcets the item gets rejected.

    • Edited by Mike Walsh FIN Saturday, May 21, 2011 6:48 AM NEVER say something is urgent. These are forums. Post and wait.
    Wednesday, May 11, 2011 5:53 PM

Answers

  • Hi,

    Thanks to share your post.

    For the issue, here are some example solutions for your reference:

    1.       Create a custom activity that extends SequenceActivity called ReviewActivity

    2.       The ReviewActivity includes the typical Create Task -> While -> OnTaskChanged -> CompleteTask scenario

    3.       In my workflow, I have a Replicator that is creating many instances of the ReviewActivity (and thus many Tasks).

    4.       The replicator implements an UntilCondition that checks to see if a task was rejected (this is set in the ChildCompleted)

    5.       After the Replicator, I have an UpdateAllTasks to close the remaining tasks

    If you have any experience with this scenario at all, you are getting ready to tell me that UpdateAllTasks also updates the originally rejected task since the "CompleteTask" has not been persisted to the database yet. The magic is in an attribute that you can define for the custom activity (ReviewActivity) called PersistOnClose.

    [Designer(typeof(ActivityDesigner), typeof(IDesigner))] 
    [PersistOnClose
    public partial class ReviewActivity : SequenceActivity 

    This attribute ensures that once the ReviewActivity is complete, all changes are persisted to the database. Since the last activity in the ReviewActivity is the "CompleteTask", the task is saved to the DB. Therefore, the UpdateAllTasks will not touch it.

    Hope this could help you!

    Leo

    • Marked as answer by Emir Liu Friday, May 20, 2011 9:41 AM
    Wednesday, May 18, 2011 9:10 AM

All replies

  • Hi Prashanth,

     

    You can use the OOB workflow template to achieve this. Check this link http://www.wrox.com/WileyCDA/Section/id-305188.html to understand the same.


    Thanks,
    Chanakya
    Friday, May 13, 2011 5:03 AM
  • Hi,

    Thanks to share your post.

    For the issue, here are some example solutions for your reference:

    1.       Create a custom activity that extends SequenceActivity called ReviewActivity

    2.       The ReviewActivity includes the typical Create Task -> While -> OnTaskChanged -> CompleteTask scenario

    3.       In my workflow, I have a Replicator that is creating many instances of the ReviewActivity (and thus many Tasks).

    4.       The replicator implements an UntilCondition that checks to see if a task was rejected (this is set in the ChildCompleted)

    5.       After the Replicator, I have an UpdateAllTasks to close the remaining tasks

    If you have any experience with this scenario at all, you are getting ready to tell me that UpdateAllTasks also updates the originally rejected task since the "CompleteTask" has not been persisted to the database yet. The magic is in an attribute that you can define for the custom activity (ReviewActivity) called PersistOnClose.

    [Designer(typeof(ActivityDesigner), typeof(IDesigner))] 
    [PersistOnClose
    public partial class ReviewActivity : SequenceActivity 

    This attribute ensures that once the ReviewActivity is complete, all changes are persisted to the database. Since the last activity in the ReviewActivity is the "CompleteTask", the task is saved to the DB. Therefore, the UpdateAllTasks will not touch it.

    Hope this could help you!

    Leo

    • Marked as answer by Emir Liu Friday, May 20, 2011 9:41 AM
    Wednesday, May 18, 2011 9:10 AM