I'm creating an ActivityToolboxItem for a custom Activity in WF. I'm trying to do as much work as possible for the designers within the CreateComponentsCore method. What I'm trying to end up with is the following:
1) My custom activity (TriggerActivity, a SequenceActivity), containing the following:
2) A TriggerEvaluatorActivity (a simple Activity), which is bound to a property on the TriggerActivity
3) An IfElseActivity, which has two branches
4) An IfElseBranchActivity that contains
5) A TerminateActivity, and
6) An IfElseBranchActivity that is empty, through which execution flows when the TriggerEvaluatorActivity evaluates to true.
Designers switch out the TriggerEvaluatorActivity with one or more implementations that perform complex evaluations against an execution context.
Its pretty simple to set this up in code, but I'm completely stuck on how to spin up an ActivityCondition that will be added to the IfElseBranchActivity to control the flow of execution.
All I need to do is evaluate a property on the TriggerEvaluatorActivity. I've created a nice lovely Rule via the code dom, but I can't set that directly on the IfElseBranchActivity, I have to stash the rule somewhere and reference it in the activity.
So, I guess my question is, once I've created a rule in code, how do I add my rule to the workflow from within a custom ActivityToolboxItem so that the activities I build in code can reference it?