Bill Chow

I tried to develop a custom avtivity that contains a sequence activity. The first goal is to let workflow developer be able to add one or more child activities into the contianied SequenceActivity.

After I drag and drop this custom activity into the designer view. There is a lock on the contained SequenceActivity and I can not drag & drop any child activity to insert it either into my custom activity or into the contained SequenceActivity.

Is there any reason why Microsoft does not allow this insert child activities operation. How can I work arround it

Here is the code of this TestCustomActivity for reference

public partial class TestCustomActivity: SequenceActivity

{

public TestCustomActivity()

{

InitializeComponent();

}

}

public partial class TestCustomActivity

{

#region Designer generated code

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

[System.Diagnostics.DebuggerNonUserCode]

private void InitializeComponent()

{

this.CanModifyActivities = true;

this.sequenceActivity1 = new System.Workflow.Activities.SequenceActivity();

//

// sequenceActivity1

//

this.sequenceActivity1.Name = "sequenceActivity1";

//

// TestCustomActivity

//

this.Activities.Add(this.sequenceActivity1);

this.Name = "TestCustomActivity";

this.CanModifyActivities = false;

}

#endregion

private SequenceActivity sequenceActivity1;

}



Re: Windows Workflow Foundation How to develop a custom activity which conains a SequenceActivity and allow user to add child activities into it?

Constantin Mihai - MSFT

Bill,

This behavior that you noticed is by design. Custom activities are black boxes (logic encapsulations meant to be used in exactly the same way in different contexts). So you cannot change their content when using them in a workflow.

Thanks,

-Constantin





Re: Windows Workflow Foundation How to develop a custom activity which conains a SequenceActivity and allow user to add child activities into it?

SonaliC

There is a workaround for this. Check this post and links in Tom Lake's reply

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






Re: Windows Workflow Foundation How to develop a custom activity which conains a SequenceActivity and allow user to add child activities into it?

MichaelConst

what is the difference between say a custom activitiy like Sequence or Parallel or any other kind of composite with some child activities execution logic and this They are all custom, but the former does allow adding child activities at design time, but this particular one does not.