locked
Better approach for WWF with web applications RRS feed

  • Question

  • Hi,

    Wanted to know if Using bookmarks or us using WWF as service would be a better approach for WWF with Asp.NEt MVC web applications.

    There will be few activities which would wait for some events like approval from managers etc 

    Will WCF receive controls be the best in such scenarios?

    Regards,

    Nagaraj

    Friday, March 25, 2011 3:01 AM

Answers

  • Well, 

    for my knowledge and direct experience with these kind of issues, I can tell you that your approach should be something like this:

    0) Define the processes and subdivide them into different "pages" or "object statuses"

    1) provide a Web Interface that provides the pages for each part of your process

    2) create the workflow definitions for each status transition

     a) in your case approval process for example will be when an object transition is "Pending"-->"Request Approval"

    Definitely use Bookmarks and run your workflows on your own Service Host. 

    ASP.NET application (MVC or Forms... or whatever you like) could issue a WCF/SOAP call (for instance) to the WF host.

    In my implementation (look at my blog http://adrianot75.wordpress.com/2010/11/05/sample-real-world-wf4-integration/) I track my workflow instances on my own tables and provide different approval UIs that provide bookmark resumption by issuing a WCF service call that in turn will wake up the flow dealing directly with the persistence store (SQL Server in my case).

    Please feel free to ask if you need further details. 

    Hope it helps. 

    Cheers

     

     

     

     


    Adriano
    • Marked as answer by Andrew_Zhu Friday, April 8, 2011 7:45 AM
    Friday, March 25, 2011 3:08 PM

All replies

  • Hi,

    Wanted to know if Using bookmarks or us using WWF as service would be a better approach for WWF with Asp.NEt MVC web applications.

    There will be few activities which would wait for some events like approval from managers etc 

    Will WCF receive controls be the best in such scenarios?

    Regards,

    Nagaraj

    I am facing same problem right now, would like to see the opinion of experienced developer?
    Friday, March 25, 2011 2:11 PM
  • Well, 

    for my knowledge and direct experience with these kind of issues, I can tell you that your approach should be something like this:

    0) Define the processes and subdivide them into different "pages" or "object statuses"

    1) provide a Web Interface that provides the pages for each part of your process

    2) create the workflow definitions for each status transition

     a) in your case approval process for example will be when an object transition is "Pending"-->"Request Approval"

    Definitely use Bookmarks and run your workflows on your own Service Host. 

    ASP.NET application (MVC or Forms... or whatever you like) could issue a WCF/SOAP call (for instance) to the WF host.

    In my implementation (look at my blog http://adrianot75.wordpress.com/2010/11/05/sample-real-world-wf4-integration/) I track my workflow instances on my own tables and provide different approval UIs that provide bookmark resumption by issuing a WCF service call that in turn will wake up the flow dealing directly with the persistence store (SQL Server in my case).

    Please feel free to ask if you need further details. 

    Hope it helps. 

    Cheers

     

     

     

     


    Adriano
    • Marked as answer by Andrew_Zhu Friday, April 8, 2011 7:45 AM
    Friday, March 25, 2011 3:08 PM
  • Hi Adriano,

    Thanks for the reply.

    I need some further details. Before that let me explain the scenario

    There are more than 3 sequences in the workflow. In each of these sequence there will be a receive activity which waits for an approval.

    Sequence 1:

    Activity 1 : Initialize

    Activity 2 : SaveEmployeeTemplate ( This is a receive activity and will be invoked after managers approval)

    Activity 3 : Save Workflow state (We are manually saving the state in our tables)

    Sequence 2 :

    Activity 1 : Receive Activity ( Where an employee requests for something)

    Activity 2 : Save the workflow state 

    Sequence 3 :

    Activity 1 : Manager Approval ( Receive Activity)

    Activity 2 : Save State

    When we use workflow directly ( without wcf) the state of the workflow is automatically maintained when we provide the instance store. And the workflow resumes the next activity automatically by using WorkflowApplication.Load(Id).

    But how can the state be maintained in Instance store using WCF and bookmarks?

    Can you please provide code snippet for invoking and resuming workflow.

    Did you mean resuming the workflow like the code snippet below?

     

      WorkflowControlClient client = new WorkflowControlClient("Endpoint");

       client.Unsuspend("Id");

    How to start the workflow in such scenario?

     

    Regards,

    Nagaraj

     




    Monday, March 28, 2011 12:09 PM