Using Variables with a .NET Framework 3.5 Ruleset
This sample demonstrates how to create a workflow that uses the Interop activity to integrate a custom activity written in .NET Framework 3.5 that uses policy and rules. The workflow passes data to the custom activity by binding variables to the dependency properties exposed by the custom activity.
To examine TravelRuleLibrary
Using Visual Studio, open the InteropWith35RuleSet.sln solution file.
Open the TravelRuleSet.cs in the workflow designer.
A custom sequential activity that contains a PolicyActivity is displayed.
Double-click the DiscountPolicy policy activity to examine the rules.
The Rules editor pops up to show the rules.
Right click the
DiscountPolicyand select the View Code option to examine the code beside C# code for the activity.
Observe the dependency property setting for
DiscountLevel. This is equivalent to arguments in .NET Framework 4.5. For more information aboutarguments, see Variables and Arguments.
This is a sequential workflow project that uses the Interop activity to integrate with the custom Rule set created in the
TravelRuleLibrary project. Variables are created on the top level Sequence activity. The Interop activity is used to integrate with the
TravelRuleSet activity. The variables that are declared on the Sequence are used to bind to the dependency properties.
To use this sample
Using Visual Studio 2010, open the InteropWith35RuleSet.sln solution file.
To build the solution, press CTRL+SHIFT+B.
To run the solution, press CTRL+F5.
The samples may already be installed on your machine. Check for the following (default) directory before continuing.