1

I have a rehosted WF4 designer in an existing desktop application. As the form with the designer loads, the designer automatically adds an activity to the designer (which acts as a parent - much like a sequence) and creates variables for the user to use as they continue to design the Workflow.

When a child custom activity is dropped in to this parent activity, I want it to access the values of the variables in the parent activity to use, but at user design time (ie - when the designer is presented to the user). Not as the Workflow is executed. I can't seem to find a way to do it.

I'm sure it can be done as it seems like a straight forward request to me. Any help would be wonderful.

dgw
  • 13,418
  • 11
  • 56
  • 54
  • Hi David - Thanks for the quick response. If there is another way of doing it, then I'm all ears as I'm new to WF4. I'm basically passing in parameters to the designer which end up as variables. Then, when dropping a custom activity on to the parent activity, it's displaying a dialog box with a combo box, but the data needs to be filtered on the values I've passed in. Hope that makes sense. Thanks again, Michael – Michael Wilkinson Mar 29 '12 at 16:55

1 Answers1

0

Designer
Add item and bind the modelbody

<sap:WorkflowItemPresenter x:Uid="sap:WorkflowWebDriver" BorderThickness="1" BorderBrush="Black" Margin="0,10,0,10"
                                               HintText="Drop Activities Here" Item="{Binding Path=ModelItem.Body, Mode=TwoWay}">
                            </sap:WorkflowItemPresenter>

Coding side Using ScheduleActivity we can call and run child activities.

 protected override void Execute(NativeActivityContext context)
        {           
            if (this.Body != null)
            {
                context.ScheduleActivity(this.Body);
            }
        }