IPendingWork in WorkflowServices?
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
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 - SDEThis posting is provided "AS IS" with no warranties, and confers no rights
All Replies
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 - SDEThis posting is provided "AS IS" with no warranties, and confers no rights
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.
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 - SDEThis posting is provided "AS IS" with no warranties, and confers no rights
Hi Joel,
Thanks for the tip.
- Hi,
did you have any luck moving HEE/CEM architecture ? Was a there a specific reason why you wished to move ? only curious.
Thanks.


