Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Workflow TV - How To Build Workflow Services with a Database Repository

Download

Right click “Save as…”

Customers often ask me

How can I store my Workflow Service definitions (xamlx files) in a database with IIS and AppFabric?

On this episode I'll show you how you can create a VirtualPathProvider that enables you to build a Workflow respository with a database.

Links

Ron Jacobs
http://blogs.msdn.com/rjacobs
Twitter: @ronljacobs http://twitter.com/ronljacobs

Tags:

Follow the Discussion

  • Ron, first of all great post, secondly, maybe not the most accurate tittle, more than loading workflows definitions form the DB (.xaml file content) or any other way that it can  be turned into some string value using the DynamicActivity method i.e:

    var activity = ActivityXamlServices.Load(new StringReade(wokflowToExecute)) as DynamicActivity;

    This is an elegant workaround to implement service partitioning on WF, back in the
    beta I asked something like that http://social.msdn.microsoft.com/Forums/en/wfprerelease/thread/41ecf7c5-8c74-4ec9-9bdf-437015b17ceb

    The "limitation" of one WorkflowServiceHost per WF service is one of the reasons I decided to no
    use WF services on one of our company's main solutions, given the number of services to implement, using WCF routing wouldn't be as practical or maybe not a clean, and using pick activities would be irrational, so we used plain WCF instead.

    Currently we have another interesting scenario and the approach you're following gives me another option on how to handle this situation, so, thanks Ron and keep up the good stuff coming.

  • Ron Jacobsrojacobs Ron Jacobs

    I don't understand your comment about WorkflowServiceHost being limited.  It is no different than a WCF ServiceHost.  The WCF Service Host will host one service per host.  The WF WorkflowServiceHost will host one workflow per host.

    However, you can have multiple services and workflow services in you web application.  In fact you don't really deal with the WorkflowServiceHost or ServiceHost classes unless you are self-hosting so they are just another part of the infrastructure most of the time.

    • WCF services have a collection of operations
    • WF services also have a collection of operations

    The main difference is that the WF service can enforce a messaging protocol with certain operations being available only at certain times.

    My guess is that if you can build your solution with WCF services you can also build it with workflow services.

  • Hi Ron, I thought about this idea some time ago, the problem that I found is the config file, this kind of file can´t be provided by a VirtualPathProvider, so is needed to use pre-defined configs, losing flexibility with this.
    What do you think about? Do you have some idea or workaround?

    Regards

  • Ron Jacobsrojacobs Ron Jacobs

    Can provide a web.config with the VirtualPathProvider?  I didn't know that.

    I wonder if you could support a VirtualDirectory and then place a web.config file in the VirtualDirectory with the config you need if that would work.

    It would be worth a try.

  • RameshRamesh

    Hi Ron, Good post.
    I have almost same kind of requirement in our project, but we are using Oracle 11g. Will Oracle 11g support to store workflow service? If so what are all changes needs to be done?

    Regards
    Ramesh

  • Ron Jacobsrojacobs Ron Jacobs

    You can store the workflow definitions in Oracle - I'm using Entity Framework 4.1 in my code so you would need a provider that works with Entity Framework.

    However, at this time we do not have a Workflow persistence provider for Oracle.  You won't need this unless your workflows are long running.

  • RameshRamesh

    Thanks for your quick reply.

    Can I implement BPM using State Machine WF?

    Here is the scenario I would like to implement...
    Step 1: Create Purchase Request (PR). State of PR at this stage is "Created".

    Step 2: On Step1, WF should assign a task to "Purchase Manager".

    Step 3: When Purchase Manager logs into to system, in his dashboard this task should be visible. At this stage he will have two actions "Approve" and "Reject".

    Step 4: On click of "Approve", again task should assign to Finance Manager. On click of "Reject" the PR state changes to "Rejected"

    Step 5: When Finance Manager logs in task should be visible in his dashbaord with "Approve" and "Reject" actions.

    Step 6: On click of "Approve" Purchase Request state should change from "Created" to "Approved". On click of "Reject" the PR state changes to "Rejected"

    What do you think about? Will this can be implemented in WF 4.0?

    Regards
    Ramesh

  • RameshRamesh

    Any update on the above?

    Regards
    Ramesh

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.