Skip to content

Instantly share code, notes, and snippets.

Embed
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)
{
Common.AddVbSetting(this);
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);
sequence.Activities.Add(outRule);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.