Ask a questionAsk a question
 

AnswerIPendingWork in WorkflowServices?

  • Tuesday, March 18, 2008 1:52 AMFiredancer Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    Hi,

     

    I'm migrating my workflows from HEE/CEM architecture to WorkflowServices using ReceiveActivity/CodeActivity. I would like to know if there is a way to implement IPendingWork in WorkflowServices?

     

    Thank You.

Answers

  • Wednesday, March 19, 2008 4:38 PMjdw - MSFT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    You could still use your service and IPendingWork but it is likely that you would need to factor the code differently.  Assuming that your local service both handles communication and participates in the batch with IPendingWork objects you would remove the communication aspect from the service (it would remain a runtime service but all it would do is handle the batch aspects).  From the workflow logic perspective you would likely split your activity in two.  You would have a receive and then a separate activity that asked your service to do the batch work (or create a new custom activity that contained a receive activity and then communicated with your service).

     

    Thanks,
    Joel West
    MSFTE - SDE

    This posting is provided "AS IS" with no warranties, and confers no rights

     

All Replies

  • Tuesday, March 18, 2008 4:17 PMjdw - MSFT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Could you provide more details on the scenario that you're trying to solve?  IPendingWork is implemented on a workflow runtime service in order to participate in the transaction that is used to persist the workflow instance.  For a good description of IPendingWork and how to make use of it please see:  http://blogs.msdn.com/advancedworkflow/archive/2006/03/01/541648.aspx

     

    Thanks,
    Joel West
    MSFTE - SDE

    This posting is provided "AS IS" with no warranties, and confers no rights

     

     

  • Wednesday, March 19, 2008 2:06 PMFiredancer Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    Hi Joel,

     

    My application has its own database and each workflow activity will interact with business methods that updates data in the database. IPendingWork is used to ensure that when an error occurs in the business methods, the workflow runtime will rollback the workflow together with the methods. This is to ensure consistency between the application database and the persistence store.

     

    I'm able to implement this without any problems in .NET 3.0 using a LocalService wiring it up HEE/CEM activities. I would like to know how can I achieve the same result with Workflow Services (ReceiveActivity) which means if the call to my business methods fails, I would like to rollback the persistence.

     

    Thank You.

  • Wednesday, March 19, 2008 4:38 PMjdw - MSFT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    You could still use your service and IPendingWork but it is likely that you would need to factor the code differently.  Assuming that your local service both handles communication and participates in the batch with IPendingWork objects you would remove the communication aspect from the service (it would remain a runtime service but all it would do is handle the batch aspects).  From the workflow logic perspective you would likely split your activity in two.  You would have a receive and then a separate activity that asked your service to do the batch work (or create a new custom activity that contained a receive activity and then communicated with your service).

     

    Thanks,
    Joel West
    MSFTE - SDE

    This posting is provided "AS IS" with no warranties, and confers no rights

     

  • Friday, March 21, 2008 7:22 AMFiredancer Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi Joel,

     

    Thanks for the tip.

     

  • Thursday, November 05, 2009 3:22 PMkennyjoseph Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    did you have any luck moving HEE/CEM architecture ? Was a there a specific reason why you wished to move ? only curious.

    Thanks.