Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
DynamicSalutationRulesActivity - WF4 dynamic activity
/// <summary>
/// Translates a "MyRule" object to a Sequence of If-Then-Assign-Actions
/// </summary>
public class DynamicSalutationRulesActivity : Activity
public InArgument<Person> Person { get; set; }
public DynamicSalutationRulesActivity(List<SalutationAssignmentRule> rules)
var sequence = new Sequence();
this.Implementation = () => sequence;
// Sort descending - those added first are lowest priority
var sortedRules = rules.OrderByDescending(p => p.Priority).ToList();
// Convert to if-activities and add to sequence
foreach (var inRule in sortedRules)
var outRule = RuleConverter.ToIfActivity(inRule);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment