Alternative to WorkflowServiceHost for WF4?

We want to replace a piece of our business logic with WF4 workflows.
These are all fairly typical workflows: user action creates an instance, database effort, next user confirmations, etc.

Our workflow host requirements:

  • Create workflows from XAML definitions stored in a database (DynamicActivity)
  • Support for workflows in different versions
  • Long-term event support (we currently know notifications after 5 days and rollback the workflow after 30 days)
  • Support for many instances of many workflows (we defined 10 workflows with 4000 in flight, of which only a few are processed at any given time)
  • Persist all state after service restart (including time based event)
  • Caller Authentication (WindowsAuthentication if possible)

As part of the migration effort, I built several POCs using WCF "Application Service Service Application" projects, but from what I can see, they are not immediately possible.

I have # 2 running through WCF Routing and I understand that WSH will handle # 3 for us (is that true given # 5?), But I don't see how # 1 from the default project structure will work.
I decided # 1 to use instances of WorkflowApplication, but this relied on using resumable bookmarks for each input event, and I was not sure if the WorkflowApplication would scale to our needs without offloading idle workflows that disrupt Delay activity.

So, if you're stuck with me this far:

  • Is there a way to achieve all of this using WSH, either in the default project or by implementing some of them yourself?
  • Is it better for us to write our own "DurableDelay" that records true wake-up times and unloads a workflow that will be resumed by the host process, given the long lead times and the potential need to unload and reload worker processes?
  • If WSH is not going to do this, is there an existing alternative?

I'm not averse to writing our own host service to handle the workflow lifecycle, and we even came up with a suggested design, but I didn't want to start that route if it turned out there was a ready-made solution.

Greetings

+3


source to share


2 answers


You can achieve # 1 by using VirtualPathProvider

to load worker processes from the database rather than the filesystem. See How to Create Workflow Services with a Database Repository for more information on this.

Workflow versioning ( # 2 ) is something that is not supported in .NET 4.0, but in .NET 4.5 you have better support for real versioning. See What's New in Windows Workflow Foundation 4.5 . However, if you don't need to change the workflow after it starts and you just want new instances to start with the new version, and the already executing instances can complete using the previous workflow definition, you can implement versioning at the database level and just handle each version of the workflow definition has a different workflow service.



Then you can use IIS-hosted ( AppFabric ) Workflow Services with SQL Server Instance Store to get # 3 , # 4, and # 5 for almost free.

Finally, for # 6, and assuming you are sticking with .NET 4.0, you can take a look at the WF Security Pack CTP 1 .

+1


source


I am developing the same workflows.



I also looked at workflow services for the first time, but since our workflow was fully integrated into the business layer, I didn't want to use WCF to access the workflows.
So I am now using WorkflowApplication as host, so I can instantiate and manage the host.
The biggest issue was resuming worker processes that are using delay activity (you need to check yourself against the database)

0


source







All Articles