In developing some workflow stuff, ran across the need to create custom activities that “aggregate” other atomic activities into a larger activity. The idea is that
Programmer codes some atomic activities, exposes appropriate Dependency Properties
- Uses these atomics and creates processes using the atomic compiled activities
- Saves these composite activities as a new custom activity3. Can expose specific parameters for inner activities, but otherwise the activity is “locked” for the end user.
- Uses the composite activities to define a workflow and run it.
- Can bind runtime parameters to the composite activities.
Runtime picks up an end user’s activity and runs it.
Designer re-hosting is a bit more complex than I would like it to be..
Had to fool around with designer emitted dependency properties “Promote Bindable Properties” and ensure it would do the trick. This is the best way I found so far to expose inner properties of the atomic activities to the “surface” of the composite activities and allow the end user to assign values to them.
Had to add to the compilation a ToolboxItem attribute (the re-hosting examples don’t do that, and since the non programmer does NOT have access to the code beside file, you have to add it within the designer compilation of the designer activity. The exact magic incantations are: