locked
Is WF4 suitable for develop Human Workflow Engine---My great confusion RRS feed

  • Question

  • WF3 is very good for develop a Human workflow engine, but I don't think WF4 is suitable.

    WF4 has such lacks(Just  my view):

    1)No matter WorkflowApplication or WorkflowServiceHost, it can only host one workflow activity, so if we need a engine to host many workflow activities,we have to create many WorkflowApplication or WorkflowServiceHost instance.

    fortunately, we can use WorkflowApplication and persist it when it's unloaded. but if the
    is unloaded, there is no OOB function

    to re-load it. it's bad when we use the Delay activity! if we use Delay activity and the WorkflowApplication, when the Delay activity is executed, the workflow will never be run!

    The AbsoluteDelay example in the WCF_WF_Example give a example code for reload a workflow with Delay:

     while (true)
          {
            // Wait for workflow to unload
            workflowUnloadedEvent.WaitOne();
            // Break the loop once the workflow has completed
            if (workflowCompleted)
            {
              break;
            }
            // Wait for a timer registered by the delay to expire and the workflow instance to become "runnable" again
            WaitForRunnableInstance(store, ownerHandle);
            // Create a new WorkflowApplication instance to host the re-loaded workflow
            wfApp = CreateWorkflowApplication(new Workflow1(), store, wfHostTypeName);
            try
            {
              // Re-load the runnable workflow instance and run it
              wfApp.LoadRunnableInstance();
              workflowUnloadedEvent.Reset();
              wfApp.Run();
            }
            catch (InstanceNotReadyException)
            {
              Console.WriteLine("Handled expected InstanceNotReadyException, retrying...");
            }
          }

    But it is for Single-Workflow, I really want an example to auto-activate workflow instance with Delay, I found in WF4 beta 1, there is an windows service called WorkflowManagementService to to the job, But in WF4 RTM, how can we do that? I think the guys in WF4 dev team are great, they must provider this function, but who can give me an example?

    In WF3, we can use a single WorkflowRuntime to host all workflow activity, the Delay have no such problem.

    2)the versions

    if we have many versions for on workflow, how to do it?

    I found a solution : do a host for every version of the workflow.

    the same issue with the quesion 1 : if we use the Delay activity, how can we do it? 

    3)the Designer for Flowchart is internal, if we want to implement a designer like the flowchart, it's difficult. we have to do everything including drawing the Connector. I read a bit code of the StateMachine workflow CTP in codeplex, it's code is very like the FlowchartDesigner.

    Microsoft can provider the WF4 framework, it's perfect, but Microsoft can not do every think, why not it provider an easy way for develop to extend the Free Form Style Activity Designer?

    In WF3,  there is FreeFormDesigner, develop can use it to do many things. even there own Flowchart Designer.

     

     

    Sunday, May 23, 2010 1:34 PM

Answers

  • Hi, Jianyi

    ->"1)No matter WorkflowApplication or WorkflowServiceHost, it can only host one workflow activity, so if we need a engine to host many workflow activities,we have to create many WorkflowApplication or WorkflowServiceHost instance."

    WorkflowApplication(and also WorkflowServiceHost) is a light weight host.  The real host engine is the .NET Framework runtime.

    ->"But it is for Single-Workflow, I really want an example to auto-activate workflow instance with Delay, "
    If you want a much powerful WF host, I would recommand you use Appfabric, check this:
    Windows Server AppFabric

    ->"3)the Designer for Flowchart is internal, if we want to implement a designer like the flowchart, it's difficult. we have to do everything including drawing the Connector. I read a bit code of the StateMachine workflow CTP in codeplex, it's code is very like the FlowchartDesigner."

    WF4 workflow designer is base upon WPF, I would say it is much simplified and powerful than WF3 designer. you can start from here:
    Workflow Designer Programming Model
    WPF will enable us create some really good looks Activity Designers. I also saw people create some great customized WF4 designer in CodeProject site. for example,this one: http://www.codeproject.com/KB/WF/MessageMediation.aspx

    Regards

    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support
    • Marked as answer by Andrew_Zhu Monday, May 31, 2010 2:01 AM
    Tuesday, May 25, 2010 7:12 AM

All replies

  • Any reply?
    Monday, May 24, 2010 6:48 AM
  • Hi, Jianyi

    ->"1)No matter WorkflowApplication or WorkflowServiceHost, it can only host one workflow activity, so if we need a engine to host many workflow activities,we have to create many WorkflowApplication or WorkflowServiceHost instance."

    WorkflowApplication(and also WorkflowServiceHost) is a light weight host.  The real host engine is the .NET Framework runtime.

    ->"But it is for Single-Workflow, I really want an example to auto-activate workflow instance with Delay, "
    If you want a much powerful WF host, I would recommand you use Appfabric, check this:
    Windows Server AppFabric

    ->"3)the Designer for Flowchart is internal, if we want to implement a designer like the flowchart, it's difficult. we have to do everything including drawing the Connector. I read a bit code of the StateMachine workflow CTP in codeplex, it's code is very like the FlowchartDesigner."

    WF4 workflow designer is base upon WPF, I would say it is much simplified and powerful than WF3 designer. you can start from here:
    Workflow Designer Programming Model
    WPF will enable us create some really good looks Activity Designers. I also saw people create some great customized WF4 designer in CodeProject site. for example,this one: http://www.codeproject.com/KB/WF/MessageMediation.aspx

    Regards

    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support
    • Marked as answer by Andrew_Zhu Monday, May 31, 2010 2:01 AM
    Tuesday, May 25, 2010 7:12 AM
  • Thanks for your reply.

    I saw some video about AppFabric, Can AppFabric handle the multi-version Scenario :
    I'm designing a workflow engine basic on WF4, there is a End User Designer to design the workflow, every time the user edit the workflow, a new version workflow activity is generated, we save these different versions of Xaml in database.

     By using WorkflowApplicatoin, I can control the WorkkflowApplicaton and it's Workflow Actitity by the version information. but in AppFabric, can I do it?

    Tuesday, May 25, 2010 7:42 AM
  • Hi, Jianyi

    ->"I'm designing a workflow engine basic on WF4, there is a End User Designer to design the workflow, every time the user edit the workflow, a new version workflow activity is generated, we save these different versions of Xaml in database."
    I don't think Appfabric can do the version control for us, we still need to write our own code to control different version workflows.

    Regards
    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support
    Friday, May 28, 2010 8:05 AM