locked
Visual Tool for WF 4.0 other than Visual Studio RRS feed

  • Question

  • Is there a visual tool to model WF 4.0 other then VS 2010 ?

    Anyone with the related information, kindly share the details as i'm evaluating the option of seperate tool which can alter or create new Window Workflows in my production environment.

    Cheer.

    Wednesday, October 19, 2011 11:17 AM

Answers

  • Nauman,

    There are ways to create your own re-hostable viewers for WF 4.0 workflows. You can create a WPF application to do this and rehost the designer environment.  I've thrown together a simple application to load workflows for some of our users to view XAMLX files without needing VS 2010.  

    But as far as actually making modifications to the workflows and creating new ones , there isn't any way to do that.  There are rumors it might be in the next release. 

    Below is the code to rehost a workflow desgner in a WPF app:

    Window x:Class="WF4_designer.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="800" Width="800" WindowState="Maximized" WindowStartupLocation="CenterScreen">
        <Grid Name="grdMain">
            <Menu Grid.ColumnSpan="3" Height="23" HorizontalAlignment="Left" Name="mnuMain" VerticalAlignment="Top" Width="458">
                <MenuItem Header="UMC Workflow" Click="UMCMenu_Click" />
                <MenuItem Header="Parkland Workflow" Click="ParklandMenu_Click" />
            </Menu>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="4*" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
           
        </Grid>
    </Window>
    
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using System.Activities;
    using System.Activities.Core.Presentation;
    using System.Activities.Presentation;
    using System.Activities.Presentation.Metadata;
    using System.Activities.Presentation.Toolbox;
    using System.Activities.Statements;
    using System.ComponentModel;
    using ESIAdjudicationWorkflow;
    
    namespace WF4_designer
    {
        /// <summary>
        /// Interaction logic for MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window
        {
             private WorkflowDesigner wd;
    
            public MainWindow()
            {
                InitializeComponent();
                RegisterMetadata();
            }
    
            private void LoadWF(string _payor_key)
            {
    
                this.wd = null;
    
                this.wd = new WorkflowDesigner();
    
                Grid.SetColumn(this.wd.View, 1);
    
                grdMain.Children.Clear();
    
                if (_payor_key == "UMC01")
                    this.wd.Load(@"AdjudicationFlowUMC.xamlx");
    
                if (_payor_key == "PHHS01")
                    this.wd.Load(@"AdjudicationFlow_Parkland.xamlx");
    
                grdMain.Children.Add(this.mnuMain);
                grdMain.Children.Add(this.wd.View);
                grdMain.Children.Add(this.wd.PropertyInspectorView);
                
            }
    
            private void RegisterMetadata()
            {
                DesignerMetadata dm = new DesignerMetadata();
                dm.Register();
            }
    
    
            private void UMCMenu_Click(object sender, RoutedEventArgs e)
            {
                LoadWF("UMC01");
            }
    
            private void ParklandMenu_Click(object sender, RoutedEventArgs e)
            {
                LoadWF("PHHS01");
            }
    
    
        }
    
    
    
        }
    
    
    

     


    Tom Overton
    • Marked as answer by Nauman Khan Thursday, October 20, 2011 4:13 AM
    Wednesday, October 19, 2011 2:09 PM
  • It's not only a viewer. Where the hell do you get that idea?

    WF4 brings a fully functional editor that can be rehosted on any WPF as a control. In fact it is the same control used by VS 2010.

     

    Check this link for a fully functional example, with sample code: http://msmvps.com/blogs/theproblemsolver/archive/2009/12/23/rehosting-the-workflow-designer-in-wf4.aspx

    • Marked as answer by Nauman Khan Thursday, October 20, 2011 4:13 AM
    Wednesday, October 19, 2011 6:56 PM

