Development
Setup Persistence Database
To create the persistence database execute the following steps.
- Open
SQL Server Object Explorerin Visual Studio 2015 - Expand
SQL Serverand(localdb)\MSSQLLocalDB (SQL Server 13.0.2151 - COMPUTERNAME\USERNAME) - Right click on
Databases - Select
Add New Databasefrom context menu- Database Name:
AppclusiveWorkflows - Database Location:
C:\src\App_Data
- Database Name:
- Right click on newly created database
AppclusiveWorkflows - Select
New Queryfrom context menu - Copy content of
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\SQL\EN\SqlWorkflowInstanceStoreSchema.sqlto the query window and execute query - Copy content of
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\SQL\EN\SqlWorkflowInstanceStoreLogic.sqlto the query window and execute query
Design for an Activity
The following blog post explains how to create a design for an Activity.
Associating a WF4 activity designer to a custom activity using MetadataStore
Important
The following points have to be considered when creating a design for an Activity
- In order for Visual Studio activity designer to present the designer for
ArbitraryActivitytheArbitraryActivity.Design.dllhas to be in the same folder asArbitraryActivity.dll - The project containing the workflow the
ArbitraryActivitywill be used in has to have references to both projects, theArbitraryActivityproject and theArbitraryActivity.Designproject.
Restrictions
- An Activity cannot contain parts of the project namespace in its name (i.e. an
Activitywith nameNet.Appclusive.Workflows.ArbitraryActivitywill not compile, if theArbitraryActivityresides inNet.Appclusive.SomeProject). Naming anActivitylikeNetAppclusiveWorkflowsArbitraryActivityis not a problem. - When invoking an
Activitybased on its XAML definition theActivityfirst has to be loaded usingActivityXamlServices. Loading theActivityresults in a instance of typeDynamicActivity. This means, that the type of theActivitycannot be determined anymore. Because of thatWorkflowManagersinvoke method has to be called by passing the instance of the loadedActivityinstead of its type. Otherwise theWorkflowManagerwill instantiate a newDynamicActivitywithout any Properties, Variables and Arguments.