locked
In which scenario serializing workflow and activity to and from XAML is required. RRS feed

Answers

  • there are a lot of scenarioes.

    ex, if you know the workflowdesigner, the whole workflow definition is saved in xaml.

    when you want to execute the saved workflow, you need to convert the xaml to the activity(ex, dynamicActivity), then call execute.

     

    if you want to open a workflow definition instance in workflow designer, you need to convert the instance to xaml format, and then open in VS workflow designer.

    • Marked as answer by Andrew_Zhu Thursday, January 27, 2011 5:00 AM
    Friday, January 21, 2011 2:04 AM
  • Hi, Neha

    When we build a WF4 workflow in VS2010.VS2010 will do a lot of stuffs in the back end so that we can call XAML workflow in .net managed code directly.

    However, in the production environment, your host may not compile those xaml workflows automaticlly(IIS7 will compile and run xamlx automaticlly.). to use these xaml workflows you need first convert them to .net objects, now, it is time to deserialize xaml workflow to objects.

    For example:

    Activity workflowImplementation =
                    ActivityXamlServices.Load(@"path\Workflow1.xaml");

    So, when do we use serializaton? some developer may prefer to creating workflow in pure c# code rather than workflow designer. and want to save those C# workflow in xaml file, it is time to use serialization.

    Regards

     

     


    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    • Proposed as answer by Jeff Cao Tuesday, January 25, 2011 6:40 AM
    • Marked as answer by Andrew_Zhu Thursday, January 27, 2011 5:00 AM
    Tuesday, January 25, 2011 6:36 AM

All replies

  • there are a lot of scenarioes.

    ex, if you know the workflowdesigner, the whole workflow definition is saved in xaml.

    when you want to execute the saved workflow, you need to convert the xaml to the activity(ex, dynamicActivity), then call execute.

     

    if you want to open a workflow definition instance in workflow designer, you need to convert the instance to xaml format, and then open in VS workflow designer.

    • Marked as answer by Andrew_Zhu Thursday, January 27, 2011 5:00 AM
    Friday, January 21, 2011 2:04 AM
  • Hi,

    The workflow which i have created are in XAML. I am still not clear in which scenario serializing workflow and activity to and from XAML is required (my workflows are in XAML).

    Regards,

    Neha

    Monday, January 24, 2011 7:53 AM
  • Hi, Neha

    When we build a WF4 workflow in VS2010.VS2010 will do a lot of stuffs in the back end so that we can call XAML workflow in .net managed code directly.

    However, in the production environment, your host may not compile those xaml workflows automaticlly(IIS7 will compile and run xamlx automaticlly.). to use these xaml workflows you need first convert them to .net objects, now, it is time to deserialize xaml workflow to objects.

    For example:

    Activity workflowImplementation =
                    ActivityXamlServices.Load(@"path\Workflow1.xaml");

    So, when do we use serializaton? some developer may prefer to creating workflow in pure c# code rather than workflow designer. and want to save those C# workflow in xaml file, it is time to use serialization.

    Regards

     

     


    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    • Proposed as answer by Jeff Cao Tuesday, January 25, 2011 6:40 AM
    • Marked as answer by Andrew_Zhu Thursday, January 27, 2011 5:00 AM
    Tuesday, January 25, 2011 6:36 AM