All replies

  • Nauman,

    There are ways to create your own re-hostable viewers for WF 4.0 workflows. You can create a WPF application to do this and rehost the designer environment.  I've thrown together a simple application to load workflows for some of our users to view XAMLX files without needing VS 2010.  

    But as far as actually making modifications to the workflows and creating new ones , there isn't any way to do that.  There are rumors it might be in the next release. 

    Below is the code to rehost a workflow desgner in a WPF app:

    Window x:Class="WF4_designer.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="800" Width="800" WindowState="Maximized" WindowStartupLocation="CenterScreen">
        <Grid Name="grdMain">
            <Menu Grid.ColumnSpan="3" Height="23" HorizontalAlignment="Left" Name="mnuMain" VerticalAlignment="Top" Width="458">
                <MenuItem Header="UMC Workflow" Click="UMCMenu_Click" />
                <MenuItem Header="Parkland Workflow" Click="ParklandMenu_Click" />
            </Menu>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="4*" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
           
        </Grid>
    </Window>
    
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using System.Activities;
    using System.Activities.Core.Presentation;
    using System.Activities.Presentation;
    using System.Activities.Presentation.Metadata;
    using System.Activities.Presentation.Toolbox;
    using System.Activities.Statements;
    using System.ComponentModel;
    using ESIAdjudicationWorkflow;
    
    namespace WF4_designer
    {
        /// <summary>
        /// Interaction logic for MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window
        {
             private WorkflowDesigner wd;
    
            public MainWindow()
            {
                InitializeComponent();
                RegisterMetadata();
            }
    
            private void LoadWF(string _payor_key)
            {
    
                this.wd = null;
    
                this.wd = new WorkflowDesigner();
    
                Grid.SetColumn(this.wd.View, 1);
    
                grdMain.Children.Clear();
    
                if (_payor_key == "UMC01")
                    this.wd.Load(@"AdjudicationFlowUMC.xamlx");
    
                if (_payor_key == "PHHS01")
                    this.wd.Load(@"AdjudicationFlow_Parkland.xamlx");
    
                grdMain.Children.Add(this.mnuMain);
                grdMain.Children.Add(this.wd.View);
                grdMain.Children.Add(this.wd.PropertyInspectorView);
                
            }
    
            private void RegisterMetadata()
            {
                DesignerMetadata dm = new DesignerMetadata();
                dm.Register();
            }
    
    
            private void UMCMenu_Click(object sender, RoutedEventArgs e)
            {
                LoadWF("UMC01");
            }
    
            private void ParklandMenu_Click(object sender, RoutedEventArgs e)
            {
                LoadWF("PHHS01");
            }
    
    
        }
    
    
    
        }
    
    
    

     


    Tom Overton
    • Marked as answer by Nauman Khan Thursday, October 20, 2011 4:13 AM
    Wednesday, October 19, 2011 2:09 PM
  • It's not only a viewer. Where the hell do you get that idea?

    WF4 brings a fully functional editor that can be rehosted on any WPF as a control. In fact it is the same control used by VS 2010.

     

    Check this link for a fully functional example, with sample code: http://msmvps.com/blogs/theproblemsolver/archive/2009/12/23/rehosting-the-workflow-designer-in-wf4.aspx

    • Marked as answer by Nauman Khan Thursday, October 20, 2011 4:13 AM
    Wednesday, October 19, 2011 6:56 PM
  • joao,

    You're right you could modify and save the XAMLX (although in that example you sent it doesn't show how to do that, only load an existing xamlx and run it).

    But you're pretty limited in the designer if we're talking about giving full blown ability to create a new workflow from scratch. Most of the time you need to write some code and do some custom code or native activities and you can't do that without VS.  I see the designer rehosting as being okay for users to do alterations to existing programmer created wf's which may be all the OP needs done.   


    Tom Overton
    Wednesday, October 19, 2011 7:24 PM
  • You can do with the rehosted designer exactly the same thing you can with native designer within VS2010. If that's limited or not that's questionable and debatable.

    If you want to make custom activities that you aren't able to achieve without custom code, of course you need to write them on any kind of text editor, VS or not, but that has nothing to do with the designer limitations. At a certain point, for any kind of software, code must be written and not "designed".

    Wednesday, October 19, 2011 7:50 PM
  • Thanks guys, this has been a great help to me to kick start my own custom designer.

     

    Cheer.

    Thursday, October 20, 2011 4:13 AM