locked
Binding activities at run-time

    Question

  • I have 4 custom activities (possibly more, activity names will vary):

    Activity1, Activity2 and Activity3 expose several different properties of type DependencyProperty.

    For the sake of this example lets say that: Activity1 exposes properties a1a, a1b and a1c, Activity2 exposes properties a2a, a2b and a3c and Activity3 exposes properties a3a, a3b and a3c

    Activity4 is an engine with several public properties. The properties must be bound to the exposed activity properties from above at run-time by customers. In other words customers will decide what activities to use and what properties to bind. For that I supply to them a custom workflow designer. No coding on the customer's side should be required.

    So, basically what I need is to allow customers to drag ActivityX and Activity4 on the workflow designer, select property aXn and bind it to one of the public properties in Activity4.

    From what I read on the net it is very possible with WWF, but couldn't find many step-by-step implementation examples on this subject yet.

    Thanks in advance.

    Wednesday, January 10, 2007 6:11 PM

Answers

  • Activity binding is a design time feature.  You cannot add bindings at runtime.

    You should probably look into setting the bindings during design time based on what the users select, before compiling/running the workflow.

    Thursday, January 11, 2007 7:35 AM
    Moderator

All replies

  • I kept searching around and found this thread:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=983575&SiteID=1

    After trying SetBinding approach I surely got the infamous "This operation can not be performed at runtime" error. Is there any other way to perform this dynamic binding (or runtime binding)? Is there any way of dynamically binding activity properties in general?

    Thanks.

    Wednesday, January 10, 2007 10:34 PM
  • Activity binding is a design time feature.  You cannot add bindings at runtime.

    You should probably look into setting the bindings during design time based on what the users select, before compiling/running the workflow.

    Thursday, January 11, 2007 7:35 AM
    Moderator