Click here to Skip to main content
15,884,176 members
Articles / Desktop Programming / XAML

A dynamic Rehosted Workflow Designer for WF 4

Rate me:
Please Sign up or sign in to vote.
4.85/5 (26 votes)
29 Jul 2012CPOL10 min read 111.6K   11.8K   78  
This article presents a framework allowing you to integrate the workflow designer more easily in your own applications
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration"/>
    <section name="modules" type="Microsoft.Practices.Prism.Modularity.ModulesConfigurationSection, Microsoft.Practices.Prism"/>
  </configSections>
  <modules>
    <module assemblyFile="Selen.WorkflowTypeManagementModule.dll"
        moduleType="Selen.WorkflowTypeManagementModule.TypeSelectorModule, Selen.WorkflowTypeManagementModule"
        moduleName="TypeSelectorModule"/>
    <module assemblyFile="Selen.WorkflowSaveModule.dll"
        moduleType="Selen.WorkflowSaveModule.TypeBasedSaveModule, Selen.WorkflowSaveModule"
        moduleName="TypeBasedSaveModule"/>
    <module assemblyFile="RehostedDesigner.Designer.ViewModule.dll"
        moduleType="RehostedDesigner.Designer.ViewModule.StandardViewModule, RehostedDesigner.Designer.ViewModule"
        moduleName="DesignerModule"/>
    <module assemblyFile="RehostedDesigner.ToolboxModule.dll"
        moduleType="RehostedDesigner.ToolboxModule.StandardToolboxModule, RehostedDesigner.ToolboxModule"
        moduleName="StandardToolboxModule"/>
    <module assemblyFile="Selen.WorkflowStoragePropertyInspectorModule.dll"
        moduleType="Selen.WorkflowStoragePropertyInspectorModule.StoragePropertyInspectorViewModule, Selen.WorkflowStoragePropertyInspectorModule"
        moduleName="StoragePropertyInspectorViewModule"/>
    <module assemblyFile="RehostedDesigner.FileSystemManagerModule.dll"
        moduleType="RehostedDesigner.FileSystemManagerModule.StandardFileSystemManagerModule, RehostedDesigner.FileSystemManagerModule"
        moduleName="StandardFileSystemManagerModule"/>
    <module assemblyFile="RehostedDesigner.XamlViewModule.dll"
        moduleType="RehostedDesigner.XamlViewModule.StandardXamlViewModule, RehostedDesigner.XamlViewModule"
        moduleName="StandardXamlViewModule"/>
  </modules>
  <unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
    <alias alias="singleton" type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager,Microsoft.Practices.Unity" />
    <container>
      <register name="StandardFileSystemManagerViewModel"
          type="System.Object"
          mapTo="RehostedDesigner.FileSystemManagerModule.StandardFileSystemManagerViewModel, RehostedDesigner.FileSystemManagerModule">
        <lifetime type="singleton"/>
      </register>
      <register name="WorkflowSaveViewModel"
          type="System.Object"
          mapTo="Selen.WorkflowSaveModule.ViewModels.WorkflowSaveViewModel, Selen.WorkflowSaveModule.ViewModels">
        <lifetime type="singleton"/>
      </register>
      <register name="WorkflowTypeDialogViewModel"
          type="System.Object"
          mapTo="Selen.WorkflowTypeManagementModule.ViewModels.WorkflowTypeDialogViewModel, Selen.WorkflowTypeManagementModule.ViewModels"/>
      <register type="Selen.WorkflowDesigner.Contracts.IMainViewModel, Selen.WorkflowDesigner.Contracts"
          mapTo="Selen.WorkflowDesigner.ViewModels.MainViewModel, Selen.WorkflowDesigner.ViewModels">
        <lifetime type="singleton"/>
      </register>
      <register type="RehostedDesigner.Designer.ViewModels.Contracts.IDesignerViewModel, RehostedDesigner.Designer.ViewModels.Contracts"
          mapTo="RehostedDesigner.Designer.ViewModels.StandardDesignerViewModel, RehostedDesigner.Designer.ViewModels">
        <lifetime type="singleton"/>
      </register>
      <register type="RehostedDesigner.ToolboxModule.Contracts.IToolboxViewModel, RehostedDesigner.ToolboxModule.Contracts"
          mapTo="RehostedDesigner.ToolboxModule.StandardToolboxViewModel, RehostedDesigner.ToolboxModule">
        <lifetime type="singleton"/>
      </register>
      <register type="Selen.WorkflowDesigner.Storage.Contracts.WorkflowStorageData, Selen.WorkflowDesigner.Storage.Contracts">
        <lifetime type="singleton"/>
      </register>
      <register name="XamlViewModel"
        type="System.Object"
        mapTo="RehostedDesigner.XamlViewModule.StandardXamlViewModel, RehostedDesigner.XamlViewModule">
        <lifetime type="singleton"/>
      </register>
      <register name="Selen.ActivityWorkflowType"
        type="Selen.WorkflowDesigner.Storage.Contracts.IWorkflowType, Selen.WorkflowDesigner.Storage.Contracts"
        mapTo="Selen.ActivityWorkflowType.VoidActivityType, Selen.ActivityWorkflowType">
        <lifetime type="singleton"/>
      </register>
    </container>
  </unity>
  <connectionStrings>
    <add name="ProcessStepModelContainer" connectionString="metadata=res://*/ProcessStepWorkflowModel.csdl|res://*/ProcessStepWorkflowModel.ssdl|res://*/ProcessStepWorkflowModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=W16IT042\SQLEXPRESS;initial catalog=ProcessStepWorkflowDatabase;user id=sa;password=Traceability;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
  <appSettings>
    <add key="activityFolder" value="activities"/>
    <add key="compiledActivityFolder" value="activityModules"/>
  </appSettings>
  <system.diagnostics>
    <trace autoflush="true" indentsize="4">
      <listeners>
        <add name="TextListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="trace.log"/>
        <remove name="Default" />
      </listeners>
    </trace>
  </system.diagnostics>
</configuration>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Student
Germany Germany
I´m a student and hobby programmer from Germany.

Comments and Discussions