Avalon.NET - WWF Runtime and AppDomains

Hi,

I'm working on a highly customizable Workflow platform codename "Avalon.NET" built on the Windows Workflow framework. I provide my own authoring tools through Visual Studio 2005 (for Developers) and Office 2003 Outlook (for Business Analysts) - since the Windows Workflow Designer is too technical, less user friendly and the design canvas or the process flow concept is too rigid (just like BizTalk). Because I'm providing custom authoring tools, I'm actually generating the Windows Workflows behind-the-scene which are exported to the runtime hosting server where they're executed.

My Question:

For a really complex Workflow there could be as many as 20 mini-Windows Workflows generated. Some of these mini-workflows may be required to run in separate AppDomains for code isolation purposes and security. I understand that only one Windows Workflow Runtime can exist in any given AppDomain. However, is there way for the WWF runtime to run Workflows in some internal AppDomains, or better yet how can I extend the runtime engine to execute some workflows in a particular AppDomain None of the service extensibles allows me to do this kinda runtime adjustments. I don't want to host i.e. 20 WWF runtimes in 20 AppDomains, overhead may be problem and i.e when and how to shutdown the runtimes could be a problem - which I'm keen to avoid. Any ideas

Thanks! Michael




Answer this question

Avalon.NET - WWF Runtime and AppDomains

  • dreamlordzwolf - Michael Corpuz

    You'll need to create the AppDomains yourself and then create a new WorkflowRuntime in each and give it work to do (workflow instances to run). You should note that if you are using the SqlWorkflowPersistenceService in all of the WorkflowRuntimes that you create and they share the same database they will load instance that were created in different AppDomains (which isn't what you want if you're looking for isolation for security reasons). You'll probably want to create a database per AppDomain to achieve the isolation that you're looking for.

    Also - the one WorkflowRuntime per AppDomain restriction has been removed for beta 2.2.

    HTH,

    Joel West

    SDE in WF runtime and hosting

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


  • ipointer

    Hi everyone, I found a solution to my problem.

    The solution goes like this.

    For each Process Instance I create an AppDomain. A process intstance may contain any number of Windows Workflows. Each AppDomain contains only one instance of the Windows Workflow Runtime. At runtime a process instance run in its own(unique) AppDomain and therefore anytime it has a need to execute an associated Windows Workflow, it uses its own(unique) Windows Workflow Runtime to do so. Thanks to the dev. team at Microsoft, one Windows Workflow Runtime can execute as many Workflows at the same time. With this approach, I'm even able to unload a process instance, fix errors, modify and reload to continue execute without affecting other running processes or any other operations going-on on the server, as well as run processes with unique security permissions etc. - total isolation - which is exactly what I wanted!



  • akula

    Hi,

    I'm using beta 2.2 and I get runtime error when I try to use more than 1 WorkflowRuntime in the Default AppDomain...any ideas



  • Avalon.NET - WWF Runtime and AppDomains