Long running WF4 Service using contract first approach RRS feed

  • General discussion

  • Hi All,

           For developing the WF4 Services in our application we need to use a contract first approach using an Interface IService which has a Run method.As per the below link -


    we cannot use the same operationName for the Receive activities but in our case ,being a contract first approach, we need to use the same operationName i.e. Run.

    Then I came through another approach as per the below link -


    But in this case also MyExtension uses ThreadPool and Thread.Sleep in the WaitSome method but in real world, it would be something like some client application is going to trigger the WF Service(just like in our case, a windows service invokes the WF Services based on a routing mechanism) but MyExtension should be capable enough to listen to the trigger from the client application.How to implement such a listener and which event should such a listener subscribe to?If I know the answer for these queries, I was thinking of implementing a custom WorkflowServiceHostFactory and host the WF Services in WorkflowServiceHost and use the MyExtension kind of some custom implementation of IWorkflowInstanceExtension to mark and resume some bookmark.Any suggestion or some real world contract first based sample, will be really appreciated.It's really urgent and we are not getting any solution.Please help.

    Friday, April 12, 2013 8:56 PM

All replies

  • Can any one please answer my query? It's really very urgent.Thanking you all in advance.

    Thanks and Regards,


    Saturday, April 13, 2013 11:11 AM
  • Hello Sandip!

    Are you aware of the first-class support for contract-first workflow services introduced by WF 4.5? If "yes", is there some particular reason why you don't use that?

    Best regards,

    Henrik Dahl

    Saturday, April 13, 2013 12:58 PM
  • Hi Henrik,

                   Truly speaking,I was not aware of "first-class support for contract-first workflow services introduced by WF 4.5".Thanks for letting me know about it since probably this knowledge may be helpful for me in future.But we are using WF 4.0 version and I am really not aware whether there is any "first-class support for contract-first workflow services".In our project the version we are given is WF 4.0 and if we need to upgrade it to WF 4.5 then probably it will take atleast 2 weeks to get it incorporated in our project(not because of any learning curve but because there is a hell lot of process involved in getting that done).

                  So kindly provide some feasible solution in WF 4.0 since we need to deliver this by end of this month.I hope you understand my situation.

    Thanks and Regards,


    Sunday, April 14, 2013 6:10 AM
  • Hello Sandip,

    WF 4.0 just doesn't provide any first class support for what you want to do. It was introduced by WF 4.5.

    Best regards,

    Henrik Dahl

    Sunday, April 14, 2013 12:56 PM