Development
Setup Persistence Database
To create the persistence database execute the following steps.
- Open
SQL Server Object Explorer
in Visual Studio 2015 - Expand
SQL Server
and(localdb)\MSSQLLocalDB (SQL Server 13.0.2151 - COMPUTERNAME\USERNAME)
- Right click on
Databases
- Select
Add New Database
from context menu- Database Name:
AppclusiveWorkflows
- Database Location:
C:\src\App_Data
- Database Name:
- Right click on newly created database
AppclusiveWorkflows
- Select
New Query
from context menu - Copy content of
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\SQL\EN\SqlWorkflowInstanceStoreSchema.sql
to the query window and execute query - Copy content of
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\SQL\EN\SqlWorkflowInstanceStoreLogic.sql
to 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
ArbitraryActivity
theArbitraryActivity.Design.dll
has to be in the same folder asArbitraryActivity.dll
- The project containing the workflow the
ArbitraryActivity
will be used in has to have references to both projects, theArbitraryActivity
project and theArbitraryActivity.Design
project.
Restrictions
- An Activity cannot contain parts of the project namespace in its name (i.e. an
Activity
with nameNet.Appclusive.Workflows.ArbitraryActivity
will not compile, if theArbitraryActivity
resides inNet.Appclusive.SomeProject
). Naming anActivity
likeNetAppclusiveWorkflowsArbitraryActivity
is not a problem. - When invoking an
Activity
based on its XAML definition theActivity
first has to be loaded usingActivityXamlServices
. Loading theActivity
results in a instance of typeDynamicActivity
. This means, that the type of theActivity
cannot be determined anymore. Because of thatWorkflowManagers
invoke method has to be called by passing the instance of the loadedActivity
instead of its type. Otherwise theWorkflowManager
will instantiate a newDynamicActivity
without any Properties, Variables and Arguments.